English
Class: D3PAnnotationBand
Defined in: core/annotation.ts:207
A band between two values of an axis, across the whole chart: a strip, a sector or a ring.
Extends
D3PAnnotation
Constructors
Constructor
ts
new D3PAnnotationBand(opts): D3PAnnotationBand;Defined in: core/annotation.ts:216
Parameters
opts
Returns
D3PAnnotationBand
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,
group,
labels
): void;Defined in: core/annotation.ts:227
Draw the marks in shapes (clipped to the plot) and their labels in labels.
Parameters
chart
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
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(chart): D3PCoordinateSystem<any> | undefined;Defined in: core/annotation.ts:223
The coordinate system the marks are drawn in, to clip them to its shape.
Parameters
chart
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?
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
axis
ts
axis: D3PAxisRef;Defined in: core/annotation.ts:210
The axis the band is on.
behind
ts
protected readonly behind: true = true;Defined in: core/annotation.ts:208
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
from
ts
from: D3PDomainValue;Defined in: core/annotation.ts:212
Where the band starts, as a value of the axis.
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
to
ts
to: D3PDomainValue;Defined in: core/annotation.ts:214
Where the band ends, as a value of the axis.