1 line
7.3 KiB
JSON
1 line
7.3 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 { isNumber } from 'zrender/lib/core/util.js';\nexport default function categoryFilter(ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (!legendModels || !legendModels.length) {\n return;\n }\n\n ecModel.eachSeriesByType('graph', function (graphSeries) {\n var categoriesData = graphSeries.getCategoriesData();\n var graph = graphSeries.getGraph();\n var data = graph.data;\n var categoryNames = categoriesData.mapArray(categoriesData.getName);\n data.filterSelf(function (idx) {\n var model = data.getItemModel(idx);\n var category = model.getShallow('category');\n\n if (category != null) {\n if (isNumber(category)) {\n category = categoryNames[category];\n } // If in any legend component the status is not selected.\n\n\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(category)) {\n return false;\n }\n }\n }\n\n return true;\n });\n });\n}","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/chart/graph/categoryFilter.js"],"names":["isNumber","categoryFilter","ecModel","legendModels","findComponents","mainType","length","eachSeriesByType","graphSeries","categoriesData","getCategoriesData","graph","getGraph","data","categoryNames","mapArray","getName","filterSelf","idx","model","getItemModel","category","getShallow","i","isSelected"],"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,QAAT,QAAyB,0BAAzB;AACA,eAAe,SAASC,cAAT,CAAwBC,OAAxB,EAAiC;AAC9C,MAAIC,YAAY,GAAGD,OAAO,CAACE,cAAR,CAAuB;AACxCC,IAAAA,QAAQ,EAAE;AAD8B,GAAvB,CAAnB;;AAIA,MAAI,CAACF,YAAD,IAAiB,CAACA,YAAY,CAACG,MAAnC,EAA2C;AACzC;AACD;;AAEDJ,EAAAA,OAAO,CAACK,gBAAR,CAAyB,OAAzB,EAAkC,UAAUC,WAAV,EAAuB;AACvD,QAAIC,cAAc,GAAGD,WAAW,CAACE,iBAAZ,EAArB;AACA,QAAIC,KAAK,GAAGH,WAAW,CAACI,QAAZ,EAAZ;AACA,QAAIC,IAAI,GAAGF,KAAK,CAACE,IAAjB;AACA,QAAIC,aAAa,GAAGL,cAAc,CAACM,QAAf,CAAwBN,cAAc,CAACO,OAAvC,CAApB;AACAH,IAAAA,IAAI,CAACI,UAAL,CAAgB,UAAUC,GAAV,EAAe;AAC7B,UAAIC,KAAK,GAAGN,IAAI,CAACO,YAAL,CAAkBF,GAAlB,CAAZ;AACA,UAAIG,QAAQ,GAAGF,KAAK,CAACG,UAAN,CAAiB,UAAjB,CAAf;;AAEA,UAAID,QAAQ,IAAI,IAAhB,EAAsB;AACpB,YAAIrB,QAAQ,CAACqB,QAAD,CAAZ,EAAwB;AACtBA,UAAAA,QAAQ,GAAGP,aAAa,CAACO,QAAD,CAAxB;AACD,SAHmB,CAGlB;;;AAGF,aAAK,IAAIE,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGpB,YAAY,CAACG,MAAjC,EAAyCiB,CAAC,EAA1C,EAA8C;AAC5C,cAAI,CAACpB,YAAY,CAACoB,CAAD,CAAZ,CAAgBC,UAAhB,CAA2BH,QAA3B,CAAL,EAA2C;AACzC,mBAAO,KAAP;AACD;AACF;AACF;;AAED,aAAO,IAAP;AACD,KAlBD;AAmBD,GAxBD;AAyBD","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 { isNumber } from 'zrender/lib/core/util.js';\r\nexport default function categoryFilter(ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n\r\n if (!legendModels || !legendModels.length) {\r\n return;\r\n }\r\n\r\n ecModel.eachSeriesByType('graph', function (graphSeries) {\r\n var categoriesData = graphSeries.getCategoriesData();\r\n var graph = graphSeries.getGraph();\r\n var data = graph.data;\r\n var categoryNames = categoriesData.mapArray(categoriesData.getName);\r\n data.filterSelf(function (idx) {\r\n var model = data.getItemModel(idx);\r\n var category = model.getShallow('category');\r\n\r\n if (category != null) {\r\n if (isNumber(category)) {\r\n category = categoryNames[category];\r\n } // If in any legend component the status is not selected.\r\n\r\n\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(category)) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n });\r\n });\r\n}"]},"metadata":{},"sourceType":"module"} |