1 line
8.5 KiB
JSON
1 line
8.5 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 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\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}","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/chart/sankey/sankeyVisual.js"],"names":["zrUtil","VisualMapping","sankeyVisual","ecModel","eachSeriesByType","seriesModel","graph","getGraph","nodes","length","minValue_1","Infinity","maxValue_1","each","node","nodeValue","getLayout","value","mapping","type","mappingMethod","dataExtent","visual","get","mapValueToColor","mapValueToVisual","customColor","getModel","setVisual","fill"],"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;;AAEA,QAAIA,KAAK,CAACC,MAAV,EAAkB;AAChB,UAAIC,UAAU,GAAGC,QAAjB;AACA,UAA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AxB;AAGD;AACF,OArBD;AAsBD;AACF,GAzCD;AA0CD","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 zrUtil from 'zrender/lib/core/util.js';\r\nimport VisualMapping from '../../visual/VisualMapping.js';\r\nexport default function sankeyVisual(ecModel) {\r\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\r\n var graph = seriesModel.getGraph();\r\n var nodes = graph.nodes;\r\n\r\n if (nodes.length) {\r\n var minValue_1 = Infinity;\r\n var maxValue_1 = -Infinity;\r\n zrUtil.each(nodes, function (node) {\r\n var nodeValue = node.getLayout().value;\r\n\r\n if (nodeValue < minValue_1) {\r\n minValue_1 = nodeValue;\r\n }\r\n\r\n if (nodeValue > maxValue_1) {\r\n maxValue_1 = nodeValue;\r\n }\r\n });\r\n zrUtil.each(nodes, function (node) {\r\n var mapping = new VisualMapping({\r\n type: 'color',\r\n mappingMethod: 'linear',\r\n dataExtent: [minValue_1, maxValue_1],\r\n visual: seriesModel.get('color')\r\n });\r\n var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);\r\n var customColor = node.getModel().get(['itemStyle', 'color']);\r\n\r\n if (customColor != null) {\r\n node.setVisual('color', customColor);\r\n node.setVisual('style', {\r\n fill: customColor\r\n });\r\n } else {\r\n node.setVisual('color', mapValueToColor);\r\n node.setVisual('style', {\r\n fill: mapValueToColor\r\n });\r\n }\r\n });\r\n }\r\n });\r\n}"]},"metadata":{},"sourceType":"module"} |