@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
18 lines (16 loc) • 576 B
JavaScript
function getCurveProps({ size, thickness, sum, value, root, offset }) {
const radius = (size * 0.9 - thickness * 2) / 2;
const deg = Math.PI * radius * 2 / 100;
const strokeDasharray = root ? `${(100 - sum) * deg}, ${sum * deg}` : `${value * deg}, ${(100 - value) * deg}`;
return {
strokeWidth: thickness,
cx: size / 2,
cy: size / 2,
r: radius,
transform: root ? `scale(1, -1) translate(0, -${size})` : null,
strokeDasharray,
strokeDashoffset: root ? 0 : offset
};
}
export { getCurveProps };
//# sourceMappingURL=get-curve-props.js.map