( center: PieCenter | undefined, plotWidthCss: number, plotHeightCss: number )
| 959 | }; |
| 960 | |
| 961 | const resolvePieCenterPlotCss = ( |
| 962 | center: PieCenter | undefined, |
| 963 | plotWidthCss: number, |
| 964 | plotHeightCss: number |
| 965 | ): { readonly x: number; readonly y: number } => { |
| 966 | const xRaw = center?.[0] ?? '50%'; |
| 967 | const yRaw = center?.[1] ?? '50%'; |
| 968 | |
| 969 | const x = parseNumberOrPercent(xRaw, plotWidthCss); |
| 970 | const y = parseNumberOrPercent(yRaw, plotHeightCss); |
| 971 | |
| 972 | return { |
| 973 | x: Number.isFinite(x) ? x! : plotWidthCss * 0.5, |
| 974 | y: Number.isFinite(y) ? y! : plotHeightCss * 0.5, |
| 975 | }; |
| 976 | }; |
| 977 | |
| 978 | const isPieRadiusTuple = ( |
| 979 | radius: PieRadius |
no test coverage detected