1 line
7.7 KiB
JSON
1 line
7.7 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 vec2 from 'zrender/lib/core/vector.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper.js';\nexport function simpleLayout(seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n\n var graph = seriesModel.getGraph();\n graph.eachNode(function (node) {\n var model = node.getModel();\n node.setLayout([+model.get('x'), +model.get('y')]);\n });\n simpleLayoutEdge(graph, seriesModel);\n}\nexport function simpleLayoutEdge(graph, seriesModel) {\n graph.eachEdge(function (edge, index) {\n var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, seriesModel, index, true), 0);\n var p1 = vec2.clone(edge.node1.getLayout());\n var p2 = vec2.clone(edge.node2.getLayout());\n var points = [p1, p2];\n\n if (+curveness) {\n points.push([(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness]);\n }\n\n edge.setLayout(points);\n });\n}","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/ElectronicMallVue/node_modules/echarts/lib/chart/graph/simpleLayoutHelper.js"],"names":["vec2","zrUtil","getCurvenessForEdge","simpleLayout","seriesModel","coordSys","coordinateSystem","type","graph","getGraph","eachNode","node","model","getModel","setLayout","get","simpleLayoutEdge","eachEdge","edge","index","curveness","retrieve3","p1","clone","node1","getLayout","p2","node2","points","push"],"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,IAAZ,MAAsB,4BAAtB;AACA,OAAO,KAAKC,MAAZ,MAAwB,0BAAxB;AACA,SAASC,mBAAT,QAAoC,sCAApC;AACA,OAAO,SAASC,YAAT,CAAsBC,WAAtB,EAAmC;AACxC,MAAIC,QAAQ,GAAGD,WAAW,CAACE,gBAA3B;;AAEA,MAAID,QAAQ,IAAIA,QAAQ,CAACE,IAAT,KAAkB,MAAlC,EAA0C;AACxC;AACD;;AAED,MAAIC,KAAK,GAAGJ,WAAW,CAACK,QAAZ,EAAZ;AACAD,EAAAA,KAAK,CAACE,QAAN,CAAe,UAAUC,IAAV,EAAgB;AAC7B,QAAIC,KAAK,GAAGD,IAAI,CAACE,QAAL,EAAZ;AACAF,IAAAA,IAAI,CAACG,SAAL,CAAe,CAAC,CA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I,CAACJ,SAAL,CAAec,MAAf;AACD,GAXD;AAYD","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 vec2 from 'zrender/lib/core/vector.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper.js';\nexport function simpleLayout(seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n\n var graph = seriesModel.getGraph();\n graph.eachNode(function (node) {\n var model = node.getModel();\n node.setLayout([+model.get('x'), +model.get('y')]);\n });\n simpleLayoutEdge(graph, seriesModel);\n}\nexport function simpleLayoutEdge(graph, seriesModel) {\n graph.eachEdge(function (edge, index) {\n var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, seriesModel, index, true), 0);\n var p1 = vec2.clone(edge.node1.getLayout());\n var p2 = vec2.clone(edge.node2.getLayout());\n var points = [p1, p2];\n\n if (+curveness) {\n points.push([(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness]);\n }\n\n edge.setLayout(points);\n });\n}"]},"metadata":{},"sourceType":"module"} |