@antv/f2
Version:
Charts for mobile visualization.
33 lines • 899 B
JavaScript
import { __assign } from "tslib";
import { jsx } from '@antv/f-engine';
import PolarX from './polar/polar-x';
import PolarY from './polar/polar-y';
import Top from './rect/top';
import Bottom from './rect/bottom';
import Right from './rect/right';
import Left from './rect/left';
function isPolar(props) {
return props.coord.isPolar;
}
export default (function (props) {
// 极坐标
if (isPolar(props)) {
var dimType = props.dimType;
if (dimType === 'x') {
return jsx(PolarX, __assign({}, props));
}
return jsx(PolarY, __assign({}, props));
}
var position = props.position;
// 直角坐标
if (position === 'right') {
return jsx(Right, __assign({}, props));
}
if (position === 'left') {
return jsx(Left, __assign({}, props));
}
if (position === 'top') {
return jsx(Top, __assign({}, props));
}
return jsx(Bottom, __assign({}, props));
});