| 1 |
- {"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/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\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 /**\r\n * If marker model is created by self from series\r\n */\n _this.createdBySelf = false;\n return _this;\n }\n /**\r\n * @overrite\r\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 /**\r\n * @overrite\r\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;","map":{"version":3,"names":["__extends","zrUtil","env","DataFormatMixin","ComponentModel","makeInner","defaultEmphasis","createTooltipMarkup","fillLabel","opt","inner","MarkerModel","_super","_this","apply","arguments","type","createdBySelf","prototype","init","option","parentModel","ecModel","process","NODE_ENV","Error","mergeDefaultAndTheme","_mergeOption","isAnimationEnabled","node","hostSeries","__hostSeries","getShallow","mergeOption","newOpt","isInit","componentType","mainType","eachSeries","seriesModel","markerOpt","get","markerModel","data","each","item","Array","createMarkerModelFromSeries","extend","seriesIndex","name","formatTooltip","dataIndex","multipleSeries","dataType","getData","value","getRawValue","itemName","getName","header","blocks","noName","noValue","_data","setData","getDataParams","params","call","seriesId","id","seriesName","seriesType","subType","getMarkerModelFromSeries","dependencies","mixin"],"sources":["E:/git/2021项目/安科院大屏/node_modules/echarts/lib/component/marker/MarkerModel.js"],"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/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\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 /**\r\n * If marker model is created by self from series\r\n */\n _this.createdBySelf = false;\n return _this;\n }\n /**\r\n * @overrite\r\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 /**\r\n * @overrite\r\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;"],"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,SAAS,QAAQ,OAAO;AACjC,OAAO,KAAKC,MAAM,MAAM,0BAA0B;AAClD,OAAOC,GAAG,MAAM,yBAAyB;AACzC,SAASC,eAAe,QAAQ,iCAAiC;AACjE,OAAOC,cAAc,MAAM,0BAA0B;AACrD,SAASC,SAAS,EAAEC,eAAe,QAAQ,qBAAqB;AAChE,SAASC,mBAAmB,QAAQ,6BAA6B;AACjE,SAASC,SAASA,CAACC,GAAG,EAAE;EACtBH,eAAe,CAACG,GAAG,EAAE,OAAO,EAAE,CAAC,MAAM,CA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