qauMaWeb/node_modules/.cache/babel-loader/26695df15eacc8090db4948ec25...

1 line
16 KiB
JSON

{"ast":null,"code":"/*\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*/\n\n/**\r\n * AUTO-GENERATED FILE. DO NOT MODIFY.\r\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 * as vec2 from 'zrender/lib/core/vector.js';\nimport { getSymbolSize, getNodeGlobalScale } from './graphHelper.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper.js';\nvar PI = Math.PI;\nvar _symbolRadiansHalf = [];\n/**\r\n * `basedOn` can be:\r\n * 'value':\r\n * This layout is not accurate and have same bad case. For example,\r\n * if the min value is very smaller than the max value, the nodes\r\n * with the min value probably overlap even though there is enough\r\n * space to layout them. So we only use this approach in the as the\r\n * init layout of the force layout.\r\n * FIXME\r\n * Probably we do not need this method any more but use\r\n * `basedOn: 'symbolSize'` in force layout if\r\n * delay its init operations to GraphView.\r\n * 'symbolSize':\r\n * This approach work only if all of the symbol size calculated.\r\n * That is, the progressive rendering is not applied to graph.\r\n * FIXME\r\n * If progressive rendering is applied to graph some day,\r\n * probably we have to use `basedOn: 'value'`.\r\n */\n\nexport function circularLayout(seriesModel, basedOn) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n\n var rect = coordSys.getBoundingRect();\n var nodeData = seriesModel.getData();\n var graph = nodeData.graph;\n var cx = rect.width / 2 + rect.x;\n var cy = rect.height / 2 + rect.y;\n var r = Math.min(rect.width, rect.height) / 2;\n var count = nodeData.count();\n nodeData.setLayout({\n cx: cx,\n cy: cy\n });\n\n if (!count) {\n return;\n }\n\n _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count);\n\n graph.eachEdge(function (edge, index) {\n var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), getCurvenessForEdge(edge, seriesModel, index), 0);\n var p1 = vec2.clone(edge.node1.getLayout());\n var p2 = vec2.clone(edge.node2.getLayout());\n var cp1;\n var x12 = (p1[0] + p2[0]) / 2;\n var y12 = (p1[1] + p2[1]) / 2;\n\n if (+curveness) {\n curveness *= 3;\n cp1 = [cx * curveness + x12 * (1 - curveness), cy * curveness + y12 * (1 - curveness)];\n }\n\n edge.setLayout([p1, p2, cp1]);\n });\n}\nvar _layoutNodesBasedOn = {\n value: function value(seriesModel, graph, nodeData, r, cx, cy, count) {\n var angle = 0;\n var sum = nodeData.getSum('value');\n var unitAngle = Math.PI * 2 / (sum || count);\n graph.eachNode(function (node) {\n var value = node.getValue('value');\n var radianHalf = unitAngle * (sum ? value : 1) / 2;\n angle += radianHalf;\n node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);\n angle += radianHalf;\n });\n },\n symbolSize: function symbolSize(seriesModel, graph, nodeData, r, cx, cy, count) {\n var sumRadian = 0;\n _symbolRadiansHalf.length = count;\n var nodeScale = getNodeGlobalScale(seriesModel);\n graph.eachNode(function (node) {\n var symbolSize = getSymbolSize(node); // Normally this case will not happen, but we still add\n // some the defensive code (2px is an arbitrary value).\n\n isNaN(symbolSize) && (symbolSize = 2);\n symbolSize < 0 && (symbolSize = 0);\n symbolSize *= nodeScale;\n var symbolRadianHalf = Math.asin(symbolSize / 2 / r); // when `symbolSize / 2` is bigger than `r`.\n\n isNaN(symbolRadianHalf) && (symbolRadianHalf = PI / 2);\n _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf;\n sumRadian += symbolRadianHalf * 2;\n });\n var halfRemainRadian = (2 * PI - sumRadian) / count / 2;\n var angle = 0;\n graph.eachNode(function (node) {\n var radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex];\n angle += radianHalf;\n node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);\n angle += radianHalf;\n });\n }\n};","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/chart/graph/circularLayoutHelper.js"],"names":["vec2","getSymbolSize","getNodeGlobalScale","zrUtil","getCurvenessForEdge","PI","Math","_symbolRadiansHalf","circularLayout","seriesModel","basedOn","coordSys","coordinateSystem","type","rect","getBoundingRect","nodeData","getData","graph","cx","width","x","cy","height","y","r","min","count","setLayout","_layoutNodesBasedOn","eachEdge","edge","index","curveness","retrieve3","getModel","get","p1","clone","node1","getLayout","p2","node2","cp1","x12","y12","value","angle","sum","getSum","unitAngle","eachNode","node","getValue","radianHalf","cos","sin","symbolSize","sumRadian","length","nodeScale","isNaN","symbolRadianHalf","asin","dataIndex","halfRemainRadian"],"mappings":"AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AAC7B,UAAIK,UAAU,GAAGxD,aAAa,CAACmD,IAAD,CAA9B,CAD6B,CACS;AACtC;;AAEAS,MAAAA,KAAK,CAACJ,UAAD,CAAL,KAAsBA,UAAU,GAAG,CAAnC;AACAA,MAAAA,UAAU,GAAG,CAAb,KAAmBA,UAAU,GAAG,CAAhC;AACAA,MAAAA,UAAU,IAAIG,SAAd;AACA,UAAIE,gBAAgB,GAAGxD,IAAI,CAACyD,IAAL,CAAUN,UAAU,GAAG,CAAb,GAAiBhC,CAA3B,CAAvB,CAP6B,CAOyB;;AAEtDoC,MAAAA,KAAK,CAACC,gBAAD,CAAL,KAA4BA,gBAAgB,GAAGzD,EAAE,GAAG,CAApD;AACAE,MAAAA,kBAAkB,CAAC6C,IAAI,CAACY,SAAN,CAAlB,GAAqCF,gBAArC;AACAJ,MAAAA,SAAS,IAAII,gBAAgB,GAAG,CAAhC;AACD,KAZD;AAaA,QAAIG,gBAAgB,GAAG,CAAC,IAAI5D,EAAJ,GAASqD,SAAV,IAAuB/B,KAAvB,GAA+B,CAAtD;AACA,QAAIoB,KAAK,GAAG,CAAZ;AACA7B,IAAAA,KAAK,CAACiC,QAAN,CAAe,UAAUC,IAAV,EAAgB;AAC7B,UAAIE,UAAU,GAAGW,gBAAgB,GAAG1D,kBAAkB,CAAC6C,IAAI,CAACY,SAAN,CAAtD;AACAjB,MAAAA,KAAK,IAAIO,UAAT;AACAF,MAAAA,IAAI,CAACxB,SAAL,CAAe,CAACH,CAAC,GAAGnB,IAAI,CAACiD,GAAL,CAASR,KAAT,CAAJ,GAAsB5B,EAAvB,EAA2BM,CAAC,GAAGnB,IAAI,CAACkD,GAAL,CAAST,KAAT,CAAJ,GAAsBzB,EAAjD,CAAf;AACAyB,MAAAA,KAAK,IAAIO,UAAT;AACD,KALD;AAMD;AAtCuB,CAA1B","sourcesContent":["\r\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*/\r\n\r\n\r\n/**\r\n * AUTO-GENERATED FILE. DO NOT MODIFY.\r\n */\r\n\r\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*/\r\nimport * as vec2 from 'zrender/lib/core/vector.js';\r\nimport { getSymbolSize, getNodeGlobalScale } from './graphHelper.js';\r\nimport * as zrUtil from 'zrender/lib/core/util.js';\r\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper.js';\r\nvar PI = Math.PI;\r\nvar _symbolRadiansHalf = [];\r\n/**\r\n * `basedOn` can be:\r\n * 'value':\r\n * This layout is not accurate and have same bad case. For example,\r\n * if the min value is very smaller than the max value, the nodes\r\n * with the min value probably overlap even though there is enough\r\n * space to layout them. So we only use this approach in the as the\r\n * init layout of the force layout.\r\n * FIXME\r\n * Probably we do not need this method any more but use\r\n * `basedOn: 'symbolSize'` in force layout if\r\n * delay its init operations to GraphView.\r\n * 'symbolSize':\r\n * This approach work only if all of the symbol size calculated.\r\n * That is, the progressive rendering is not applied to graph.\r\n * FIXME\r\n * If progressive rendering is applied to graph some day,\r\n * probably we have to use `basedOn: 'value'`.\r\n */\r\n\r\nexport function circularLayout(seriesModel, basedOn) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n\r\n if (coordSys && coordSys.type !== 'view') {\r\n return;\r\n }\r\n\r\n var rect = coordSys.getBoundingRect();\r\n var nodeData = seriesModel.getData();\r\n var graph = nodeData.graph;\r\n var cx = rect.width / 2 + rect.x;\r\n var cy = rect.height / 2 + rect.y;\r\n var r = Math.min(rect.width, rect.height) / 2;\r\n var count = nodeData.count();\r\n nodeData.setLayout({\r\n cx: cx,\r\n cy: cy\r\n });\r\n\r\n if (!count) {\r\n return;\r\n }\r\n\r\n _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count);\r\n\r\n graph.eachEdge(function (edge, index) {\r\n var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), getCurvenessForEdge(edge, seriesModel, index), 0);\r\n var p1 = vec2.clone(edge.node1.getLayout());\r\n var p2 = vec2.clone(edge.node2.getLayout());\r\n var cp1;\r\n var x12 = (p1[0] + p2[0]) / 2;\r\n var y12 = (p1[1] + p2[1]) / 2;\r\n\r\n if (+curveness) {\r\n curveness *= 3;\r\n cp1 = [cx * curveness + x12 * (1 - curveness), cy * curveness + y12 * (1 - curveness)];\r\n }\r\n\r\n edge.setLayout([p1, p2, cp1]);\r\n });\r\n}\r\nvar _layoutNodesBasedOn = {\r\n value: function (seriesModel, graph, nodeData, r, cx, cy, count) {\r\n var angle = 0;\r\n var sum = nodeData.getSum('value');\r\n var unitAngle = Math.PI * 2 / (sum || count);\r\n graph.eachNode(function (node) {\r\n var value = node.getValue('value');\r\n var radianHalf = unitAngle * (sum ? value : 1) / 2;\r\n angle += radianHalf;\r\n node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);\r\n angle += radianHalf;\r\n });\r\n },\r\n symbolSize: function (seriesModel, graph, nodeData, r, cx, cy, count) {\r\n var sumRadian = 0;\r\n _symbolRadiansHalf.length = count;\r\n var nodeScale = getNodeGlobalScale(seriesModel);\r\n graph.eachNode(function (node) {\r\n var symbolSize = getSymbolSize(node); // Normally this case will not happen, but we still add\r\n // some the defensive code (2px is an arbitrary value).\r\n\r\n isNaN(symbolSize) && (symbolSize = 2);\r\n symbolSize < 0 && (symbolSize = 0);\r\n symbolSize *= nodeScale;\r\n var symbolRadianHalf = Math.asin(symbolSize / 2 / r); // when `symbolSize / 2` is bigger than `r`.\r\n\r\n isNaN(symbolRadianHalf) && (symbolRadianHalf = PI / 2);\r\n _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf;\r\n sumRadian += symbolRadianHalf * 2;\r\n });\r\n var halfRemainRadian = (2 * PI - sumRadian) / count / 2;\r\n var angle = 0;\r\n graph.eachNode(function (node) {\r\n var radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex];\r\n angle += radianHalf;\r\n node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);\r\n angle += radianHalf;\r\n });\r\n }\r\n};"]},"metadata":{},"sourceType":"module"}