Skip to content

Class: D3PAnchor ​

Defined in: core/html.ts:101

Generic anchor: place any framework-rendered HTML content inside a chart.

Extends ​

Constructors ​

Constructor ​

ts
new D3PAnchor(opts?): D3PAnchor;

Defined in: core/html.ts:104

Parameters ​

opts? ​

D3PHtmlContainerOptions = {}

Returns ​

D3PAnchor

Overrides ​

D3PHtmlContainer.constructor

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 ​

D3PChart

Returns ​

void

Inherited from ​

D3PHtmlContainer.addToChart


attached() ​

ts
protected attached(
   chart, 
   data, 
   subs
): void;

Defined in: core/html.ts:60

Subscribe / create DOM. Subscriptions added to subs are released on detach.

Parameters ​

chart ​

D3PChart

data ​

D3PHtmlChartData<undefined>

subs ​

D3PSubscriptions

Returns ​

void

Inherited from ​

D3PHtmlContainer.attached


createData() ​

ts
protected createData(chart): D3PHtmlChartData<undefined>;

Defined in: core/html.ts:45

Build the per-chart record. Must not rely on other objects of the chart.

Parameters ​

chart ​

D3PChart

Returns ​

D3PHtmlChartData<undefined>

Inherited from ​

D3PHtmlContainer.createData


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 ​

D3PHtmlContainer.destroy


detached() ​

ts
protected detached(_chart, data): void;

Defined in: core/html.ts:66

DOM / registry cleanup (subscriptions are released afterwards).

Parameters ​

_chart ​

D3PChart

data ​

D3PHtmlChartData<undefined>

Returns ​

void

Inherited from ​

D3PHtmlContainer.detached


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 ​

D3PHtmlContainer.fire


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 ​

D3PHtmlContainer.getCharts


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 ​

D3PChart

Returns ​

HTMLDivElement | undefined

Inherited from ​

D3PHtmlContainer.getContainer


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 ​

D3PChart

Returns ​

undefined

Inherited from ​

D3PHtmlContainer.getData


hasChart() ​

ts
hasChart(chart): boolean;

Defined in: core/object.ts:110

Whether the object is attached to this chart.

Parameters ​

chart ​

D3PChart

Returns ​

boolean

Inherited from ​

D3PHtmlContainer.hasChart


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 ​

D3PHtmlContainer.onDestroy


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 ​

D3PChart

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 ​

D3PChart

Returns ​

void | Promise<void>

Inherited from ​

D3PHtmlContainer.render


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 ​

D3PChart

data ​

undefined

Returns ​

void

Inherited from ​

D3PHtmlContainer.setData


styleDiv() ​

ts
protected styleDiv(div): void;

Defined in: core/html.ts:111

The div covers the plot and lets the pointer through; its content opts in with pointer-events: auto.

Parameters ​

div ​

Selection<HTMLDivElement, unknown, null, undefined>

Returns ​

void

Overrides ​

D3PHtmlContainer.styleDiv


tagDirty() ​

ts
tagDirty(chart?): void;

Defined in: core/object.ts:119

Schedule a redraw on one chart (or all attached charts).

Parameters ​

chart? ​

D3PChart

Returns ​

void

Inherited from ​

D3PHtmlContainer.tagDirty

Properties ​

bus ​

ts
readonly bus: D3PBus;

Defined in: core/object.ts:27

The bus the object uses for its events.

Inherited from ​

D3PHtmlContainer.bus


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 ​

D3PHtmlContainer.chartData


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 ​

D3PHtmlContainer.e


fullSvg ​

ts
protected readonly fullSvg: true = true;

Defined in: core/html.ts:102

true: the foreignObject covers the whole SVG (margins included); false: the inner area only.

Overrides ​

D3PHtmlContainer.fullSvg


isDestroying ​

ts
isDestroying: boolean = false;

Defined in: core/object.ts:31

Set when destroy starts: the object is not drawn after that.

Inherited from ​

D3PHtmlContainer.isDestroying


subs ​

ts
protected readonly subs: D3PSubscriptions;

Defined in: core/object.ts:33

The subscriptions of the object, released when it is destroyed.

Inherited from ​

D3PHtmlContainer.subs