@antv/f2
Version:
Charts for mobile visualization.
65 lines (64 loc) • 1.66 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _tslib = require("tslib");
var _util = require("@antv/util");
var _fEngine = require("@antv/f-engine");
var _default = exports.default = function _default(props) {
var records = props.records,
animation = props.animation,
y0 = props.y0,
clip = props.clip,
onClick = props.onClick;
return (0, _fEngine.jsx)("group", {
attrs: {
clip: clip
}
}, 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;
if (isNaN(xMin) || isNaN(xMax) || isNaN(yMin) || isNaN(yMax)) {
return null;
}
return (0, _fEngine.jsx)("rect", {
key: key,
attrs: (0, _tslib.__assign)({
x: xMin,
y: yMin,
width: xMax - xMin,
height: yMax - yMin,
fill: color
}, shape),
onClick: onClick,
animation: (0, _util.deepMix)({
appear: {
easing: 'linear',
duration: 450,
property: ['y', 'height'],
start: {
y: y0,
height: 0
}
},
update: {
easing: 'linear',
duration: 450,
property: ['x', 'y', 'width', 'height']
}
}, animation)
});
}));
}));
};
;