( center: PieCenter | undefined, plotWidthCss: number, plotHeightCss: number )
| 80 | }; |
| 81 | |
| 82 | const resolveCenterPlotCss = ( |
| 83 | center: PieCenter | undefined, |
| 84 | plotWidthCss: number, |
| 85 | plotHeightCss: number |
| 86 | ): { readonly x: number; readonly y: number } => { |
| 87 | const xRaw = center?.[0] ?? '50%'; |
| 88 | const yRaw = center?.[1] ?? '50%'; |
| 89 | |
| 90 | const x = parseNumberOrPercent(xRaw, plotWidthCss); |
| 91 | const y = parseNumberOrPercent(yRaw, plotHeightCss); |
| 92 | |
| 93 | return { |
| 94 | x: Number.isFinite(x) ? x! : plotWidthCss * 0.5, |
| 95 | y: Number.isFinite(y) ? y! : plotHeightCss * 0.5, |
| 96 | }; |
| 97 | }; |
| 98 | |
| 99 | const isRadiusTuple = ( |
| 100 | radius: PieRadius |
no test coverage detected