1 line
16 KiB
JSON
1 line
16 KiB
JSON
{"ast":null,"code":"/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, 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 { 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';\n\nvar VisualMapView =\n/** @class */\nfunction (_super) {\n __extends(VisualMapView, _super);\n\n function VisualMapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\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\n VisualMapView.prototype.init = function (ecModel, api) {\n this.ecModel = ecModel;\n this.api = api;\n };\n /**\n * @protected\n */\n\n\n VisualMapView.prototype.render = function (visualMapModel, ecModel, api, payload // TODO: TYPE\n ) {\n this.visualMapModel = visualMapModel;\n\n if (visualMapModel.get('show') === false) {\n this.group.removeAll();\n return;\n }\n\n this.doRender(visualMapModel, ecModel, api, payload);\n };\n /**\n * @protected\n */\n\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\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 = {}; // Default values.\n\n if (visualCluster === 'color') {\n var defaultColor = visualMapModel.get('contentColor');\n visualObj.color = defaultColor;\n }\n\n function getter(key) {\n return visualObj[key];\n }\n\n function setter(key, value) {\n visualObj[key] = value;\n }\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\n if (opts.convertOpacityToAlpha && type === 'opacity') {\n type = 'colorAlpha';\n visualMapping = mappings.__alphaForOpacity;\n }\n\n if (VisualMapping.dependsOn(type, visualCluster)) {\n visualMapping && visualMapping.applyVisual(targetValue, getter, setter);\n }\n });\n return visualObj[visualCluster];\n };\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\n VisualMapView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {};\n\n VisualMapView.type = 'visualMap';\n return VisualMapView;\n}(ComponentView);\n\nexport default VisualMapView;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/ElectronicMallVue/node_modules/echarts/lib/component/visualMap/VisualMapView.js"],"names":["__extends","zrUtil","Rect","formatUtil","layout","VisualMapping","ComponentView","VisualMapView","_super","_this","apply","arguments","type","autoPositionValues","left","right","top","bottom","prototype","init","ecModel","api","render","visualMapModel","payload","get","group","removeAll","doRender","renderBackground","padding","normalizeCssArray","rect","getBoundingRect","add","z2","silent","shape","x","y","width","height","style","fill","stroke","lineWidth","getControllerVisual","targetValue","visualCluster","opts","forceState","visualObj","defaultColor","color","getter","key","setter","value","mappings","controllerVisuals","getValueState","visualTypes","prepareVisualTypes","each","visualMapping","convertOpacityToAlpha","__alphaForOpacity","dependsOn","applyVisual","positionGroup","model","positionElement","getBoxLayoutParams","getWidth","getHeight"],"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,SAASC,IAAT,QAAqB,uBAArB;AACA,OAAO,KAAKC,UAAZ,MAA4B,sBAA5B;AACA,OAAO,KAAKC,MAAZ,MAAwB,sBAAxB;AACA,OAAOC,aA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mD,aAAxB,GAAwC,UAAU3C,KAAV,EAAiB;AACvD,QAAI4C,KAAK,GAAG,KAAK/C,cAAjB;AACA,QAAIF,GAAG,GAAG,KAAKA,GAAf;AACAjB,IAAAA,MAAM,CAACmE,eAAP,CAAuB7C,KAAvB,EAA8B4C,KAAK,CAACE,kBAAN,EAA9B,EAA0D;AACxDhC,MAAAA,KAAK,EAAEnB,GAAG,CAACoD,QAAJ,EADiD;AAExDhC,MAAAA,MAAM,EAAEpB,GAAG,CAACqD,SAAJ;AAFgD,KAA1D;AAID,GAPD;;AASAnE,EAAAA,aAAa,CAACW,SAAd,CAAwBU,QAAxB,GAAmC,UAAUL,cAAV,EAA0BH,OAA1B,EAAmCC,GAAnC,EAAwCG,OAAxC,EAAiD,CAAE,CAAtF;;AAEAjB,EAAAA,aAAa,CAACK,IAAd,GAAqB,WAArB;AACA,SAAOL,aAAP;AACD,CAzHD,CAyHED,aAzHF,CAFA;;AA6HA,eAAeC,aAAf","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 { 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';\n\nvar VisualMapView =\n/** @class */\nfunction (_super) {\n __extends(VisualMapView, _super);\n\n function VisualMapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\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\n VisualMapView.prototype.init = function (ecModel, api) {\n this.ecModel = ecModel;\n this.api = api;\n };\n /**\n * @protected\n */\n\n\n VisualMapView.prototype.render = function (visualMapModel, ecModel, api, payload // TODO: TYPE\n ) {\n this.visualMapModel = visualMapModel;\n\n if (visualMapModel.get('show') === false) {\n this.group.removeAll();\n return;\n }\n\n this.doRender(visualMapModel, ecModel, api, payload);\n };\n /**\n * @protected\n */\n\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\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 = {}; // Default values.\n\n if (visualCluster === 'color') {\n var defaultColor = visualMapModel.get('contentColor');\n visualObj.color = defaultColor;\n }\n\n function getter(key) {\n return visualObj[key];\n }\n\n function setter(key, value) {\n visualObj[key] = value;\n }\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\n if (opts.convertOpacityToAlpha && type === 'opacity') {\n type = 'colorAlpha';\n visualMapping = mappings.__alphaForOpacity;\n }\n\n if (VisualMapping.dependsOn(type, visualCluster)) {\n visualMapping && visualMapping.applyVisual(targetValue, getter, setter);\n }\n });\n return visualObj[visualCluster];\n };\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\n VisualMapView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {};\n\n VisualMapView.type = 'visualMap';\n return VisualMapView;\n}(ComponentView);\n\nexport default VisualMapView;"]},"metadata":{},"sourceType":"module"} |