UNPKG

1.47 kBJavaScriptView Raw
1import { __assign } from "tslib";
2import { deepMix } from '@antv/util';
3import { jsx } from '@antv/f-engine';
4export default (function (props) {
5 var records = props.records,
6 animation = props.animation,
7 y0 = props.y0,
8 clip = props.clip,
9 onClick = props.onClick;
10 return jsx("group", {
11 attrs: {
12 clip: clip
13 }
14 }, records.map(function (record) {
15 var key = record.key,
16 children = record.children;
17 return jsx("group", {
18 key: key
19 }, children.map(function (item) {
20 var key = item.key,
21 xMin = item.xMin,
22 xMax = item.xMax,
23 yMin = item.yMin,
24 yMax = item.yMax,
25 color = item.color,
26 shape = item.shape;
27 if (isNaN(xMin) || isNaN(xMax) || isNaN(yMin) || isNaN(yMax)) {
28 return null;
29 }
30 return jsx("rect", {
31 key: key,
32 attrs: __assign({
33 x: xMin,
34 y: yMin,
35 width: xMax - xMin,
36 height: yMax - yMin,
37 fill: color
38 }, shape),
39 onClick: onClick,
40 animation: deepMix({
41 appear: {
42 easing: 'linear',
43 duration: 450,
44 property: ['y', 'height'],
45 start: {
46 y: y0,
47 height: 0
48 }
49 },
50 update: {
51 easing: 'linear',
52 duration: 450,
53 property: ['x', 'y', 'width', 'height']
54 }
55 }, animation)
56 });
57 }));
58 }));
59});
\No newline at end of file