MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / resolvePieCenterPlotCss

Function resolvePieCenterPlotCss

src/core/createRenderCoordinator.ts:961–976  ·  view source on GitHub ↗
(
  center: PieCenter | undefined,
  plotWidthCss: number,
  plotHeightCss: number
)

Source from the content-addressed store, hash-verified

959};
960
961const 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
978const isPieRadiusTuple = (
979 radius: PieRadius

Callers 1

findPieSliceAtPointerFunction · 0.70

Calls 1

parseNumberOrPercentFunction · 0.70

Tested by

no test coverage detected