1 line
9.4 KiB
JSON
1 line
9.4 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 * as zrUtil from 'zrender/lib/core/util.js';\nexport function layout(axisModel, opt) {\n opt = opt || {};\n var single = axisModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var axisPosition = axis.position;\n var orient = axis.orient;\n var rect = single.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var positionMap = {\n horizontal: {\n top: rectBound[2],\n bottom: rectBound[3]\n },\n vertical: {\n left: rectBound[0],\n right: rectBound[1]\n }\n };\n layout.position = [orient === 'vertical' ? positionMap.vertical[axisPosition] : rectBound[0], orient === 'horizontal' ? positionMap.horizontal[axisPosition] : rectBound[3]];\n var r = {\n horizontal: 0,\n vertical: 1\n };\n layout.rotation = Math.PI / 2 * r[orient];\n var directionMap = {\n top: -1,\n bottom: 1,\n right: 1,\n left: -1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = directionMap[axisPosition];\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 }\n\n var labelRotation = opt.rotate;\n labelRotation == null && (labelRotation = axisModel.get(['axisLabel', 'rotate']));\n layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;\n layout.z2 = 1;\n return layout;\n}","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/coord/single/singleAxisHelper.js"],"names":["zrUtil","layout","axisModel","opt","single","coordinateSystem","axis","axisPosition","position","orient","rect","getRect","rectBound","x","width","y","height","positionMap","horizontal","top","bottom","vertical","left","right","r","rotation","Math","PI","directionMap","labelDirection","tickDirection","nameDirection","get","retrieve","labelInside","labelRotation","rotate","z2"],"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,OAAO,SAASC,MAAT,CAAgBC,SAAhB,EAA2BC,GAA3B,EAAgC;AACrCA,EAAAA,GAAG,GAAGA,GAAG,IAAI,EAAb;AACA,MAAIC,MAAM,GAAGF,SAAS,CAACG,gBAAvB;AACA,MAAIC,IAAI,GAAGJ,SAAS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G,IAAAA,KAAK,EAAE,CAHU;AAIjBD,IAAAA,IAAI,EAAE,CAAC;AAJU,GAAnB;AAMArB,EAAAA,MAAM,CAAC4B,cAAP,GAAwB5B,MAAM,CAAC6B,aAAP,GAAuB7B,MAAM,CAAC8B,aAAP,GAAuBH,YAAY,CAACrB,YAAD,CAAlF;;AAEA,MAAIL,SAAS,CAAC8B,GAAV,CAAc,CAAC,UAAD,EAAa,QAAb,CAAd,CAAJ,EAA2C;AACzC/B,IAAAA,MAAM,CAAC6B,aAAP,GAAuB,CAAC7B,MAAM,CAAC6B,aAA/B;AACD;;AAED,MAAI9B,MAAM,CAACiC,QAAP,CAAgB9B,GAAG,CAAC+B,WAApB,EAAiChC,SAAS,CAAC8B,GAAV,CAAc,CAAC,WAAD,EAAc,QAAd,CAAd,CAAjC,CAAJ,EAA8E;AAC5E/B,IAAAA,MAAM,CAAC4B,cAAP,GAAwB,CAAC5B,MAAM,CAAC4B,cAAhC;AACD;;AAED,MAAIM,aAAa,GAAGhC,GAAG,CAACiC,MAAxB;AACAD,EAAAA,aAAa,IAAI,IAAjB,KAA0BA,aAAa,GAAGjC,SAAS,CAAC8B,GAAV,CAAc,CAAC,WAAD,EAAc,QAAd,CAAd,CAA1C;AACA/B,EAAAA,MAAM,CAACkC,aAAP,GAAuB5B,YAAY,KAAK,KAAjB,GAAyB,CAAC4B,aAA1B,GAA0CA,aAAjE;AACAlC,EAAAA,MAAM,CAACoC,EAAP,GAAY,CAAZ;AACA,SAAOpC,MAAP;AACD","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 * as zrUtil from 'zrender/lib/core/util.js';\r\nexport function layout(axisModel, opt) {\r\n opt = opt || {};\r\n var single = axisModel.coordinateSystem;\r\n var axis = axisModel.axis;\r\n var layout = {};\r\n var axisPosition = axis.position;\r\n var orient = axis.orient;\r\n var rect = single.getRect();\r\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\r\n var positionMap = {\r\n horizontal: {\r\n top: rectBound[2],\r\n bottom: rectBound[3]\r\n },\r\n vertical: {\r\n left: rectBound[0],\r\n right: rectBound[1]\r\n }\r\n };\r\n layout.position = [orient === 'vertical' ? positionMap.vertical[axisPosition] : rectBound[0], orient === 'horizontal' ? positionMap.horizontal[axisPosition] : rectBound[3]];\r\n var r = {\r\n horizontal: 0,\r\n vertical: 1\r\n };\r\n layout.rotation = Math.PI / 2 * r[orient];\r\n var directionMap = {\r\n top: -1,\r\n bottom: 1,\r\n right: 1,\r\n left: -1\r\n };\r\n layout.labelDirection = layout.tickDirection = layout.nameDirection = directionMap[axisPosition];\r\n\r\n if (axisModel.get(['axisTick', 'inside'])) {\r\n layout.tickDirection = -layout.tickDirection;\r\n }\r\n\r\n if (zrUtil.retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\r\n layout.labelDirection = -layout.labelDirection;\r\n }\r\n\r\n var labelRotation = opt.rotate;\r\n labelRotation == null && (labelRotation = axisModel.get(['axisLabel', 'rotate']));\r\n layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;\r\n layout.z2 = 1;\r\n return layout;\r\n}"]},"metadata":{},"sourceType":"module"} |