UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

16 lines (14 loc) 555 B
function getCurves({ size, thickness, sections }) { const sum = sections.reduce((acc, current) => acc + current.value, 0); const accumulated = Math.PI * ((size * 0.9 - thickness * 2) / 2) * 2; let offset = accumulated; const curves = []; for (let i = 0; i < sections.length; i += 1) { curves.push({ sum, offset, data: sections[i], root: false }); offset -= sections[i].value / 100 * accumulated; } curves.push({ sum, offset, data: null, root: true }); return curves; } export { getCurves }; //# sourceMappingURL=get-curves.js.map