MCPcopy Create free account
hub / github.com/ChartGPU/ChartGPU / computePlotSizeCssPx

Function computePlotSizeCssPx

src/renderers/createCandlestickRenderer.ts:69–78  ·  view source on GitHub ↗
(gridArea: GridArea)

Source from the content-addressed store, hash-verified

67};
68
69const computePlotSizeCssPx = (gridArea: GridArea): { readonly plotWidthCss: number; readonly plotHeightCss: number } | null => {
70 const dpr = gridArea.devicePixelRatio;
71 if (!(dpr > 0)) return null;
72 const canvasCssWidth = gridArea.canvasWidth / dpr;
73 const canvasCssHeight = gridArea.canvasHeight / dpr;
74 const plotWidthCss = canvasCssWidth - gridArea.left - gridArea.right;
75 const plotHeightCss = canvasCssHeight - gridArea.top - gridArea.bottom;
76 if (!(plotWidthCss > 0) || !(plotHeightCss > 0)) return null;
77 return { plotWidthCss, plotHeightCss };
78};
79
80const computePlotClipRect = (
81 gridArea: GridArea

Callers 1

prepareFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected