UNPKG

960 BJavaScriptView Raw
1import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2import { jsx } from '../../jsx';
3import PolarX from './polar/polar-x';
4import PolarY from './polar/polar-y';
5import Top from './rect/top';
6import Bottom from './rect/bottom';
7import Right from './rect/right';
8import Left from './rect/left';
9function isPolar(props) {
10 return props.coord.isPolar;
11}
12export default (function (props) {
13 // 极坐标
14 if (isPolar(props)) {
15 var dimType = props.dimType;
16 if (dimType === 'x') {
17 return jsx(PolarX, _objectSpread({}, props));
18 }
19 return jsx(PolarY, _objectSpread({}, props));
20 }
21 var position = props.position;
22 // 直角坐标
23 if (position === 'right') {
24 return jsx(Right, _objectSpread({}, props));
25 }
26 if (position === 'left') {
27 return jsx(Left, _objectSpread({}, props));
28 }
29 if (position === 'top') {
30 return jsx(Top, _objectSpread({}, props));
31 }
32 return jsx(Bottom, _objectSpread({}, props));
33});
\No newline at end of file