@antv/f2
Version:
Charts for mobile visualization.
78 lines (77 loc) • 2.11 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _tslib = require("tslib");
var _fEngine = require("@antv/f-engine");
var _util = require("@antv/util");
var _default = exports.default = function _default(props) {
var coord = props.coord,
records = props.records,
animation = props.animation,
onClick = props.onClick;
var center = coord.center,
startAngle = coord.startAngle,
endAngle = coord.endAngle,
radius = coord.radius;
return (0, _fEngine.jsx)("group", {
animation: {
appear: (0, _tslib.__assign)({
easing: 'quadraticOut',
duration: 450,
clip: {
type: 'sector',
property: ['endAngle'],
style: {
cx: center.x,
cy: center.y,
startAngle: "".concat(startAngle, "rad"),
r: radius
},
start: {
endAngle: "".concat(startAngle, "rad")
},
end: {
endAngle: "".concat(endAngle, "rad")
}
}
}, animation && animation.appear)
}
}, records.map(function (record) {
var key = record.key,
children = record.children;
return (0, _fEngine.jsx)("group", {
key: key
}, children.map(function (item) {
var key = item.key,
xMin = item.xMin,
xMax = item.xMax,
yMin = item.yMin,
yMax = item.yMax,
color = item.color,
shape = item.shape;
return (0, _fEngine.jsx)("sector", {
key: key,
attrs: (0, _tslib.__assign)({
cx: center.x,
cy: center.y,
fill: color,
lineWidth: 1,
startAngle: "".concat(xMin, "rad"),
endAngle: "".concat(xMax, "rad"),
r0: yMin,
r: yMax
}, shape),
onClick: onClick,
animation: (0, _util.deepMix)({
update: {
easing: 'linear',
duration: 450,
property: ['x', 'y', 'startAngle', 'endAngle', 'r0', 'r']
}
}, animation)
});
}));
}));
};
;