English
Class: D3PAnnotationText
Defined in: core/annotation.ts:338
A piece of text at a place that does not depend on the axes: the center of a gauge, a corner...
Extends
D3PAnnotation
Constructors
Constructor
ts
new D3PAnnotationText(opts): D3PAnnotationText;Defined in: core/annotation.ts:351
Parameters
opts
Returns
D3PAnnotationText
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
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
data
AnnotationData
subs
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
ref
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
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
data
AnnotationData
Returns
void
Inherited from
D3PAnnotation.detached
draw()
ts
protected draw(
chart,
_shapes,
group
): void;Defined in: core/annotation.ts:364
Draw the marks in shapes (clipped to the plot) and their labels in labels.
Parameters
chart
_shapes
Selection<SVGGElement, unknown, null, undefined>
group
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
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
axis
value
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
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
Returns
void
Inherited from
D3PAnnotation.render
systemOf()
ts
protected systemOf(): undefined;Defined in: core/annotation.ts:360
The coordinate system the marks are drawn in, to clip them to its shape.
Returns
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?
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
axis
position
number
Returns
boolean
Inherited from
D3PAnnotation.within
Properties
anchor
ts
anchor: "middle" | "start" | "end";Defined in: core/annotation.ts:349
Which side of its position the text starts from.
at
ts
at: string | [number, number];Defined in: core/annotation.ts:343
Where the text is centered: the name of a polar system, or fractions of the plot.
behind
ts
protected readonly behind: false = false;Defined in: core/annotation.ts:339
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
dx
ts
dx: number;Defined in: core/annotation.ts:345
Offset of the text from its place, in pixels, on x.
dy
ts
dy: number;Defined in: core/annotation.ts:347
Offset of the text from its place, in pixels, on y.
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
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
text_
ts
text_: string;Defined in: core/annotation.ts:341
The text to write.