Skip to content

Documentation / @ripl/charts / ChartLayout

Class: ChartLayout

Defined in: charts/src/core/layout.ts:43

Tracks the remaining free space within a chart and allows components to reserve bands from any edge. The order of reservation determines stacking: bands reserved first sit furthest from the plot area.

Constructors

Constructor

new ChartLayout(width, height, padding): ChartLayout

Defined in: charts/src/core/layout.ts:50

Parameters

ParameterType
widthnumber
heightnumber
paddingChartPadding

Returns

ChartLayout

Accessors

area

Get Signature

get area(): ChartArea

Defined in: charts/src/core/layout.ts:58

The remaining free area after all reservations so far.

Returns

ChartArea

Methods

reserve()

reserve(side, amount): ChartArea

Defined in: charts/src/core/layout.ts:118

Reserves a band from the given side. Horizontal sides consume width, vertical sides consume height.

Parameters

ParameterType
sideChartSide
amountnumber

Returns

ChartArea


reserveBottom()

reserveBottom(amount): ChartArea

Defined in: charts/src/core/layout.ts:81

Reserves a band of the given thickness from the bottom edge and returns it.

Parameters

ParameterType
amountnumber

Returns

ChartArea


reserveLeft()

reserveLeft(amount): ChartArea

Defined in: charts/src/core/layout.ts:93

Reserves a band of the given thickness from the left edge and returns it.

Parameters

ParameterType
amountnumber

Returns

ChartArea


reserveRight()

reserveRight(amount): ChartArea

Defined in: charts/src/core/layout.ts:106

Reserves a band of the given thickness from the right edge and returns it.

Parameters

ParameterType
amountnumber

Returns

ChartArea


reserveTop()

reserveTop(amount): ChartArea

Defined in: charts/src/core/layout.ts:68

Reserves a band of the given thickness from the top edge and returns it.

Parameters

ParameterType
amountnumber

Returns

ChartArea