English
Class: D3PSlot
Defined in: core/slot.ts:41
Room around the plot, and an element to put things in. It reserves a strip of the layout on one side of every chart it is attached to and gives each chart an HTML element placed on the strip: fill it with anything, or let a framework render into it (D3PVSlot, D3PRSlot).
It is what the standard titles and legend are made of; a component of your own is made the same way, with a slot for its place and whatever it needs to draw in it.
Extends
D3PHtmlContainer<undefined>
Accessors
size
Get Signature
ts
get size(): number;Defined in: core/slot.ts:65
The size of the strip, in pixels.
Returns
number
Set Signature
ts
set size(value): void;Defined in: core/slot.ts:69
Changes the size of the strip: the plot gives or takes the difference.
Parameters
value
number
Returns
void
Constructors
Constructor
ts
new D3PSlot(opts): D3PSlot;Defined in: core/slot.ts:54
Parameters
opts
Returns
D3PSlot
Overrides
Methods
addToChart()
ts
addToChart(chart): void;Defined in: core/object.ts:77
Attaches the object to a chart; nothing happens if it already is attached to it.
Parameters
chart
Returns
void
Inherited from
attached()
ts
protected attached(
chart,
data,
subs
): void;Defined in: core/slot.ts:89
Subscribe / create DOM. Subscriptions added to subs are released on detach.
Parameters
chart
data
D3PHtmlChartData<undefined>
subs
Returns
void
Overrides
createData()
ts
protected createData(chart): D3PHtmlChartData<undefined>;Defined in: core/slot.ts:82
Build the per-chart record. Must not rely on other objects of the chart.
Parameters
chart
Returns
D3PHtmlChartData<undefined>
Overrides
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
detached()
ts
protected detached(chart, data): void;Defined in: core/slot.ts:95
DOM / registry cleanup (subscriptions are released afterwards).
Parameters
chart
data
D3PHtmlChartData<undefined>
Returns
void
Overrides
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
forEachContainer()
ts
forEachContainer(cb): void;Defined in: core/html.ts:87
Calls cb for each chart, with its div and its data.
Parameters
cb
(e) => void
Returns
void
Inherited from
D3PHtmlContainer.forEachContainer
getCharts()
ts
getCharts(): D3PChart[];Defined in: core/object.ts:105
The charts the object is attached to.
Returns
D3PChart[]
Inherited from
getContainer()
ts
getContainer(chart): HTMLDivElement | undefined;Defined in: core/html.ts:72
The div on a chart, where a framework mounts its content.
Parameters
chart
Returns
HTMLDivElement | undefined
Inherited from
getContainers()
ts
getContainers(): object[];Defined in: core/html.ts:82
The div of each chart the container is attached to, with the chart and its data.
Returns
object[]
Inherited from
D3PHtmlContainer.getContainers
getData()
ts
getData(chart): undefined;Defined in: core/html.ts:77
What the container shows on a chart.
Parameters
chart
Returns
undefined
Inherited from
hasChart()
ts
hasChart(chart): boolean;Defined in: core/object.ts:110
Whether the object is attached to this chart.
Parameters
chart
Returns
boolean
Inherited from
onDestroy()
ts
protected onDestroy(): void;Defined in: core/object.ts:114
Hook run first on destroy (detach from partners, release DOM...).
Returns
void
Inherited from
removeFromChart()
ts
removeFromChart(chart): void;Defined in: core/object.ts:95
Detaches the object from a chart; nothing happens if it is not attached to it.
Parameters
chart
Returns
void
Inherited from
D3PHtmlContainer.removeFromChart
render()
ts
render(_chart): void | Promise<void>;Defined in: core/object.ts:129
Draws the object on a chart. The render manager calls it, once per frame, for the objects that asked for it.
Parameters
_chart
Returns
void | Promise<void>
Inherited from
setData()
ts
protected setData(chart, data): void;Defined in: core/html.ts:92
Sets what the container shows on a chart and draws it again.
Parameters
chart
data
undefined
Returns
void
Inherited from
styleDiv()
ts
protected styleDiv(div): void;Defined in: core/slot.ts:77
The div covers its strip and lets the pointer through; its content opts in with pointer-events: auto.
Parameters
div
Selection<HTMLDivElement, unknown, null, undefined>
Returns
void
Overrides
tagDirty()
ts
tagDirty(chart?): void;Defined in: core/object.ts:119
Schedule a redraw on one chart (or all attached charts).
Parameters
chart?
Returns
void
Inherited from
update()
ts
update(chart): void;Defined in: core/slot.ts:102
Put the element where it belongs again: after something it depends on, other than the size of the chart, changed.
Parameters
chart
Returns
void
Properties
bus
ts
readonly bus: D3PBus;Defined in: core/object.ts:27
The bus the object uses for its events.
Inherited from
chartData
ts
protected readonly chartData: Map<D3PChart, D3PHtmlChartData<undefined>>;Defined in: core/object.ts:66
What the object keeps for each chart it is attached to.
Inherited from
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
fullSvg
ts
protected readonly fullSvg: false = false;Defined in: core/slot.ts:42
true: the foreignObject covers the whole SVG (margins included); false: the inner area only.
Overrides
isDestroying
ts
isDestroying: boolean = false;Defined in: core/object.ts:31
Set when destroy starts: the object is not drawn after that.
Inherited from
order
ts
readonly order: number;Defined in: core/slot.ts:48
The rank of the strip among those of its side: the lower, the further from the plot.
side
ts
readonly side: D3PSide | "inside";Defined in: core/slot.ts:44
The side the slot is on, or inside for a slot that floats over the plot.
span
ts
readonly span: D3PBandSpan;Defined in: core/slot.ts:46
Along the whole chart, or along the plot.
subs
ts
protected readonly subs: D3PSubscriptions;Defined in: core/object.ts:33
The subscriptions of the object, released when it is destroyed.