qauMaWeb/node_modules/.cache/babel-loader/4c77234a341b6fdfd28c861ea0a...

1 line
23 KiB
JSON

{"ast":null,"code":"import \"core-js/modules/es.array.fill.js\";\nimport \"core-js/modules/es.regexp.exec.js\";\nimport \"core-js/modules/es.string.replace.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 * 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\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\n return style;\n}\n/**\n * @param {Function} labelPos {align, verticalAlign, position}\n */\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]; // Adjust by align.\n\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); // Not overflow ec container\n\n confineInContainer(position, width, height, api);\n var bgColor = labelModel.get('backgroundColor');\n\n if (!bgColor || bgColor === 'auto') {\n bgColor = axisModel.get(['axisLine', 'lineStyle', 'color']);\n }\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} // Do not overflow ec container\n\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}\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\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\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\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}","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src啊/ElectronicMallVue/node_modules/echarts/lib/component/axisPointer/viewHelper.js"],"names":["zrUtil","graphic","textContain","formatUtil","matrix","axisHelper","AxisBuilder","createTextStyle","buildElStyle","axisPointerModel","axisPointerType","get","styleModel","getModel","style","getLineStyle","fill","getAreaStyle","stroke","buildLabelElOption","elOption","axisModel","api","labelPos","value","text","getValueLabel","axis","ecModel","precision","formatter","labelModel","paddings","normalizeCssArray","font","getFont","textRect","getBoundingRect","position","width","height","align","verticalAlign","confineInContainer","bgColor","label","x","y","getTextColor","padding","backgroundColor","z2","viewWidth","getWidth","viewHeight","getHeight","Math","min","max","seriesDataIndices","opt","scale","parse","getLabel","params_1","getAxisRawValue","axisDimension","dim","axisIndex","index","seriesData","each","idxItem","series","getSeriesByIndex","seriesIndex","dataIndex","dataIndexInside","dataParams","getDataParams","push","isString","replace","isFunction","getTransformedPosition","layoutInfo","transform","create","rotate","rotation","translate","applyTransform","dataToCoord","labelOffset","labelDirection","labelMargin","buildCartesianSingleLabelElOption","textLayout","innerTextLayout","textAlign","textVerticalAlign","makeLineShape","p1","p2","xDimIndex","x1","y1","x2","y2","makeRectShape","xy","wh","makeSectorShape","cx","cy","r0","r","startAngle","endAngle","clockwise"],"mappings":";;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AAC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IN,SAAL,CAFA;AAGLjE,IAAAA,KAAK,EAAEwE,EAAE,CAACP,SAAD,CAHJ;AAILhE,IAAAA,MAAM,EAAEuE,EAAE,CAAC,IAAIP,SAAL;AAJL,GAAP;AAMD;AACD,OAAO,SAASQ,eAAT,CAAyBC,EAAzB,EAA6BC,EAA7B,EAAiCC,EAAjC,EAAqCC,CAArC,EAAwCC,UAAxC,EAAoDC,QAApD,EAA8D;AACnE,SAAO;AACLL,IAAAA,EAAE,EAAEA,EADC;AAELC,IAAAA,EAAE,EAAEA,EAFC;AAGLC,IAAAA,EAAE,EAAEA,EAHC;AAILC,IAAAA,CAAC,EAAEA,CAJE;AAKLC,IAAAA,UAAU,EAAEA,UALP;AAMLC,IAAAA,QAAQ,EAAEA,QANL;AAOLC,IAAAA,SAAS,EAAE;AAPN,GAAP;AASD","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 * 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\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\n return style;\n}\n/**\n * @param {Function} labelPos {align, verticalAlign, position}\n */\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]; // Adjust by align.\n\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); // Not overflow ec container\n\n confineInContainer(position, width, height, api);\n var bgColor = labelModel.get('backgroundColor');\n\n if (!bgColor || bgColor === 'auto') {\n bgColor = axisModel.get(['axisLine', 'lineStyle', 'color']);\n }\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} // Do not overflow ec container\n\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}\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\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\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\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}"]},"metadata":{},"sourceType":"module"}