Skip to content

@putianyi888/vue3-plots


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

ParameterTypeDefault valueDescription
sizePlotSizeundefinedOuter SVG size.
paddingPlotPaddingdefaultPlotPaddingPlot insets. Defaults to defaultPlotPadding.

Returns

PlotArea

The drawable SVG area.

Example

ts
const area = getPlotArea(
  { width: 640, height: 360 },
  { top: 12, right: 16, bottom: 28, left: 40 },
)