1 line
11 KiB
JSON
1 line
11 KiB
JSON
{"ast":null,"code":"import \"core-js/modules/es.array.fill.js\";\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*/\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 { extend } from 'zrender/lib/core/util.js';\n\nfunction normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}\n\nexport default function graphEdgeVisual(ecModel) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var graph = seriesModel.getGraph();\n var edgeData = seriesModel.getEdgeData();\n var symbolType = normalize(seriesModel.get('edgeSymbol'));\n var symbolSize = normalize(seriesModel.get('edgeSymbolSize')); // const colorQuery = ['lineStyle', 'color'] as const;\n // const opacityQuery = ['lineStyle', 'opacity'] as const;\n\n edgeData.setVisual('fromSymbol', symbolType && symbolType[0]);\n edgeData.setVisual('toSymbol', symbolType && symbolType[1]);\n edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\n edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\n edgeData.setVisual('style', seriesModel.getModel('lineStyle').getLineStyle());\n edgeData.each(function (idx) {\n var itemModel = edgeData.getItemModel(idx);\n var edge = graph.getEdgeByIndex(idx);\n var symbolType = normalize(itemModel.getShallow('symbol', true));\n var symbolSize = normalize(itemModel.getShallow('symbolSize', true)); // Edge visual must after node visual\n\n var style = itemModel.getModel('lineStyle').getLineStyle();\n var existsStyle = edgeData.ensureUniqueItemVisual(idx, 'style');\n extend(existsStyle, style);\n\n switch (existsStyle.stroke) {\n case 'source':\n {\n var nodeStyle = edge.node1.getVisual('style');\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\n break;\n }\n\n case 'target':\n {\n var nodeStyle = edge.node2.getVisual('style');\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\n break;\n }\n }\n\n symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]);\n symbolType[1] && edge.setVisual('toSymbol', symbolType[1]);\n symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]);\n symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]);\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/edgeVisual.js"],"names":["extend","normalize","a","Array","graphEdgeVisual","ecModel","eachSeriesByType","seriesModel","graph","getGraph","edgeData","getEdgeData","symbolType","get","symbolSize","setVisual","getModel","getLineStyle","each","idx","itemModel","getItemModel","edge","getEdgeByIndex","getShallow","style","existsStyle","ensureUniqueItemVisual","stroke","nodeStyle","node1","getVisual","fill","node2"],"mappings":";;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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AAC,CAAD,CAAV,IAAiBU,IAAI,CAACP,SAAL,CAAe,UAAf,EAA2BH,UAAU,CAAC,CAAD,CAArC,CAAjB;AACAE,MAAAA,UAAU,CAAC,CAAD,CAAV,IAAiBQ,IAAI,CAACP,SAAL,CAAe,gBAAf,EAAiCD,UAAU,CAAC,CAAD,CAA3C,CAAjB;AACAA,MAAAA,UAAU,CAAC,CAAD,CAAV,IAAiBQ,IAAI,CAACP,SAAL,CAAe,cAAf,EAA+BD,UAAU,CAAC,CAAD,CAAzC,CAAjB;AACD,KA9BD;AA+BD,GA3CD;AA4CD","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 { extend } from 'zrender/lib/core/util.js';\r\n\r\nfunction normalize(a) {\r\n if (!(a instanceof Array)) {\r\n a = [a, a];\r\n }\r\n\r\n return a;\r\n}\r\n\r\nexport default function graphEdgeVisual(ecModel) {\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n var graph = seriesModel.getGraph();\r\n var edgeData = seriesModel.getEdgeData();\r\n var symbolType = normalize(seriesModel.get('edgeSymbol'));\r\n var symbolSize = normalize(seriesModel.get('edgeSymbolSize')); // const colorQuery = ['lineStyle', 'color'] as const;\r\n // const opacityQuery = ['lineStyle', 'opacity'] as const;\r\n\r\n edgeData.setVisual('fromSymbol', symbolType && symbolType[0]);\r\n edgeData.setVisual('toSymbol', symbolType && symbolType[1]);\r\n edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\r\n edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\r\n edgeData.setVisual('style', seriesModel.getModel('lineStyle').getLineStyle());\r\n edgeData.each(function (idx) {\r\n var itemModel = edgeData.getItemModel(idx);\r\n var edge = graph.getEdgeByIndex(idx);\r\n var symbolType = normalize(itemModel.getShallow('symbol', true));\r\n var symbolSize = normalize(itemModel.getShallow('symbolSize', true)); // Edge visual must after node visual\r\n\r\n var style = itemModel.getModel('lineStyle').getLineStyle();\r\n var existsStyle = edgeData.ensureUniqueItemVisual(idx, 'style');\r\n extend(existsStyle, style);\r\n\r\n switch (existsStyle.stroke) {\r\n case 'source':\r\n {\r\n var nodeStyle = edge.node1.getVisual('style');\r\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\r\n break;\r\n }\r\n\r\n case 'target':\r\n {\r\n var nodeStyle = edge.node2.getVisual('style');\r\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\r\n break;\r\n }\r\n }\r\n\r\n symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]);\r\n symbolType[1] && edge.setVisual('toSymbol', symbolType[1]);\r\n symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]);\r\n symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]);\r\n });\r\n });\r\n}"]},"metadata":{},"sourceType":"module"} |