| 1 |
- {"ast":null,"code":"import \"core-js/modules/es.array.push.js\";\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 * AUTO-GENERATED FILE. DO NOT MODIFY.\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*/\n// FIXME Where to create the simple view coordinate system\nimport View from '../../coord/View.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport * as bbox from 'zrender/lib/core/bbox.js';\nimport { extend } from 'zrender/lib/core/util.js';\nfunction getViewRect(seriesModel, api, aspect) {\n var option = extend(seriesModel.getBoxLayoutParams(), {\n aspect: aspect\n });\n return getLayoutRect(option, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\nexport default function createViewCoordSys(ecModel, api) {\n var viewList = [];\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var coordSysType = seriesModel.get('coordinateSystem');\n if (!coordSysType || coordSysType === 'view') {\n var data_1 = seriesModel.getData();\n var positions = data_1.mapArray(function (idx) {\n var itemModel = data_1.getItemModel(idx);\n return [+itemModel.get('x'), +itemModel.get('y')];\n });\n var min = [];\n var max = [];\n bbox.fromPoints(positions, min, max);\n // If width or height is 0\n if (max[0] - min[0] === 0) {\n max[0] += 1;\n min[0] -= 1;\n }\n if (max[1] - min[1] === 0) {\n max[1] += 1;\n min[1] -= 1;\n }\n var aspect = (max[0] - min[0]) / (max[1] - min[1]);\n // FIXME If get view rect after data processed?\n var viewRect = getViewRect(seriesModel, api, aspect);\n // Position may be NaN, use view rect instead\n if (isNaN(aspect)) {\n min = [viewRect.x, viewRect.y];\n max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height];\n }\n var bbWidth = max[0] - min[0];\n var bbHeight = max[1] - min[1];\n var viewWidth = viewRect.width;\n var viewHeight = viewRect.height;\n var viewCoordSys = seriesModel.coordinateSystem = new View();\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\n viewCoordSys.setBoundingRect(min[0], min[1], bbWidth, bbHeight);\n viewCoordSys.setViewRect(viewRect.x, viewRect.y, viewWidth, viewHeight);\n // Update roam info\n viewCoordSys.setCenter(seriesModel.get('center'), api);\n viewCoordSys.setZoom(seriesModel.get('zoom'));\n viewList.push(viewCoordSys);\n }\n });\n return viewList;\n}","map":{"version":3,"names":["View","getLayoutRect","bbox","extend","getViewRect","seriesModel","api","aspect","option","getBoxLayoutParams","width","getWidth","height","getHeight","createViewCoordSys","ecModel","viewList","eachSeriesByType","coordSysType","get","data_1","getData","positions","mapArray","idx","itemModel","getItemModel","min","max","fromPoints","viewRect","isNaN","x","y","bbWidth","bbHeight","viewWidth","viewHeight","viewCoordSys","coordinateSystem","zoomLimit","setBoundingRect","setViewRect","setCenter","setZoom","push"],"sources":["E:/git/2021项目/安科院大屏/node_modules/echarts/lib/chart/graph/createView.js"],"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/*\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// FIXME Where to create the simple view coordinate system\nimport View from '../../coord/View.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport * as bbox from 'zrender/lib/core/bbox.js';\nimport { extend } from 'zrender/lib/core/util.js';\nfunction getViewRect(seriesModel, api, aspect) {\n var option = extend(seriesModel.getBoxLayoutParams(), {\n aspect: aspect\n });\n return getLayoutRect(option, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\nexport default function createViewCoordSys(ecModel, api) {\n var viewList = [];\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var coordSysType = seriesModel.get('coordinateSystem');\n if (!coordSysType || coordSysType === 'view') {\n var data_1 = seriesModel.getData();\n var positions = data_1.mapArray(function (idx) {\n var itemModel = data_1.getItemModel(idx);\n return [+itemModel.get('x'), +itemModel.get('y')];\n });\n var min = [];\n var max = [];\n bbox.fromPoints(positions, min, max);\n // If width or height is 0\n if (max[0] - min[0] === 0) {\n max[0] += 1;\n min[0] -= 1;\n }\n if (max[1] - min[1] === 0) {\n max[1] += 1;\n min[1] -= 1;\n }\n var aspect = (max[0] - min[0]) / (max[1] - min[1]);\n // FIXME If get view rect after data processed?\n var viewRect = getViewRect(seriesModel, api, aspect);\n // Position may be NaN, use view rect instead\n if (isNaN(aspect)) {\n min = [viewRect.x, viewRect.y];\n max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height];\n }\n var bbWidth = max[0] - min[0];\n var bbHeight = max[1] - min[1];\n var viewWidth = viewRect.width;\n var viewHeight = viewRect.height;\n var viewCoordSys = seriesModel.coordinateSystem = new View();\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\n viewCoordSys.setBoundingRect(min[0], min[1], bbWidth, bbHeight);\n viewCoordSys.setViewRect(viewRect.x, viewRect.y, viewWidth, viewHeight);\n // Update roam info\n viewCoordSys.setCenter(seriesModel.get('center'), api);\n viewCoordSys.setZoom(seriesModel.get('zoom'));\n viewList.push(viewCoordSys);\n }\n });\n return viewList;\n}"],"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;AACA,OAAOA,IAAI,MAAM,qBAAqB;AACtC,SAASC,aAAa,QAAQ,sBAAsB;AACpD,OAAO,KAAKC,IAAI,MAAM,0BAA0B;AAChD,SAASC,MAAM,QAAQ,0BAA0B;AACjD,SAASC,WAAWA,CAACC,WAAW,EAAEC,GAAG,EAAEC,MAAM,EAAE;EAC7C,IAAIC,MAAM,GAAGL,MAAM,CAACE,WAAW,CAACI,kBAAkB,CAAC,CAAC,EAAE;IACpDF,M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