1 line
8.1 KiB
JSON
1 line
8.1 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 { 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, api) {\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, undefined, api);\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/ElectronicMallVue/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","api","coordSys","coordinateSystem","res","undefined","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,EAA4BY,GAA5B,EAAiC;AAClCZ,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,UAAIQ,QAAQ,GAAGR,WAAW,CAACS,gBAA3B;AACA,UAAIC,GAAG,GAAGvB,mBAAmB,CAACqB,QAAD,EAAWd,OAAX,EAAoBiB,SAApB,EAA+BJ,GAA/B,CAA7B;AACAP,MAAAA,WAAW,CAACY,SAAZ,IAAyBZ,WAAW,CAACY,SAAZ,CAAsBF,GAAG,CAACG,MAA1B,CAAzB;AACAb,MAAAA,WAAW,CAACc,OAAZ,IAAuBd,WAAW,CAACc,OAAZ,CAAoBJ,GAAG,CAACK,IAAxB,CAAvB;AACD,KATD;AAUD,GAnBD;AAoBD","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 { 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, api) {\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, undefined, api);\n seriesModel.setCenter && seriesModel.setCenter(res.center);\n seriesModel.setZoom && seriesModel.setZoom(res.zoom);\n });\n });\n}"]},"metadata":{},"sourceType":"module"} |