UNPKG

@antv/f2

Version:

Charts for mobile visualization.

57 lines 1.45 kB
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2"; import { deepMix } from '@antv/util'; import { jsx } from '../../../jsx'; export default (function (props) { var records = props.records, animation = props.animation, y0 = props.y0, clip = props.clip; return jsx("group", { attrs: { clip: clip } }, records.map(function (record) { var key = record.key, children = record.children; return 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 jsx("rect", { key: key, attrs: _objectSpread({ x: xMin, y: yMin, width: xMax - xMin, height: yMax - yMin, fill: color }, shape), animation: 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) }); })); })); });