Skip to content

Class: D3PAnnotationPoint ​

Defined in: core/annotation.ts:272

A marker at a point of the axes, with an optional label beside it.

Extends ​

  • D3PAnnotation

Constructors ​

Constructor ​

ts
new D3PAnnotationPoint(opts): D3PAnnotationPoint;

Defined in: core/annotation.ts:285

Parameters ​

opts ​

D3PAnnotationPointOptions

Returns ​

D3PAnnotationPoint

Overrides ​

D3PAnnotation.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 ​

D3PAnnotation.addToChart


attached() ​

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

Defined in: core/annotation.ts:71

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

Parameters ​

chart ​

D3PChart

data ​

AnnotationData

subs ​

D3PSubscriptions

Returns ​

void

Inherited from ​

D3PAnnotation.attached


axisOf() ​

ts
protected axisOf(chart, ref): D3PAxis | undefined;

Defined in: core/annotation.ts:94

The axis of a reference: the axis object, or the axis of that name on the chart.

Parameters ​

chart ​

D3PChart

ref ​

D3PAxisRef

Returns ​

D3PAxis | undefined

Inherited from ​

D3PAnnotation.axisOf


createData() ​

ts
protected createData(chart): AnnotationData;

Defined in: core/annotation.ts:66

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

Parameters ​

chart ​

D3PChart

Returns ​

AnnotationData

Inherited from ​

D3PAnnotation.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 ​

D3PAnnotation.destroy


detached() ​

ts
protected detached(_chart, data): void;

Defined in: core/annotation.ts:87

DOM / registry cleanup (subscriptions are released afterwards).

Parameters ​

_chart ​

D3PChart

data ​

AnnotationData

Returns ​

void

Inherited from ​

D3PAnnotation.detached


draw() ​

ts
protected draw(
   chart, 
   group, 
   labels
): void;

Defined in: core/annotation.ts:299

Draw the marks in shapes (clipped to the plot) and their labels in labels.

Parameters ​

chart ​

D3PChart

group ​

Selection<SVGGElement, unknown, null, undefined>

labels ​

Selection<SVGGElement, unknown, null, undefined>

Returns ​

void

Overrides ​

D3PAnnotation.draw


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 ​

D3PAnnotation.fire


getCharts() ​

ts
getCharts(): D3PChart[];

Defined in: core/object.ts:105

The charts the object is attached to.

Returns ​

D3PChart[]

Inherited from ​

D3PAnnotation.getCharts


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 ​

D3PAnnotation.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 ​

D3PAnnotation.onDestroy


position() ​

ts
protected position(
   chart, 
   axis, 
   value
): number | undefined;

Defined in: core/annotation.ts:100

Position of value along axis, in range units.

Parameters ​

chart ​

D3PChart

axis ​

D3PAxis

value ​

D3PDomainValue

Returns ​

number | undefined

Inherited from ​

D3PAnnotation.position


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 ​

D3PAnnotation.removeFromChart


render() ​

ts
render(chart): void;

Defined in: core/annotation.ts:119

Draws the marks, clipped to the plot, and their labels.

Parameters ​

chart ​

D3PChart

Returns ​

void

Inherited from ​

D3PAnnotation.render


systemOf() ​

ts
protected systemOf(chart): D3PCoordinateSystem<any> | undefined;

Defined in: core/annotation.ts:294

The coordinate system the marks are drawn in, to clip them to its shape.

Parameters ​

chart ​

D3PChart

Returns ​

D3PCoordinateSystem<any> | undefined

Overrides ​

D3PAnnotation.systemOf


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 ​

D3PAnnotation.tagDirty


text() ​

ts
protected text(
   group, 
   text, 
   x, 
   y, 
   anchor?
): void;

Defined in: core/annotation.ts:114

Writes a label.

Parameters ​

group ​

Selection<SVGGElement, unknown, null, undefined>

text ​

string

x ​

number

y ​

number

anchor? ​

"middle" | "start" | "end" = 'start'

Returns ​

void

Inherited from ​

D3PAnnotation.text


within() ​

ts
protected within(
   chart, 
   axis, 
   position
): boolean;

Defined in: core/annotation.ts:106

Whether a position along an axis is on the axis (a mark outside it is not drawn, and has no label).

Parameters ​

chart ​

D3PChart

axis ​

D3PAxis

position ​

number

Returns ​

boolean

Inherited from ​

D3PAnnotation.within

Properties ​

behind ​

ts
protected readonly behind: false = false;

Defined in: core/annotation.ts:273

Layer the marks go in: background (behind the axes and data) or annotation (above the data).

Overrides ​

D3PAnnotation.behind


bus ​

ts
readonly bus: D3PBus;

Defined in: core/object.ts:27

The bus the object uses for its events.

Inherited from ​

D3PAnnotation.bus


chartData ​

ts
protected readonly chartData: Map<D3PChart, AnnotationData>;

Defined in: core/object.ts:66

What the object keeps for each chart it is attached to.

Inherited from ​

D3PAnnotation.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 ​

D3PAnnotation.e


isDestroying ​

ts
isDestroying: boolean = false;

Defined in: core/object.ts:31

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

Inherited from ​

D3PAnnotation.isDestroying


label ​

ts
label: string | undefined;

Defined in: core/annotation.ts:56

The text written next to the mark.

Inherited from ​

D3PAnnotation.label


radius ​

ts
radius: number;

Defined in: core/annotation.ts:283

Radius of the mark, in pixels.


style ​

ts
style: D3PAnnotationStyle;

Defined in: core/annotation.ts:54

The style of the marks.

Inherited from ​

D3PAnnotation.style


subs ​

ts
protected readonly subs: D3PSubscriptions;

Defined in: core/object.ts:33

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

Inherited from ​

D3PAnnotation.subs


x ​

ts
x: D3PDomainValue;

Defined in: core/annotation.ts:279

The value on the X axis.


xAxis ​

ts
xAxis: D3PAxisRef | undefined;

Defined in: core/annotation.ts:275

The X axis of the point (the first of the chart by default).


y ​

ts
y: D3PDomainValue;

Defined in: core/annotation.ts:281

The value on the Y axis.


yAxis ​

ts
yAxis: D3PAxisRef | undefined;

Defined in: core/annotation.ts:277

The Y axis of the point.