English
Abstract Class: D3PAttachable<D, M>
Defined in: core/object.ts:64
Object attachable to N charts, keeping one D record per chart. It detaches itself when a chart is destroyed and on its own destroy().
Extends
D3PObject<M>
Extended by
D3PCoordinateSystemD3PColorLegendD3PAxisD3PSeriesRendererD3PInteractionAreaD3PToolD3PCursorIndicatorD3PHtmlContainerD3PTitleD3PAxisTitleD3PLegendPanelD3PTooltipManagerD3PLegendManager
Type Parameters
D
D
M
M extends object = { }
Implements
Constructors
Constructor
ts
new D3PAttachable<D, M>(
label,
eventNames?,
bus?
): D3PAttachable<D, M>;Defined in: core/object.ts:35
Parameters
label
string
eventNames?
readonly (keyof M & string)[] = []
bus?
Returns
D3PAttachable<D, M>
Inherited from
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
attached()
ts
abstract protected attached(
chart,
data,
subs
): void;Defined in: core/object.ts:72
Subscribe / create DOM. Subscriptions added to subs are released on detach.
Parameters
chart
data
D
subs
Returns
void
createData()
ts
abstract protected createData(chart): D;Defined in: core/object.ts:70
Build the per-chart record. Must not rely on other objects of the chart.
Parameters
chart
Returns
D
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/object.ts:74
DOM / registry cleanup (subscriptions are released afterwards).
Parameters
_chart
_data
D
Returns
void
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
getCharts()
ts
getCharts(): D3PChart[];Defined in: core/object.ts:105
The charts the object is attached to.
Returns
D3PChart[]
hasChart()
ts
hasChart(chart): boolean;Defined in: core/object.ts:110
Whether the object is attached to this chart.
Parameters
chart
Returns
boolean
onDestroy()
ts
protected onDestroy(): void;Defined in: core/object.ts:114
Hook run first on destroy (detach from partners, release DOM...).
Returns
void
Overrides
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
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>
Implementation of
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
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, D>;Defined in: core/object.ts:66
What the object keeps for each chart it is attached to.
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.
Implementation of
Inherited from
subs
ts
protected readonly subs: D3PSubscriptions;Defined in: core/object.ts:33
The subscriptions of the object, released when it is destroyed.