| 67 | }; |
| 68 | |
| 69 | const 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 | |
| 80 | const computePlotClipRect = ( |
| 81 | gridArea: GridArea |