English
Abstract Class: D3PCoordinateSystem<F>
Defined in: core/coords.ts:138
Turns positions along the axes (range units) into places on the chart and back: it knows the shape of the plot, how to place points and cells, where the cursor goes and what is inside. The cartesian and the polar systems are made from it.
Extends
D3PAttachable<{ }, {changed:void; }>
Extended by
Type Parameters
F
F = any
the frame of the system: the immutable state its projections depend on (the size of the chart, its props...). Live projections read a fresh frame, snapshots keep one.
Implements
Constructors
Constructor
ts
new D3PCoordinateSystem<F>(
kind,
name,
bus?
): D3PCoordinateSystem<F>;Defined in: core/coords.ts:146
Parameters
kind
string
family of the system (cartesian, polar...): renderers and axis renderers declare which kinds they support.
name
string
bus?
Returns
D3PCoordinateSystem<F>
Overrides
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
areaPath()
ts
abstract areaPath(
chart,
pts,
b0,
curve?
): string | null;Defined in: core/coords.ts:214
Area between the polyline and its base: the third component of each point, or the constant second-dimension value b0 when a point has none. Gaps break the area.
Parameters
chart
pts
b0
number
curve?
Returns
string | null
attached()
ts
protected attached(chart): void;Defined in: core/coords.ts:154
Subscribe / create DOM. Subscriptions added to subs are released on detach.
Parameters
chart
Returns
void
Overrides
cellShape()
ts
abstract cellShape(
chart,
a0,
a1,
b0,
b1
): D3PCellShape;Defined in: core/coords.ts:216
The cell between a0..a1 and b0..b1 (range units): a rectangle, an arc...
Parameters
chart
a0
number
a1
number
b0
number
b1
number
Returns
changed()
ts
protected changed(): void;Defined in: core/coords.ts:162
Announce that the geometry changed (axes rebuild their scales).
Returns
void
clipPath()
ts
clipPath(_chart): string | undefined;Defined in: core/coords.ts:233
url(#id) of a clip path limiting what is drawn to the system's shape, if it has one.
Parameters
_chart
Returns
string | undefined
createData()
ts
protected createData(): object;Defined in: core/coords.ts:151
Build the per-chart record. Must not rely on other objects of the chart.
Returns
object
Overrides
cursor()
ts
abstract cursor(
chart,
a,
b
): object;Defined in: core/coords.ts:225
The shape of the cursor at a position of each dimension: a line, a circle or a path.
Parameters
chart
a
number | undefined
b
number | undefined
Returns
object
x?
ts
x?: D3PCursorGeometry;y?
ts
y?: D3PCursorGeometry;densify()
ts
densify(_chart, pts): D3PRangePoint[];Defined in: core/coords.ts:205
Extra points so that a polyline in range units draws the right curve once projected.
Parameters
_chart
pts
Returns
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): void;Defined in: core/coords.ts:157
DOM / registry cleanup (subscriptions are released afterwards).
Parameters
chart
Returns
void
Overrides
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[]
Inherited from
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
inRange()
ts
inRange(
_chart,
_a,
_b
): boolean;Defined in: core/coords.ts:229
Whether a point in range units is inside the system (points outside are not drawn).
Parameters
_chart
_a
number
_b
number
Returns
boolean
label()
ts
abstract label(
chart,
axis,
dim,
a,
b
): D3PLabelAnchor | undefined;Defined in: core/coords.ts:227
Where the label of the cursor goes for an axis, given a position along each dimension.
Parameters
chart
axis
dim
a
number | undefined
b
number | undefined
Returns
D3PLabelAnchor | undefined
linePath()
ts
abstract linePath(
chart,
pts,
curve?
): string | null;Defined in: core/coords.ts:209
Points whose second value is not finite are gaps: the line breaks there.
Parameters
chart
pts
curve?
Returns
string | null
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
projectFrom()
ts
projectFrom(
point,
options?,
cache?
): D3PRangePoint | undefined;Defined in: core/coords.ts:192
Viewport point to range units. strict (default) returns undefined outside of the system; tools pass strict: false to keep following a drag that left it.
Parameters
point
options?
strict?
boolean
cache?
Returns
D3PRangePoint | undefined
Implementation of
D3PSystemProjector.projectFrom
projectTo()
ts
projectTo(
chart,
a,
b,
cache?
): D3PViewportPoint;Defined in: core/coords.ts:186
Range units to a viewport point.
Parameters
chart
a
number
b
number
cache?
Returns
Implementation of
ranges()
ts
ranges(chart): D3PSystemRanges;Defined in: core/coords.ts:183
Ranges of the scales of the first (x) and second (y) dimension.
Parameters
chart
Returns
Implementation of
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
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>
Inherited from
selectionShape()
ts
abstract selectionShape(
chart,
from,
to
): D3PSelectionShape;Defined in: core/coords.ts:218
Shape of a selection dragged between two points of the inner area.
Parameters
chart
from
[number, number]
to
[number, number]
Returns
snapshot()
ts
snapshot(chart): D3PSystemSnapshot<F>;Defined in: core/coords.ts:200
The system as it is now, to compare the state of a gesture's start with the live one.
Parameters
chart
Returns
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
tooltipAnchor()
ts
abstract tooltipAnchor(
chart,
a,
b,
ratioY,
pointer?
): [number, number];Defined in: core/coords.ts:223
Where the tooltip box is anchored for a data point (a, b). pointer is the pointer position when it is over this chart; ratioY its relative height, which other charts reuse.
Parameters
chart
a
number
b
number
ratioY
number
pointer?
[number, number]
Returns
[number, number]
wrap()
ts
wrap(
chart,
dim,
delta
): number;Defined in: core/coords.ts:196
Normalize a difference along a dimension (an angle wraps around).
Parameters
chart
dim
delta
number
Returns
number
Implementation of
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, {
}>;Defined in: core/object.ts:66
What the object keeps for each chart it is attached to.
Inherited from
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.
Inherited from
kind
ts
readonly kind: string;Defined in: core/coords.ts:146
family of the system (cartesian, polar...): renderers and axis renderers declare which kinds they support.
name
ts
readonly name: string;Defined in: core/coords.ts:140
The name of the system. Axes and renderers refer to it with their system option.
subs
ts
protected readonly subs: D3PSubscriptions;Defined in: core/object.ts:33
The subscriptions of the object, released when it is destroyed.