| 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 { 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 /**\r\n * Get color property or get color from option.textStyle.color\r\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 /**\r\n * Create font string from fontStyle, fontWeight, fontSize, fontFamily\r\n * @return {string}\r\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;","map":{"version":3,"names":["getFont","ZRText","PATH_COLOR","textStyleParams","tmpText","TextStyleMixin","prototype","getTextColor","isEmphasis","ecModel","getShallow","get","fontStyle","fontWeight","fontSize","fontFamily","getTextRect","text","style","verticalAlign","i","length","useStyle","update","getBoundingRect"],"sources":["E:/git/2021项目/安科院大屏/node_modules/echarts/lib/model/mixin/textStyle.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 { 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 /**\r\n * Get color property or get color from option.textStyle.color\r\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 /**\r\n * Create font string from fontStyle, fontWeight, fontSize, fontFamily\r\n * @return {string}\r\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;"],"mappings":"AACA;AACA;AACA;AACA;AACA;AACA;AAC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