1 line
44 KiB
JSON
1 line
44 KiB
JSON
{"ast":null,"code":"import \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.regexp.exec.js\";\nimport \"core-js/modules/es.string.replace.js\";\nimport \"core-js/modules/es.number.to-fixed.js\";\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\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;\n\nvar VisualMapModel =\n/** @class */\nfunction (_super) {\n __extends(VisualMapModel, _super);\n\n function VisualMapModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\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\n _this.dataBound = [-Infinity, Infinity];\n _this.targetVisuals = {};\n _this.controllerVisuals = {};\n return _this;\n }\n\n VisualMapModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n };\n /**\n * @protected\n */\n\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\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\n\n VisualMapModel.prototype.getItemSymbol = function () {\n return null;\n };\n /**\n * @protected\n * @return {Array.<number>} An array of series indices.\n */\n\n\n VisualMapModel.prototype.getTargetSeriesIndices = function () {\n var optionSeriesIndex = this.option.seriesIndex;\n var seriesIndices = [];\n\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\n return seriesIndices;\n };\n /**\n * @public\n */\n\n\n VisualMapModel.prototype.eachTargetSeries = function (callback, context) {\n zrUtil.each(this.getTargetSeriesIndices(), function (seriesIndex) {\n var seriesModel = this.ecModel.getSeriesByIndex(seriesIndex);\n\n if (seriesModel) {\n callback.call(context, seriesModel);\n }\n }, this);\n };\n /**\n * @pubilc\n */\n\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\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\n if (zrUtil.isArray(value)) {\n value = value.slice();\n isMinMax = true;\n }\n\n var textValue = isCategory ? value // Value is string when isCategory\n : isMinMax ? [toFixed(value[0]), toFixed(value[1])] : toFixed(value);\n\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\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\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\n\n VisualMapModel.prototype.resetExtent = function () {\n var thisOption = this.option; // 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\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\n\n VisualMapModel.prototype.getDataDimensionIndex = function (data) {\n var optDim = this.option.dimension;\n\n if (optDim != null) {\n return data.getDimensionIndex(optDim);\n }\n\n var dimNames = data.dimensions;\n\n for (var i = dimNames.length - 1; i >= 0; i--) {\n var dimName = dimNames[i];\n var dimInfo = data.getDimensionInfo(dimName);\n\n if (!dimInfo.isCalculationCoord) {\n return dimInfo.storeDimIndex;\n }\n }\n };\n\n VisualMapModel.prototype.getExtent = function () {\n return this._dataExtent.slice();\n };\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\n zrUtil.merge(controller, base); // Do not override\n\n var isCategory = this.isCategory();\n completeSingle.call(this, target);\n completeSingle.call(this, controller);\n completeInactive.call(this, target, 'inRange', 'outOfRange'); // completeInactive.call(this, target, 'outOfRange', 'inRange');\n\n completeController.call(this, controller);\n\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) // 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 } // 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\n\n base.inRange = base.inRange || {\n color: ecModel.get('gradientColor')\n };\n }\n\n function completeInactive(base, stateExist, stateAbsent) {\n var optExist = base[stateExist];\n var optAbsent = base[stateAbsent];\n\n if (optExist && !optAbsent) {\n optAbsent = base[stateAbsent] = {};\n each(optExist, function (visualData, visualType) {\n if (!VisualMapping.isValidType(visualType)) {\n return;\n }\n\n var defa = visualDefault.get(visualType, 'inactive', isCategory);\n\n if (defa != null) {\n optAbsent[visualType] = defa; // Compatibable with ec2:\n // Only inactive color to rgba(0,0,0,0) can not\n // make label transparent, so use opacity also.\n\n if (visualType === 'color' && !optAbsent.hasOwnProperty('opacity') && !optAbsent.hasOwnProperty('colorAlpha')) {\n optAbsent.opacity = [0, 0];\n }\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]; // Set inactive color for controller if no other color\n // attr (like colorAlpha) specified.\n\n if (!visuals) {\n visuals = controller[state] = {\n color: isCategory ? inactiveColor : [inactiveColor]\n };\n } // Consistent symbol and symbolSize if not specified.\n\n\n if (visuals.symbol == null) {\n visuals.symbol = symbolExists && zrUtil.clone(symbolExists) || (isCategory ? defaultSymbol : [defaultSymbol]);\n }\n\n if (visuals.symbolSize == null) {\n visuals.symbolSize = symbolSizeExists && zrUtil.clone(symbolSizeExists) || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);\n } // Filter none\n\n\n visuals.symbol = mapVisual(visuals.symbol, function (symbol) {\n return symbol === 'none' ? defaultSymbol : symbol;\n }); // Normalize symbolSize\n\n var symbolSize = visuals.symbolSize;\n\n if (symbolSize != null) {\n var max_1 = -Infinity; // symbolSize can be object when categories defined.\n\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\n VisualMapModel.prototype.resetItemSize = function () {\n this.itemSize = [parseFloat(this.get('itemWidth')), parseFloat(this.get('itemHeight'))];\n };\n\n VisualMapModel.prototype.isCategory = function () {\n return !!this.option.categories;\n };\n /**\n * @public\n * @abstract\n */\n\n\n VisualMapModel.prototype.setSelected = function (selected) {};\n\n VisualMapModel.prototype.getSelected = function () {\n return null;\n };\n /**\n * @public\n * @abstract\n */\n\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\n\n VisualMapModel.prototype.getVisualMeta = function (getColorVisual) {\n return null;\n };\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);\n\nexport default VisualMapModel;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/ElectronicMallVue/node_modules/echarts/lib/component/visualMap/VisualMapModel.js"],"names":["__extends","zrUtil","visualDefault","VisualMapping","visualSolution","modelUtil","numberUtil","ComponentModel","mapVisual","eachVisual","isArray","each","asc","linearMap","VisualMapModel","_super","_this","apply","arguments","type","stateList","replacableOptionKeys","layoutMode","ignoreSize","dataBound","Infinity","targetVisuals","controllerVisuals","prototype","init","option","parentModel","ecModel","mergeDefaultAndTheme","optionUpdated","newOption","isInit","thisOption","replaceVisualOption","textStyleModel","getModel","resetItemSize","completeVisualOption","resetVisual","supplementVisualOption","bind","createVisualMappings","controller","target","getItemSymbol","getTargetSeriesIndices","optionSeriesIndex","seriesIndex","seriesIndices","eachSeries","seriesModel","index","push","normalizeToArray","eachTargetSeries","callback","context","getSeriesByIndex","call","isTargetSeries","is","model","formatValueText","value","isCategory","edgeSymbols","precision","formatter","isMinMax","slice","textValue","toFixed","isString","replace","isFunction","val","Math","min","resetExtent","extent","max","_dataExtent","getDataDimensionIndex","data","optDim","dimension","getDimensionIndex","dimNames","dimensions","i","length","dimName","dimInfo","getDimensionInfo","isCalculationCoord","storeDimIndex","getExtent","base","inRange","outOfRange","merge","completeSingle","completeInactive","completeController","color","reverse","get","stateExist","stateAbsent","optExist","optAbsent","visualData","visualType","isValidType","defa","hasOwnProperty","opacity","symbolExists","symbol","symbolSizeExists","symbolSize","inactiveColor","itemSymbol","defaultSymbol","state","itemSize","visuals","clone","max_1","parseFloat","categories","setSelected","selected","getSelected","getValueState","getVisualMeta","getColorVisual","dependencies","defaultOption","show","z","left","right","top","bottom","itemWidth","itemHeight","inverse","orient","backgroundColor","borderColor","contentColor","borderWidth","padding","textGap","textStyle"],"mappings":";;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,OAA1B;AACA,OAAO,KAAKC,MAAZ,MAAwB,0BAAxB;AACA,OAAOC,aAAP,MAA0B,+BAA1B;AACA,OAAOC,aAAP,MAA0B,+BAA1B;AACA,OAAO,KAAKC,cAAZ,MAAgC,gCAAhC;AACA,OAAO,KAAKC,SAAZ,MAA2B,qBAA3B;AACA,OAAO,KAAKC,UAAZ,MAA4B,sBAA5B;AACA,OAAOC,cAAP,MAA2B,0BAA3B;AACA,IAAIC,SAAS,GAAGL,aAAa,CAACK,SAA9B;AACA,IAAIC,UAAU,GAAGN,aAAa,CAACM,UAA/B;AACA,IAAIC,OAAO,GAAGT,MAAM,CAACS,OAArB;AACA,IAAIC,IAAI,GAAGV,MAAM,CAACU,IAAlB;AACA,IAAIC,GAAG,GAAGN,UAAU,CAACM,GAArB;AACA,IAAIC,SAAS,GAAGP,UAAU,CAACO,SAA3B;;AAEA,IAAIC,cAAc;AAClB;AACA,UAAUC,MAAV,EAAkB;AAChBf,EAAAA,SAAS,CAACc,cAAD,EAAiBC,MAAjB,CAAT;;AAEA,WAASD,cAAT,GAA0B;AACxB,QAAIE,KAAK,GAAGD,MAAM,KAAK,IAAX,IAAmBA,MAAM,CAACE,KAAP,CAAa,IAAb,EAAmBC,SAAnB,CAAnB,IAAoD,IAAhE;;AAEAF,IAAAA,KAAK,CAACG,IAAN,GAAaL,cAA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,EAAE,SAjBe;AAkB7B9B,IAAAA,aAAa,EAAE,MAlBc;AAmB7B+B,IAAAA,WAAW,EAAE,CAnBgB;AAoB7BC,IAAAA,OAAO,EAAE,CApBoB;AAqB7B;AACAC,IAAAA,OAAO,EAAE,EAtBoB;AAuB7BxF,IAAAA,SAAS,EAAE,CAvBkB;AAwB7ByF,IAAAA,SAAS,EAAE;AACTnD,MAAAA,KAAK,EAAE,MADE,CACK;;AADL;AAxBkB,GAA/B;AA6BA,SAAO/F,cAAP;AACD,CA5ZD,CA4ZEP,cA5ZF,CAFA;;AAgaA,eAAeO,cAAf","sourcesContent":["\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\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;\n\nvar VisualMapModel =\n/** @class */\nfunction (_super) {\n __extends(VisualMapModel, _super);\n\n function VisualMapModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\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\n _this.dataBound = [-Infinity, Infinity];\n _this.targetVisuals = {};\n _this.controllerVisuals = {};\n return _this;\n }\n\n VisualMapModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n };\n /**\n * @protected\n */\n\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\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\n\n VisualMapModel.prototype.getItemSymbol = function () {\n return null;\n };\n /**\n * @protected\n * @return {Array.<number>} An array of series indices.\n */\n\n\n VisualMapModel.prototype.getTargetSeriesIndices = function () {\n var optionSeriesIndex = this.option.seriesIndex;\n var seriesIndices = [];\n\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\n return seriesIndices;\n };\n /**\n * @public\n */\n\n\n VisualMapModel.prototype.eachTargetSeries = function (callback, context) {\n zrUtil.each(this.getTargetSeriesIndices(), function (seriesIndex) {\n var seriesModel = this.ecModel.getSeriesByIndex(seriesIndex);\n\n if (seriesModel) {\n callback.call(context, seriesModel);\n }\n }, this);\n };\n /**\n * @pubilc\n */\n\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\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\n if (zrUtil.isArray(value)) {\n value = value.slice();\n isMinMax = true;\n }\n\n var textValue = isCategory ? value // Value is string when isCategory\n : isMinMax ? [toFixed(value[0]), toFixed(value[1])] : toFixed(value);\n\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\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\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\n\n VisualMapModel.prototype.resetExtent = function () {\n var thisOption = this.option; // 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\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\n\n VisualMapModel.prototype.getDataDimensionIndex = function (data) {\n var optDim = this.option.dimension;\n\n if (optDim != null) {\n return data.getDimensionIndex(optDim);\n }\n\n var dimNames = data.dimensions;\n\n for (var i = dimNames.length - 1; i >= 0; i--) {\n var dimName = dimNames[i];\n var dimInfo = data.getDimensionInfo(dimName);\n\n if (!dimInfo.isCalculationCoord) {\n return dimInfo.storeDimIndex;\n }\n }\n };\n\n VisualMapModel.prototype.getExtent = function () {\n return this._dataExtent.slice();\n };\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\n zrUtil.merge(controller, base); // Do not override\n\n var isCategory = this.isCategory();\n completeSingle.call(this, target);\n completeSingle.call(this, controller);\n completeInactive.call(this, target, 'inRange', 'outOfRange'); // completeInactive.call(this, target, 'outOfRange', 'inRange');\n\n completeController.call(this, controller);\n\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) // 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 } // 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\n\n base.inRange = base.inRange || {\n color: ecModel.get('gradientColor')\n };\n }\n\n function completeInactive(base, stateExist, stateAbsent) {\n var optExist = base[stateExist];\n var optAbsent = base[stateAbsent];\n\n if (optExist && !optAbsent) {\n optAbsent = base[stateAbsent] = {};\n each(optExist, function (visualData, visualType) {\n if (!VisualMapping.isValidType(visualType)) {\n return;\n }\n\n var defa = visualDefault.get(visualType, 'inactive', isCategory);\n\n if (defa != null) {\n optAbsent[visualType] = defa; // Compatibable with ec2:\n // Only inactive color to rgba(0,0,0,0) can not\n // make label transparent, so use opacity also.\n\n if (visualType === 'color' && !optAbsent.hasOwnProperty('opacity') && !optAbsent.hasOwnProperty('colorAlpha')) {\n optAbsent.opacity = [0, 0];\n }\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]; // Set inactive color for controller if no other color\n // attr (like colorAlpha) specified.\n\n if (!visuals) {\n visuals = controller[state] = {\n color: isCategory ? inactiveColor : [inactiveColor]\n };\n } // Consistent symbol and symbolSize if not specified.\n\n\n if (visuals.symbol == null) {\n visuals.symbol = symbolExists && zrUtil.clone(symbolExists) || (isCategory ? defaultSymbol : [defaultSymbol]);\n }\n\n if (visuals.symbolSize == null) {\n visuals.symbolSize = symbolSizeExists && zrUtil.clone(symbolSizeExists) || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);\n } // Filter none\n\n\n visuals.symbol = mapVisual(visuals.symbol, function (symbol) {\n return symbol === 'none' ? defaultSymbol : symbol;\n }); // Normalize symbolSize\n\n var symbolSize = visuals.symbolSize;\n\n if (symbolSize != null) {\n var max_1 = -Infinity; // symbolSize can be object when categories defined.\n\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\n VisualMapModel.prototype.resetItemSize = function () {\n this.itemSize = [parseFloat(this.get('itemWidth')), parseFloat(this.get('itemHeight'))];\n };\n\n VisualMapModel.prototype.isCategory = function () {\n return !!this.option.categories;\n };\n /**\n * @public\n * @abstract\n */\n\n\n VisualMapModel.prototype.setSelected = function (selected) {};\n\n VisualMapModel.prototype.getSelected = function () {\n return null;\n };\n /**\n * @public\n * @abstract\n */\n\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\n\n VisualMapModel.prototype.getVisualMeta = function (getColorVisual) {\n return null;\n };\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);\n\nexport default VisualMapModel;"]},"metadata":{},"sourceType":"module"} |