1 line
8.3 KiB
JSON
1 line
8.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 { updateCenterAndZoom } from '../../action/roamHelper.js';\nexport function installTreeAction(registers) {\n registers.registerAction({\n type: 'treeExpandAndCollapse',\n event: 'treeExpandAndCollapse',\n update: 'update'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'tree',\n query: payload\n }, function (seriesModel) {\n var dataIndex = payload.dataIndex;\n var tree = seriesModel.getData().tree;\n var node = tree.getNodeByDataIndex(dataIndex);\n node.isExpand = !node.isExpand;\n });\n });\n registers.registerAction({\n type: 'treeRoam',\n event: 'treeRoam',\n // Here we set 'none' instead of 'update', because roam action\n // just need to update the transform matrix without having to recalculate\n // the layout. So don't need to go through the whole update process, such\n // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on.\n update: 'none'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'tree',\n query: payload\n }, function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var res = updateCenterAndZoom(coordSys, payload);\n seriesModel.setCenter && seriesModel.setCenter(res.center);\n seriesModel.setZoom && seriesModel.setZoom(res.zoom);\n });\n });\n}","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/chart/tree/treeAction.js"],"names":["updateCenterAndZoom","installTreeAction","registers","registerAction","type","event","update","payload","ecModel","eachComponent","mainType","subType","query","seriesModel","dataIndex","tree","getData","node","getNodeByDataIndex","isExpand","coordSys","coordinateSystem","res","setCenter","center","setZoom","zoom"],"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,mBAAT,QAAoC,4BAApC;AACA,OAAO,SAASC,iBAAT,CAA2BC,SAA3B,EAAsC;AAC3CA,EAAAA,SAAS,CAACC,cAAV,CAAyB;AACvBC,IAAAA,IAAI,EAAE,uBADiB;AAEvBC,IAAAA,KAAK,EAAE,uBAFgB;AAGvBC,IAAAA,MAAM,EAAE;AAHe,GAAzB,EAIG,UAAUC,OAAV,EAAmBC,OAAnB,EAA4B;AAC7BA,IAAAA,OAAO,CAACC,aAAR,CAAsB;AACpBC,MAAAA,QAAQ,EAAE,QADU;AAEpBC,MAAAA,OAAO,EAAE,MAFW;AAGpBC,MAAAA,KAAK,EAAEL;AAHa,KAAtB,EAIG,UAAUM,WAAV,EAAuB;AACxB,UAAIC,SAAS,GAAGP,OAAO,CAACO,SAAxB;AACA,UAAIC,IAAI,GAAGF,WAAW,CAACG,OAAZ,GAAsBD,IAAjC;AACA,UAAIE,IAAI,GAAGF,IAAI,CAACG,kBAAL,CAAwBJ,SAAxB,CAAX;AACAG,MAAAA,IAAI,CAACE,QAAL,GAAgB,CAACF,IAAI,CAACE,QAAtB;AACD,KATD;AAUD,GAfD;AAgBAjB,EAAAA,SAAS,CAACC,cAAV,CAAyB;AACvBC,IAAAA,IAAI,EAAE,UADiB;AAEvBC,IAAAA,KAAK,EAAE,UAFgB;AAGvB;AACA;AACA;AACA;AACAC,IAAAA,MAAM,EAAE;AAPe,GAAzB,EAQG,UAAUC,OAAV,EAAmBC,OAAnB,EAA4B;AAC7BA,IAAAA,OAAO,CAACC,aAAR,CAAsB;AACpBC,MAAAA,QAAQ,EAAE,QADU;AAEpBC,MAAAA,OAAO,EAAE,MAFW;AAGpBC,MAAAA,KAAK,EAAEL;AAHa,KAAtB,EAIG,UAAUM,WAAV,EAAuB;AACxB,UAAIO,QAAQ,GAAGP,WAAW,CAACQ,gBAA3B;AACA,UAAIC,GAAG,GAAGtB,mBAAmB,CAACoB,QAAD,EAAWb,OAAX,CAA7B;AACAM,MAAAA,WAAW,CAACU,SAAZ,IAAyBV,WAAW,CAACU,SAAZ,CAAsBD,GAAG,CAACE,MAA1B,CAAzB;AACAX,MAAAA,WAAW,CAACY,OAAZ,IAAuBZ,WAAW,CAACY,OAAZ,CAAoBH,GAAG,CAACI,IAAxB,CAAvB;AACD,KATD;AAUD,GAnBD;AAoBD","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 { updateCenterAndZoom } from '../../action/roamHelper.js';\r\nexport function installTreeAction(registers) {\r\n registers.registerAction({\r\n type: 'treeExpandAndCollapse',\r\n event: 'treeExpandAndCollapse',\r\n update: 'update'\r\n }, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series',\r\n subType: 'tree',\r\n query: payload\r\n }, function (seriesModel) {\r\n var dataIndex = payload.dataIndex;\r\n var tree = seriesModel.getData().tree;\r\n var node = tree.getNodeByDataIndex(dataIndex);\r\n node.isExpand = !node.isExpand;\r\n });\r\n });\r\n registers.registerAction({\r\n type: 'treeRoam',\r\n event: 'treeRoam',\r\n // Here we set 'none' instead of 'update', because roam action\r\n // just need to update the transform matrix without having to recalculate\r\n // the layout. So don't need to go through the whole update process, such\r\n // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on.\r\n update: 'none'\r\n }, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series',\r\n subType: 'tree',\r\n query: payload\r\n }, function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var res = updateCenterAndZoom(coordSys, payload);\r\n seriesModel.setCenter && seriesModel.setCenter(res.center);\r\n seriesModel.setZoom && seriesModel.setZoom(res.zoom);\r\n });\r\n });\r\n}"]},"metadata":{},"sourceType":"module"} |