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
| Parameter | Type |
|---|---|
width | number |
height | number |
padding | ChartPadding |
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
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
| Parameter | Type |
|---|---|
side | ChartSide |
amount | number |
Returns
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
| Parameter | Type |
|---|---|
amount | number |
Returns
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
| Parameter | Type |
|---|---|
amount | number |
Returns
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
| Parameter | Type |
|---|---|
amount | number |
Returns
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
| Parameter | Type |
|---|---|
amount | number |