@actinc/dls
Version:
Design Language System (DLS) for ACT & Encoura front-end projects.
13 lines • 900 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
var InnerPieComponent = function (_a) {
var HighlightComponent = _a.HighlightComponent, payload = _a.payload, pieTotalValue = _a.pieTotalValue, wrongTypeViewBox = _a.viewBox;
if (!wrongTypeViewBox) {
return null;
}
// viewBox is plugged in automatically by recharts, but the typing is all wrong, so I have to recast it again
var viewBox = wrongTypeViewBox;
var verticeLength = Math.sqrt(2) * viewBox.innerRadius - 3;
return (_jsx("g", { children: _jsx("foreignObject", { height: verticeLength, textAnchor: "middle", width: verticeLength, x: viewBox.cx - verticeLength / 2, y: viewBox.cy - verticeLength / 2, children: _jsx(HighlightComponent, { availableViewBoxDimension: verticeLength, payload: payload, pieTotalValue: pieTotalValue }) }) }));
};
export default InnerPieComponent;
//# sourceMappingURL=index.js.map