English
Class: D3PLayout
Defined in: core/layout.ts:80
The room around the plot of one chart. The chart has margins of its own (the margin option, for the tick labels of the axes); bands reserved here come on top of them. The bands of one side stack by order (the lowest is the outermost), and by the time they were reserved when their orders are the same. The plot is what remains.
Extends
D3PObject<{changed:void; }>
Constructors
Constructor
ts
new D3PLayout(chart): D3PLayout;Defined in: core/layout.ts:84
Parameters
chart
Returns
D3PLayout
Overrides
Methods
destroy()
ts
destroy(): void;Defined in: core/object.ts:51
Detaches the object from all its charts, announces destroyed and releases its subscriptions. The object cannot be used afterwards.
Returns
void
Inherited from
fire()
ts
protected fire<P>(event, ...args): void;Defined in: core/object.ts:41
Emits one of its own events on the bus.
Type Parameters
P
P
Parameters
event
D3PEvent<P>
args
...P extends void ? [] : [payload: P]
Returns
void
Inherited from
inner()
ts
inner(side): number;Defined in: core/layout.ts:124
The margin of one side without the strips: what the chart was given, or what a requirement asks for.
Parameters
side
Returns
number
onDestroy()
ts
protected onDestroy(): void;Defined in: core/layout.ts:178
Hook run first on destroy (detach from partners, release DOM...).
Returns
void
Overrides
require()
ts
require(side, distance): D3PRequirement;Defined in: core/layout.ts:108
Ask for the plot to be at least distance pixels from the edge of the chart on side, the strips not counted. Requirements do not add up: the margin is the largest of them and of the margin of the chart. It is how a title that sits against its axis asks for the room the axis and the title need together, however wide the tick labels turn out to be.
Parameters
side
distance
number
Returns
reserve()
ts
reserve(
side,
size,
span?,
order?
): D3PBand;Defined in: core/layout.ts:94
Reserve a strip of size pixels along side. order ranks it among the strips of its side: the lowest is the outermost. The standard components use 0 for a title, 1 for a legend (the default) and 2 for the title of an axis, which is the closest to the plot.
Parameters
side
size
number
span?
D3PBandSpan = 'plot'
order?
number = 1
Returns
reserved()
ts
reserved(): D3PMargin;Defined in: core/layout.ts:139
Total of the strips reserved along each side.
Returns
Properties
bus
ts
readonly bus: D3PBus;Defined in: core/object.ts:27
The bus the object uses for its events.
Inherited from
chart
ts
readonly chart: D3PChart;Defined in: core/layout.ts:84
e
ts
readonly e: D3PEventTable<M & object>;Defined in: core/object.ts:29
The events of the object, by name: destroyed for all, and its own (axis.e.scaleChanged).
Inherited from
isDestroying
ts
isDestroying: boolean = false;Defined in: core/object.ts:31
Set when destroy starts: the object is not drawn after that.
Inherited from
subs
ts
protected readonly subs: D3PSubscriptions;Defined in: core/object.ts:33
The subscriptions of the object, released when it is destroyed.