1 line
9.0 KiB
JSON
1 line
9.0 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 zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nexport default function sankeyVisual(ecModel) {\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\n var graph = seriesModel.getGraph();\n var nodes = graph.nodes;\n var edges = graph.edges;\n\n if (nodes.length) {\n var minValue_1 = Infinity;\n var maxValue_1 = -Infinity;\n zrUtil.each(nodes, function (node) {\n var nodeValue = node.getLayout().value;\n\n if (nodeValue < minValue_1) {\n minValue_1 = nodeValue;\n }\n\n if (nodeValue > maxValue_1) {\n maxValue_1 = nodeValue;\n }\n });\n zrUtil.each(nodes, function (node) {\n var mapping = new VisualMapping({\n type: 'color',\n mappingMethod: 'linear',\n dataExtent: [minValue_1, maxValue_1],\n visual: seriesModel.get('color')\n });\n var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);\n var customColor = node.getModel().get(['itemStyle', 'color']);\n\n if (customColor != null) {\n node.setVisual('color', customColor);\n node.setVisual('style', {\n fill: customColor\n });\n } else {\n node.setVisual('color', mapValueToColor);\n node.setVisual('style', {\n fill: mapValueToColor\n });\n }\n });\n }\n\n if (edges.length) {\n zrUtil.each(edges, function (edge) {\n var edgeStyle = edge.getModel().get('lineStyle');\n edge.setVisual('style', edgeStyle);\n });\n }\n });\n}","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src啊/ElectronicMallVue/node_modules/echarts/lib/chart/sankey/sankeyVisual.js"],"names":["zrUtil","VisualMapping","sankeyVisual","ecModel","eachSeriesByType","seriesModel","graph","getGraph","nodes","edges","length","minValue_1","Infinity","maxValue_1","each","node","nodeValue","getLayout","value","mapping","type","mappingMethod","dataExtent","visual","get","mapValueToColor","mapValueToVisual","customColor","getModel","setVisual","fill","edge","edgeStyle"],"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,MAAZ,MAAwB,0BAAxB;AACA,OAAOC,aAAP,MAA0B,+BAA1B;AACA,eAAe,SAASC,YAAT,CAAsBC,OAAtB,EAA+B;AAC5CA,EAAAA,OAAO,CAACC,gBAAR,CAAyB,QAAzB,EAAmC,UAAUC,WAAV,EAAuB;AACxD,QAAIC,KAAK,GAAGD,WAAW,CAACE,QAAZ,EAAZ;AACA,QAAIC,KAAK,GAAGF,KAAK,CAACE,KAAlB;AACA,QAAIC,KAAK,GAAGH,KAAK,CAACG,KAAlB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V,UAAAA,IAAI,CAACc,SAAL,CAAe,OAAf,EAAwB;AACtBC,YAAAA,IAAI,EAAEL;AADgB,WAAxB;AAGD;AACF,OArBD;AAsBD;;AAED,QAAIhB,KAAK,CAACC,MAAV,EAAkB;AAChBV,MAAAA,MAAM,CAACc,IAAP,CAAYL,KAAZ,EAAmB,UAAUsB,IAAV,EAAgB;AACjC,YAAIC,SAAS,GAAGD,IAAI,CAACH,QAAL,GAAgBJ,GAAhB,CAAoB,WAApB,CAAhB;AACAO,QAAAA,IAAI,CAACF,SAAL,CAAe,OAAf,EAAwBG,SAAxB;AACD,OAHD;AAID;AACF,GAjDD;AAkDD","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 VisualMapping from '../../visual/VisualMapping.js';\nexport default function sankeyVisual(ecModel) {\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\n var graph = seriesModel.getGraph();\n var nodes = graph.nodes;\n var edges = graph.edges;\n\n if (nodes.length) {\n var minValue_1 = Infinity;\n var maxValue_1 = -Infinity;\n zrUtil.each(nodes, function (node) {\n var nodeValue = node.getLayout().value;\n\n if (nodeValue < minValue_1) {\n minValue_1 = nodeValue;\n }\n\n if (nodeValue > maxValue_1) {\n maxValue_1 = nodeValue;\n }\n });\n zrUtil.each(nodes, function (node) {\n var mapping = new VisualMapping({\n type: 'color',\n mappingMethod: 'linear',\n dataExtent: [minValue_1, maxValue_1],\n visual: seriesModel.get('color')\n });\n var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);\n var customColor = node.getModel().get(['itemStyle', 'color']);\n\n if (customColor != null) {\n node.setVisual('color', customColor);\n node.setVisual('style', {\n fill: customColor\n });\n } else {\n node.setVisual('color', mapValueToColor);\n node.setVisual('style', {\n fill: mapValueToColor\n });\n }\n });\n }\n\n if (edges.length) {\n zrUtil.each(edges, function (edge) {\n var edgeStyle = edge.getModel().get('lineStyle');\n edge.setVisual('style', edgeStyle);\n });\n }\n });\n}"]},"metadata":{},"sourceType":"module"} |