@antv/f2
Version:
Charts for mobile visualization.
36 lines (35 loc) • 1.01 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _fEngine = require("@antv/f-engine");
var _default = exports.default = function _default(props) {
var node = props.node,
onClick = props.onClick;
var children = node.children;
var _renderNodes = function renderNodes(nodes) {
return (0, _fEngine.jsx)("group", null, nodes.map(function (node) {
var xMin = node.xMin,
xMax = node.xMax,
yMin = node.yMin,
yMax = node.yMax,
color = node.color,
children = node.children;
return (0, _fEngine.jsx)("group", {
onClick: onClick
}, (0, _fEngine.jsx)("rect", {
attrs: {
x: xMin,
y: yMin,
width: xMax - xMin,
height: yMax - yMin,
lineWidth: '1px',
stroke: '#fff',
fill: color
}
}), children && children.length ? _renderNodes(children) : null);
}));
};
return _renderNodes(children);
};
;