1 line
14 KiB
JSON
1 line
14 KiB
JSON
{"ast":null,"code":"import \"core-js/modules/es.regexp.exec.js\";\nimport \"core-js/modules/es.string.replace.js\";\nimport \"core-js/modules/es.error.cause.js\";\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*/\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 * as zrUtil from 'zrender/lib/core/util.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n/**\n * Can only be called after coordinate system creation stage.\n * (Can be called before coordinate system update stage).\n */\n\nexport function layout(gridModel, axisModel, opt) {\n opt = opt || {};\n var grid = gridModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\n var rawAxisPosition = axis.position;\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\n var axisDim = axis.dim;\n var rect = grid.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var idx = {\n left: 0,\n right: 1,\n top: 0,\n bottom: 1,\n onZero: 2\n };\n var axisOffset = axisModel.get('offset') || 0;\n var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\n\n if (otherAxisOnZeroOf) {\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\n } // Axis position\n\n\n layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]]; // Axis rotation\n\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); // Tick and label direction, x y is axisDim\n\n var dirMap = {\n top: -1,\n bottom: 1,\n left: -1,\n right: 1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\n\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (zrUtil.retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n } // Special label rotation\n\n\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; // Over splitLine and splitArea\n\n layout.z2 = 1;\n return layout;\n}\nexport function isCartesian2DSeries(seriesModel) {\n return seriesModel.get('coordinateSystem') === 'cartesian2d';\n}\nexport function findAxisModels(seriesModel) {\n var axisModelMap = {\n xAxisModel: null,\n yAxisModel: null\n };\n zrUtil.each(axisModelMap, function (v, key) {\n var axisType = key.replace(/Model$/, '');\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!axisModel) {\n throw new Error(axisType + ' \"' + zrUtil.retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '\" not found');\n }\n }\n\n axisModelMap[key] = axisModel;\n });\n return axisModelMap;\n}","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src啊/ElectronicMallVue/node_modules/echarts/lib/coord/cartesian/cartesianAxisHelper.js"],"names":["zrUtil","SINGLE_REFERRING","layout","gridModel","axisModel","opt","grid","coordinateSystem","axis","otherAxisOnZeroOf","getAxesOnZeroOf","rawAxisPosition","position","axisPosition","axisDim","dim","rect","getRect","rectBound","x","width","y","height","idx","left","right","top","bottom","onZero","axisOffset","get","posBound","onZeroCoord","toGlobalCoord","dataToCoord","Math","max","min","rotation","PI","dirMap","labelDirection","tickDirection","nameDirection","labelOffset","retrieve","labelInside","labelRotate","z2","isCartesian2DSeries","seriesModel","findAxisModels","axisModelMap","xAxisModel","yAxisModel","each","v","key","axisType","replace","getReferringComponents","models","process","env","NODE_ENV","Error","retrieve3"],"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,OAAO,KAAKA,MAAZ,MAAwB,0BAAxB;AACA,SAASC,gBAAT,QAAiC,qBAAjC;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASC,MAAT,CAAgBC,SAAhB,EAA2BC,SAA3B,EAAsCC,GAAtC,EAA2C;AAChDA,EAAAA,GAAG,GAAGA,GAAG,IAAI,EAAb;AACA,MAAIC,IAAI,GAAGH,SAAS,CAACI,gBAArB;AACA,MAAIC,IAAI,GAAGJ,SAAS,CAACI,IAAr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AAkB1D,MAAM,CAACkE,SAAP,CAAiBhB,WAAW,CAACpB,GAAZ,CAAgB4B,QAAQ,GAAG,OAA3B,CAAjB,EAAsDR,WAAW,CAACpB,GAAZ,CAAgB4B,QAAQ,GAAG,IAA3B,CAAtD,EAAwF,CAAxF,CAAlB,GAA+G,aAAzH,CAAN;AACD;AACF;;AAEDN,IAAAA,YAAY,CAACK,GAAD,CAAZ,GAAoBrD,SAApB;AACD,GAXD;AAYA,SAAOgD,YAAP;AACD","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 * as zrUtil from 'zrender/lib/core/util.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n/**\n * Can only be called after coordinate system creation stage.\n * (Can be called before coordinate system update stage).\n */\n\nexport function layout(gridModel, axisModel, opt) {\n opt = opt || {};\n var grid = gridModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\n var rawAxisPosition = axis.position;\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\n var axisDim = axis.dim;\n var rect = grid.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var idx = {\n left: 0,\n right: 1,\n top: 0,\n bottom: 1,\n onZero: 2\n };\n var axisOffset = axisModel.get('offset') || 0;\n var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\n\n if (otherAxisOnZeroOf) {\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\n } // Axis position\n\n\n layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]]; // Axis rotation\n\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); // Tick and label direction, x y is axisDim\n\n var dirMap = {\n top: -1,\n bottom: 1,\n left: -1,\n right: 1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\n\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (zrUtil.retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n } // Special label rotation\n\n\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; // Over splitLine and splitArea\n\n layout.z2 = 1;\n return layout;\n}\nexport function isCartesian2DSeries(seriesModel) {\n return seriesModel.get('coordinateSystem') === 'cartesian2d';\n}\nexport function findAxisModels(seriesModel) {\n var axisModelMap = {\n xAxisModel: null,\n yAxisModel: null\n };\n zrUtil.each(axisModelMap, function (v, key) {\n var axisType = key.replace(/Model$/, '');\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!axisModel) {\n throw new Error(axisType + ' \"' + zrUtil.retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '\" not found');\n }\n }\n\n axisModelMap[key] = axisModel;\n });\n return axisModelMap;\n}"]},"metadata":{},"sourceType":"module"} |