1 line
8.1 KiB
JSON
1 line
8.1 KiB
JSON
{"ast":null,"code":"import \"core-js/modules/es.function.name.js\";\nimport \"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 { lift } from 'zrender/lib/tool/color.js';\nimport { extend, isString } from 'zrender/lib/core/util.js';\nexport default function sunburstVisual(ecModel) {\n var paletteScope = {}; // Default color strategy\n\n function pickColor(node, seriesModel, treeHeight) {\n // Choose color from palette based on the first level.\n var current = node;\n\n while (current && current.depth > 1) {\n current = current.parentNode;\n }\n\n var color = seriesModel.getColorFromPalette(current.name || current.dataIndex + '', paletteScope);\n\n if (node.depth > 1 && isString(color)) {\n // Lighter on the deeper level.\n color = lift(color, (node.depth - 1) / (treeHeight - 1) * 0.5);\n }\n\n return color;\n }\n\n ecModel.eachSeriesByType('sunburst', function (seriesModel) {\n var data = seriesModel.getData();\n var tree = data.tree;\n tree.eachNode(function (node) {\n var model = node.getModel();\n var style = model.getModel('itemStyle').getItemStyle();\n\n if (!style.fill) {\n style.fill = pickColor(node, seriesModel, tree.root.height);\n }\n\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\n extend(existsStyle, style);\n });\n });\n}","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/chart/sunburst/sunburstVisual.js"],"names":["lift","extend","isString","sunburstVisual","ecModel","paletteScope","pickColor","node","seriesModel","treeHeight","current","depth","parentNode","color","getColorFromPalette","name","dataIndex","eachSeriesByType","data","getData","tree","eachNode","model","getModel","style","getItemStyle","fill","root","height","existsStyle","ensureUniqueItemVisual"],"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,IAAT,QAAqB,2BAArB;AACA,SAASC,MAAT,EAAiBC,QAAjB,QAAiC,0BAAjC;AACA,eAAe,SAASC,cAAT,CAAwBC,OAAxB,EAAiC;AAC9C,MAAIC,YAAY,GAAG,EAAnB,CAD8C,CACvB;;AAEvB,WAASC,SAAT,CAAmBC,IAAnB,EAAyBC,WAAzB,EAAsCC,UAAtC,EAAkD;AAChD;AACA,QAAIC,OAAO,GAAGH,IAAd;;AAEA,WAAOG,OAAO,IAAIA,OAAO,CAACC,KAAR,GAAgB,CAAlC,EAAqC;AACnCD,MAAAA,OAAO,GAAGA,OAAO,CAACE,UAAlB;AACD;;AAED,QAAIC,KAAK,GAAGL,WAAW,CAACM,mBAAZ,CAAgCJ,OAAO,CAACK,IAAR,IAAgBL,OAAO,CAACM,SAAR,GAAoB,EAApE,EAAwEX,YAAxE,CAAZ;;AAEA,QAAIE,IAAI,CAACI,KAAL,GAAa,CAAb,IAAkBT,QAAQ,CAACW,KAAD,CAA9B,EAAuC;AACrC;AACAA,MAAAA,KAAK,GAAGb,IAAI,CAACa,KAAD,EAAQ,CAACN,IAAI,CAACI,KAAL,GAAa,CAAd,KAAoBF,UAAU,GAAG,CAAjC,IAAsC,GAA9C,CAAZ;AACD;;AAED,WAAOI,KAAP;AACD;;AAEDT,EAAAA,OAAO,CAACa,gBAAR,CAAyB,UAAzB,EAAqC,UAAUT,WAAV,EAAuB;AAC1D,QAAIU,IAAI,GAAGV,WAAW,CAACW,OAAZ,EAAX;AACA,QAAIC,IAAI,GAAGF,IAAI,CAACE,IAAhB;AACAA,IAAAA,IAAI,CAACC,QAAL,CAAc,UAAUd,IAAV,EAAgB;AAC5B,UAAIe,KAAK,GAAGf,IAAI,CAACgB,QAAL,EAAZ;AACA,UAAIC,KAAK,GAAGF,KAAK,CAACC,QAAN,CAAe,WAAf,EAA4BE,YAA5B,EAAZ;;AAEA,UAAI,CAACD,KAAK,CAACE,IAAX,EAAiB;AACfF,QAAAA,KAAK,CAACE,IAAN,GAAapB,SAAS,CAACC,IAAD,EAAOC,WAAP,EAAoBY,IAAI,CAACO,IAAL,CAAUC,MAA9B,CAAtB;AACD;;AAED,UAAIC,WAAW,GAAGX,IAAI,CAACY,sBAAL,CAA4BvB,IAAI,CAACS,SAAjC,EAA4C,OAA5C,CAAlB;AACAf,MAAAA,MAAM,CAAC4B,WAAD,EAAcL,KAAd,CAAN;AACD,KAVD;AAWD,GAdD;AAeD","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 { lift } from 'zrender/lib/tool/color.js';\r\nimport { extend, isString } from 'zrender/lib/core/util.js';\r\nexport default function sunburstVisual(ecModel) {\r\n var paletteScope = {}; // Default color strategy\r\n\r\n function pickColor(node, seriesModel, treeHeight) {\r\n // Choose color from palette based on the first level.\r\n var current = node;\r\n\r\n while (current && current.depth > 1) {\r\n current = current.parentNode;\r\n }\r\n\r\n var color = seriesModel.getColorFromPalette(current.name || current.dataIndex + '', paletteScope);\r\n\r\n if (node.depth > 1 && isString(color)) {\r\n // Lighter on the deeper level.\r\n color = lift(color, (node.depth - 1) / (treeHeight - 1) * 0.5);\r\n }\r\n\r\n return color;\r\n }\r\n\r\n ecModel.eachSeriesByType('sunburst', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var tree = data.tree;\r\n tree.eachNode(function (node) {\r\n var model = node.getModel();\r\n var style = model.getModel('itemStyle').getItemStyle();\r\n\r\n if (!style.fill) {\r\n style.fill = pickColor(node, seriesModel, tree.root.height);\r\n }\r\n\r\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\r\n extend(existsStyle, style);\r\n });\r\n });\r\n}"]},"metadata":{},"sourceType":"module"} |