1 line
20 KiB
JSON
1 line
20 KiB
JSON
{"ast":null,"code":"import \"core-js/modules/es.function.name.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 { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport Tree from '../../data/Tree.js';\nimport Model from '../../model/Model.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\n\nvar TreeSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(TreeSeriesModel, _super);\n\n function TreeSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.hasSymbolVisual = true; // Do it self.\n\n _this.ignoreStyleOnData = true;\n return _this;\n }\n /**\r\n * Init a tree data structure from data in option series\r\n */\n\n\n TreeSeriesModel.prototype.getInitialData = function (option) {\n //create an virtual root\n var root = {\n name: option.name,\n children: option.data\n };\n var leaves = option.leaves || {};\n var leavesModel = new Model(leaves, this, this.ecModel);\n var tree = Tree.createTree(root, this, beforeLink);\n\n function beforeLink(nodeData) {\n nodeData.wrapMethod('getItemModel', function (model, idx) {\n var node = tree.getNodeByDataIndex(idx);\n\n if (!(node && node.children.length && node.isExpand)) {\n model.parentModel = leavesModel;\n }\n\n return model;\n });\n }\n\n var treeDepth = 0;\n tree.eachNode('preorder', function (node) {\n if (node.depth > treeDepth) {\n treeDepth = node.depth;\n }\n });\n var expandAndCollapse = option.expandAndCollapse;\n var expandTreeDepth = expandAndCollapse && option.initialTreeDepth >= 0 ? option.initialTreeDepth : treeDepth;\n tree.root.eachNode('preorder', function (node) {\n var item = node.hostTree.data.getRawDataItem(node.dataIndex); // Add item.collapsed != null, because users can collapse node original in the series.data.\n\n node.isExpand = item && item.collapsed != null ? !item.collapsed : node.depth <= expandTreeDepth;\n });\n return tree.data;\n };\n /**\r\n * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'.\r\n * @returns {string} orient\r\n */\n\n\n TreeSeriesModel.prototype.getOrient = function () {\n var orient = this.get('orient');\n\n if (orient === 'horizontal') {\n orient = 'LR';\n } else if (orient === 'vertical') {\n orient = 'TB';\n }\n\n return orient;\n };\n\n TreeSeriesModel.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n\n TreeSeriesModel.prototype.setCenter = function (center) {\n this.option.center = center;\n };\n\n TreeSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var tree = this.getData().tree;\n var realRoot = tree.root.children[0];\n var node = tree.getNodeByDataIndex(dataIndex);\n var value = node.getValue();\n var name = node.name;\n\n while (node && node !== realRoot) {\n name = node.parentNode.name + '.' + name;\n node = node.parentNode;\n }\n\n return createTooltipMarkup('nameValue', {\n name: name,\n value: value,\n noValue: isNaN(value) || value == null\n });\n }; // Add tree path to tooltip param\n\n\n TreeSeriesModel.prototype.getDataParams = function (dataIndex) {\n var params = _super.prototype.getDataParams.apply(this, arguments);\n\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\n params.treeAncestors = wrapTreePathInfo(node, this);\n params.collapsed = !node.isExpand;\n return params;\n };\n\n TreeSeriesModel.type = 'series.tree'; // can support the position parameters 'left', 'top','right','bottom', 'width',\n // 'height' in the setOption() with 'merge' mode normal.\n\n TreeSeriesModel.layoutMode = 'box';\n TreeSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'view',\n // the position of the whole view\n left: '12%',\n top: '12%',\n right: '12%',\n bottom: '12%',\n // the layout of the tree, two value can be selected, 'orthogonal' or 'radial'\n layout: 'orthogonal',\n // value can be 'polyline'\n edgeShape: 'curve',\n edgeForkPosition: '50%',\n // true | false | 'move' | 'scale', see module:component/helper/RoamController.\n roam: false,\n // Symbol size scale ratio in roam\n nodeScaleRatio: 0.4,\n // Default on center of graph\n center: null,\n zoom: 1,\n orient: 'LR',\n symbol: 'emptyCircle',\n symbolSize: 7,\n expandAndCollapse: true,\n initialTreeDepth: 2,\n lineStyle: {\n color: '#ccc',\n width: 1.5,\n curveness: 0.5\n },\n itemStyle: {\n color: 'lightsteelblue',\n // borderColor: '#c23531',\n borderWidth: 1.5\n },\n label: {\n show: true\n },\n animationEasing: 'linear',\n animationDuration: 700,\n animationDurationUpdate: 500\n };\n return TreeSeriesModel;\n}(SeriesModel);\n\nexport default TreeSeriesModel;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/chart/tree/TreeSeries.js"],"names":["__extends","SeriesModel","Tree","Model","createTooltipMarkup","wrapTreePathInfo","TreeSeriesModel","_super","_this","apply","arguments","hasSymbolVisual","ignoreStyleOnData","prototype","getInitialData","option","root","name","children","data","leaves","leavesModel","ecModel","tree","createTree","beforeLink","nodeData","wrapMethod","model","idx","node","getNodeByDataIndex","length","isExpand","parentModel","treeDepth","eachNode","depth","expandAndCollapse","expandTreeDepth","initialTreeDepth","item","hostTree","getRawDataItem","dataIndex","collapsed","getOrient","orient","get","setZoom","zoom","setCenter","center","formatTooltip","multipleSeries","dataType","getData","realRoot","value","getValue","parentNode","noValue","isNaN","getDataParams","params","treeAncestors","type","layoutMode","defaultOption","z","coordinateSystem","left","top","right","bottom","layout","edgeShape","edgeForkPosition","roam","nodeScaleRatio","symbol","symbolSize","lineStyle","color","width","curveness","itemStyle","borderWidth","label","show","animationEasing","animationDuration","animationDurationUpdate"],"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,SAASA,SAAT,QAA0B,OAA1B;AACA,OAAOC,WAAP,MAAwB,uBAAxB;AACA,OAAOC,IAAP,MAAiB,oBAAjB;AACA,OAAOC,KAAP,MAAkB,sBAAlB;AACA,SAASC,mBAAT,QAAoC,0CAApC;AACA,SAASC,gBAAT,QAAiC,yBAAjC;;AAEA,IAAIC,eAAe;AACnB;AACA,UAAUC,MAAV,EAAkB;AAChBP,EAAAA,SAAS,CAACM,eAAD,EAAkBC,MAAlB,CAAT;;AAEA,WAASD,eAAT,GAA2B;AACzB,QAAIE,KAAK,GAAGD,MAAM,KAAK,IAAX,IAAmBA,MAAM,CAACE,KAAP,CAAa,IAAb,EAAmBC,SAAnB,CAAnB,IAAoD,IAAhE;;AAEAF,IAAAA,KAAK,CAACG,eAAN,GAAwB,IAAxB,CAHyB,CAGK;;AAE9BH,IAAAA,KAAK,CAACI,iBAAN,GAA0B,IAA1B;AACA,WAAOJ,K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AAhC;AA2CA,SAAOtF,eAAP;AACD,CA5JD,CA4JEL,WA5JF,CAFA;;AAgKA,eAAeK,eAAf","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 { __extends } from \"tslib\";\r\nimport SeriesModel from '../../model/Series.js';\r\nimport Tree from '../../data/Tree.js';\r\nimport Model from '../../model/Model.js';\r\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\r\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\r\n\r\nvar TreeSeriesModel =\r\n/** @class */\r\nfunction (_super) {\r\n __extends(TreeSeriesModel, _super);\r\n\r\n function TreeSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n\r\n _this.hasSymbolVisual = true; // Do it self.\r\n\r\n _this.ignoreStyleOnData = true;\r\n return _this;\r\n }\r\n /**\r\n * Init a tree data structure from data in option series\r\n */\r\n\r\n\r\n TreeSeriesModel.prototype.getInitialData = function (option) {\r\n //create an virtual root\r\n var root = {\r\n name: option.name,\r\n children: option.data\r\n };\r\n var leaves = option.leaves || {};\r\n var leavesModel = new Model(leaves, this, this.ecModel);\r\n var tree = Tree.createTree(root, this, beforeLink);\r\n\r\n function beforeLink(nodeData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n var node = tree.getNodeByDataIndex(idx);\r\n\r\n if (!(node && node.children.length && node.isExpand)) {\r\n model.parentModel = leavesModel;\r\n }\r\n\r\n return model;\r\n });\r\n }\r\n\r\n var treeDepth = 0;\r\n tree.eachNode('preorder', function (node) {\r\n if (node.depth > treeDepth) {\r\n treeDepth = node.depth;\r\n }\r\n });\r\n var expandAndCollapse = option.expandAndCollapse;\r\n var expandTreeDepth = expandAndCollapse && option.initialTreeDepth >= 0 ? option.initialTreeDepth : treeDepth;\r\n tree.root.eachNode('preorder', function (node) {\r\n var item = node.hostTree.data.getRawDataItem(node.dataIndex); // Add item.collapsed != null, because users can collapse node original in the series.data.\r\n\r\n node.isExpand = item && item.collapsed != null ? !item.collapsed : node.depth <= expandTreeDepth;\r\n });\r\n return tree.data;\r\n };\r\n /**\r\n * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'.\r\n * @returns {string} orient\r\n */\r\n\r\n\r\n TreeSeriesModel.prototype.getOrient = function () {\r\n var orient = this.get('orient');\r\n\r\n if (orient === 'horizontal') {\r\n orient = 'LR';\r\n } else if (orient === 'vertical') {\r\n orient = 'TB';\r\n }\r\n\r\n return orient;\r\n };\r\n\r\n TreeSeriesModel.prototype.setZoom = function (zoom) {\r\n this.option.zoom = zoom;\r\n };\r\n\r\n TreeSeriesModel.prototype.setCenter = function (center) {\r\n this.option.center = center;\r\n };\r\n\r\n TreeSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var tree = this.getData().tree;\r\n var realRoot = tree.root.children[0];\r\n var node = tree.getNodeByDataIndex(dataIndex);\r\n var value = node.getValue();\r\n var name = node.name;\r\n\r\n while (node && node !== realRoot) {\r\n name = node.parentNode.name + '.' + name;\r\n node = node.parentNode;\r\n }\r\n\r\n return createTooltipMarkup('nameValue', {\r\n name: name,\r\n value: value,\r\n noValue: isNaN(value) || value == null\r\n });\r\n }; // Add tree path to tooltip param\r\n\r\n\r\n TreeSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var params = _super.prototype.getDataParams.apply(this, arguments);\r\n\r\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\r\n params.treeAncestors = wrapTreePathInfo(node, this);\r\n params.collapsed = !node.isExpand;\r\n return params;\r\n };\r\n\r\n TreeSeriesModel.type = 'series.tree'; // can support the position parameters 'left', 'top','right','bottom', 'width',\r\n // 'height' in the setOption() with 'merge' mode normal.\r\n\r\n TreeSeriesModel.layoutMode = 'box';\r\n TreeSeriesModel.defaultOption = {\r\n // zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'view',\r\n // the position of the whole view\r\n left: '12%',\r\n top: '12%',\r\n right: '12%',\r\n bottom: '12%',\r\n // the layout of the tree, two value can be selected, 'orthogonal' or 'radial'\r\n layout: 'orthogonal',\r\n // value can be 'polyline'\r\n edgeShape: 'curve',\r\n edgeForkPosition: '50%',\r\n // true | false | 'move' | 'scale', see module:component/helper/RoamController.\r\n roam: false,\r\n // Symbol size scale ratio in roam\r\n nodeScaleRatio: 0.4,\r\n // Default on center of graph\r\n center: null,\r\n zoom: 1,\r\n orient: 'LR',\r\n symbol: 'emptyCircle',\r\n symbolSize: 7,\r\n expandAndCollapse: true,\r\n initialTreeDepth: 2,\r\n lineStyle: {\r\n color: '#ccc',\r\n width: 1.5,\r\n curveness: 0.5\r\n },\r\n itemStyle: {\r\n color: 'lightsteelblue',\r\n // borderColor: '#c23531',\r\n borderWidth: 1.5\r\n },\r\n label: {\r\n show: true\r\n },\r\n animationEasing: 'linear',\r\n animationDuration: 700,\r\n animationDurationUpdate: 500\r\n };\r\n return TreeSeriesModel;\r\n}(SeriesModel);\r\n\r\nexport default TreeSeriesModel;"]},"metadata":{},"sourceType":"module"} |