1 line
13 KiB
JSON
1 line
13 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 * as graphic from '../../util/graphic.js';\nimport { round } from '../../util/number.js';\nimport { isFunction } from 'zrender/lib/core/util.js';\n\nfunction createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) {\n var rect = cartesian.getArea();\n var x = rect.x;\n var y = rect.y;\n var width = rect.width;\n var height = rect.height;\n var lineWidth = seriesModel.get(['lineStyle', 'width']) || 2; // Expand the clip path a bit to avoid the border is clipped and looks thinner\n\n x -= lineWidth / 2;\n y -= lineWidth / 2;\n width += lineWidth;\n height += lineWidth; // fix: https://github.com/apache/incubator-echarts/issues/11369\n\n x = Math.floor(x);\n width = Math.round(width);\n var clipPath = new graphic.Rect({\n shape: {\n x: x,\n y: y,\n width: width,\n height: height\n }\n });\n\n if (hasAnimation) {\n var baseAxis = cartesian.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var isAxisInversed = baseAxis.inverse;\n\n if (isHorizontal) {\n if (isAxisInversed) {\n clipPath.shape.x += width;\n }\n\n clipPath.shape.width = 0;\n } else {\n if (!isAxisInversed) {\n clipPath.shape.y += height;\n }\n\n clipPath.shape.height = 0;\n }\n\n var duringCb = isFunction(during) ? function (percent) {\n during(percent, clipPath);\n } : null;\n graphic.initProps(clipPath, {\n shape: {\n width: width,\n height: height,\n x: x,\n y: y\n }\n }, seriesModel, null, done, duringCb);\n }\n\n return clipPath;\n}\n\nfunction createPolarClipPath(polar, hasAnimation, seriesModel) {\n var sectorArea = polar.getArea(); // Avoid float number rounding error for symbol on the edge of axis extent.\n\n var r0 = round(sectorArea.r0, 1);\n var r = round(sectorArea.r, 1);\n var clipPath = new graphic.Sector({\n shape: {\n cx: round(polar.cx, 1),\n cy: round(polar.cy, 1),\n r0: r0,\n r: r,\n startAngle: sectorArea.startAngle,\n endAngle: sectorArea.endAngle,\n clockwise: sectorArea.clockwise\n }\n });\n\n if (hasAnimation) {\n var isRadial = polar.getBaseAxis().dim === 'angle';\n\n if (isRadial) {\n clipPath.shape.endAngle = sectorArea.startAngle;\n } else {\n clipPath.shape.r = r0;\n }\n\n graphic.initProps(clipPath, {\n shape: {\n endAngle: sectorArea.endAngle,\n r: r\n }\n }, seriesModel);\n }\n\n return clipPath;\n}\n\nfunction createClipPath(coordSys, hasAnimation, seriesModel, done, during) {\n if (!coordSys) {\n return null;\n } else if (coordSys.type === 'polar') {\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\n } else if (coordSys.type === 'cartesian2d') {\n return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during);\n }\n\n return null;\n}\n\nexport { createGridClipPath, createPolarClipPath, createClipPath };","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/ElectronicMallVue/node_modules/echarts/lib/chart/helper/createClipPathFromCoordSys.js"],"names":["graphic","round","isFunction","createGridClipPath","cartesian","hasAnimation","seriesModel","done","during","rect","getArea","x","y","width","height","lineWidth","get","Math","floor","clipPath","Rect","shape","baseAxis","getBaseAxis","isHorizontal","isAxisInversed","inverse","duringCb","percent","initProps","createPolarClipPath","polar","sectorArea","r0","r","Sector","cx","cy","startAngle","endAngle","clockwise","isRadial","dim","createClipPath","coordSys","type"],"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,OAAO,KAAKA,OAAZ,MAAyB,uBAAzB;AACA,SAASC,KAAT,QAAsB,sBAAtB;AACA,SAASC,UAAT,QAA2B,0BAA3B;;AAEA,SAASC,kBAAT,CAA4BC,SAA5B,EAAuCC,YAAvC,EAAqDC,WAArD,EAAkEC,IAAlE,EAAwEC,MAAxE,EAAgF;AAC9E,MAAIC,IAAI,GAAGL,SAAS,CAACM,OAAV,EAAX;AACA,MAAIC,CAAC,GAAGF,IAAI,CAACE,CAAb;AACA,MAAIC,CAAC,GAAGH,IAAI,CAACG,CAAb;AACA,MAAIC,KAAK,GAAGJ,IAAI,CAACI,KAAjB;AACA,MAAIC,MAAM,GAAGL,IAAI,CAACK,MAAlB;AACA,MAAIC,SAAS,GAAGT,WAAW,CAACU,GAAZ,CAAgB,CAAC,WAAD,EAAc,OAAd,CAAhB,KAA2C,CAA3D,CAN8E,CAMhB;;AAE9DL,EAAAA,CAAC,IAAII,SAAS,GAAG,CAAjB;AACAH,EAAAA,CAAC,IAAIG,SAAS,GAAG,CAAjB;AACAF,EAAAA,KAAK,IAAIE,SAAT;AACAD,EAAAA,MAAM,IAAIC,SAAV,CAX8E,CAWzD;;AAErBJ,EAAAA,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O,CAAC6B,SAAR,CAAkBV,QAAlB,EAA4B;AAC1BE,MAAAA,KAAK,EAAE;AACLkB,QAAAA,QAAQ,EAAEP,UAAU,CAACO,QADhB;AAELL,QAAAA,CAAC,EAAEA;AAFE;AADmB,KAA5B,EAKG5B,WALH;AAMD;;AAED,SAAOa,QAAP;AACD;;AAED,SAASwB,cAAT,CAAwBC,QAAxB,EAAkCvC,YAAlC,EAAgDC,WAAhD,EAA6DC,IAA7D,EAAmEC,MAAnE,EAA2E;AACzE,MAAI,CAACoC,QAAL,EAAe;AACb,WAAO,IAAP;AACD,GAFD,MAEO,IAAIA,QAAQ,CAACC,IAAT,KAAkB,OAAtB,EAA+B;AACpC,WAAOf,mBAAmB,CAACc,QAAD,EAAWvC,YAAX,EAAyBC,WAAzB,CAA1B;AACD,GAFM,MAEA,IAAIsC,QAAQ,CAACC,IAAT,KAAkB,aAAtB,EAAqC;AAC1C,WAAO1C,kBAAkB,CAACyC,QAAD,EAAWvC,YAAX,EAAyBC,WAAzB,EAAsCC,IAAtC,EAA4CC,MAA5C,CAAzB;AACD;;AAED,SAAO,IAAP;AACD;;AAED,SAASL,kBAAT,EAA6B2B,mBAA7B,EAAkDa,cAAlD","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 graphic from '../../util/graphic.js';\nimport { round } from '../../util/number.js';\nimport { isFunction } from 'zrender/lib/core/util.js';\n\nfunction createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) {\n var rect = cartesian.getArea();\n var x = rect.x;\n var y = rect.y;\n var width = rect.width;\n var height = rect.height;\n var lineWidth = seriesModel.get(['lineStyle', 'width']) || 2; // Expand the clip path a bit to avoid the border is clipped and looks thinner\n\n x -= lineWidth / 2;\n y -= lineWidth / 2;\n width += lineWidth;\n height += lineWidth; // fix: https://github.com/apache/incubator-echarts/issues/11369\n\n x = Math.floor(x);\n width = Math.round(width);\n var clipPath = new graphic.Rect({\n shape: {\n x: x,\n y: y,\n width: width,\n height: height\n }\n });\n\n if (hasAnimation) {\n var baseAxis = cartesian.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var isAxisInversed = baseAxis.inverse;\n\n if (isHorizontal) {\n if (isAxisInversed) {\n clipPath.shape.x += width;\n }\n\n clipPath.shape.width = 0;\n } else {\n if (!isAxisInversed) {\n clipPath.shape.y += height;\n }\n\n clipPath.shape.height = 0;\n }\n\n var duringCb = isFunction(during) ? function (percent) {\n during(percent, clipPath);\n } : null;\n graphic.initProps(clipPath, {\n shape: {\n width: width,\n height: height,\n x: x,\n y: y\n }\n }, seriesModel, null, done, duringCb);\n }\n\n return clipPath;\n}\n\nfunction createPolarClipPath(polar, hasAnimation, seriesModel) {\n var sectorArea = polar.getArea(); // Avoid float number rounding error for symbol on the edge of axis extent.\n\n var r0 = round(sectorArea.r0, 1);\n var r = round(sectorArea.r, 1);\n var clipPath = new graphic.Sector({\n shape: {\n cx: round(polar.cx, 1),\n cy: round(polar.cy, 1),\n r0: r0,\n r: r,\n startAngle: sectorArea.startAngle,\n endAngle: sectorArea.endAngle,\n clockwise: sectorArea.clockwise\n }\n });\n\n if (hasAnimation) {\n var isRadial = polar.getBaseAxis().dim === 'angle';\n\n if (isRadial) {\n clipPath.shape.endAngle = sectorArea.startAngle;\n } else {\n clipPath.shape.r = r0;\n }\n\n graphic.initProps(clipPath, {\n shape: {\n endAngle: sectorArea.endAngle,\n r: r\n }\n }, seriesModel);\n }\n\n return clipPath;\n}\n\nfunction createClipPath(coordSys, hasAnimation, seriesModel, done, during) {\n if (!coordSys) {\n return null;\n } else if (coordSys.type === 'polar') {\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\n } else if (coordSys.type === 'cartesian2d') {\n return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during);\n }\n\n return null;\n}\n\nexport { createGridClipPath, createPolarClipPath, createClipPath };"]},"metadata":{},"sourceType":"module"} |