UNPKG

833 BJavaScriptView Raw
1import { jsx } from '@antv/f-engine';
2export default (function (props) {
3 var node = props.node,
4 onClick = props.onClick;
5 var children = node.children;
6 var renderNodes = function renderNodes(nodes) {
7 return jsx("group", null, nodes.map(function (node) {
8 var xMin = node.xMin,
9 xMax = node.xMax,
10 yMin = node.yMin,
11 yMax = node.yMax,
12 color = node.color,
13 children = node.children;
14 return jsx("group", {
15 onClick: onClick
16 }, jsx("rect", {
17 attrs: {
18 x: xMin,
19 y: yMin,
20 width: xMax - xMin,
21 height: yMax - yMin,
22 lineWidth: '1px',
23 stroke: '#fff',
24 fill: color
25 }
26 }), children && children.length ? renderNodes(children) : null);
27 }));
28 };
29 return renderNodes(children);
30});
\No newline at end of file