getPlotArea(
size,padding?):PlotArea
Defined in: utils.ts:98
Returns the drawable plot area after subtracting padding from the outer size.
Width and height are clamped to 0 when padding is larger than the outer size.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
size | PlotSize | undefined | Outer SVG size. |
padding | PlotPadding | defaultPlotPadding | Plot insets. Defaults to defaultPlotPadding. |
Returns
The drawable SVG area.
Example
ts
const area = getPlotArea(
{ width: 640, height: 360 },
{ top: 12, right: 16, bottom: 28, left: 40 },
)