UNPKG

@antv/f2

Version:

Charts for mobile visualization.

79 lines (78 loc) 1.86 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _jsx = require("../../jsx"); var _default = function _default(props) { var nodes = props.nodes, coord = props.coord; if (coord.isPolar) { var center = coord.center; var x = center.x, y = center.y; return (0, _jsx.jsx)("group", null, nodes.map(function (node) { var xMin = node.xMin, xMax = node.xMax, yMin = node.yMin, yMax = node.yMax, color = node.color; return (0, _jsx.jsx)("sector", { attrs: { x: x, y: y, lineWidth: '1px', stroke: '#fff', startAngle: xMin, endAngle: xMax, r0: yMin, r: yMax, anticlockwise: false, fill: color } }); })); } return (0, _jsx.jsx)("group", null, nodes.map(function (node) { var key = node.key, xMin = node.xMin, xMax = node.xMax, yMin = node.yMin, yMax = node.yMax, color = node.color; return (0, _jsx.jsx)("rect", { key: key, attrs: { x: xMin, y: yMin, width: xMax - xMin, height: yMax - yMin, fill: color, lineWidth: '4px', stroke: '#fff', radius: '8px' }, animation: { appear: { easing: 'linear', duration: 450, property: ['fillOpacity', 'strokeOpacity'], start: { fillOpacity: 0, strokeOpacity: 0 }, end: { fillOpacity: 1, strokeOpacity: 1 } }, update: { easing: 'linear', duration: 450, property: ['x', 'y', 'width', 'height', 'radius', 'lineWidth'] } } }); })); }; exports.default = _default;