Skip to content

Class: D3PCartesianSystem ​

Defined in: core/coords.ts:243

The rectangle of the plot: x goes right, y goes up.

Extends ​

Constructors ​

Constructor ​

ts
new D3PCartesianSystem(opts?): D3PCartesianSystem;

Defined in: core/coords.ts:244

Parameters ​

opts? ​

D3PCoordinateSystemOptions = {}

Returns ​

D3PCartesianSystem

Overrides ​

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

D3PCoordinateSystem.addToChart


areaPath() ​

ts
areaPath(
   _chart, 
   pts, 
   b0, 
   curve?
): string | null;

Defined in: core/coords.ts:263

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 ​

D3PChart

pts ​

D3PRangePoint[]

b0 ​

number

curve? ​

D3PCurve

Returns ​

string | null

Overrides ​

D3PCoordinateSystem.areaPath


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 ​

D3PChart

Returns ​

void

Inherited from ​

D3PCoordinateSystem.attached


cellShape() ​

ts
cellShape(
   _chart, 
   a0, 
   a1, 
   b0, 
   b1
): D3PCellShape;

Defined in: core/coords.ts:275

The cell between a0..a1 and b0..b1 (range units): a rectangle, an arc...

Parameters ​

_chart ​

D3PChart

a0 ​

number

a1 ​

number

b0 ​

number

b1 ​

number

Returns ​

D3PCellShape

Overrides ​

D3PCoordinateSystem.cellShape


changed() ​

ts
protected changed(): void;

Defined in: core/coords.ts:162

Announce that the geometry changed (axes rebuild their scales).

Returns ​

void

Inherited from ​

D3PCoordinateSystem.changed


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 ​

D3PChart

Returns ​

string | undefined

Inherited from ​

D3PCoordinateSystem.clipPath


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

Inherited from ​

D3PCoordinateSystem.createData


cursor() ​

ts
cursor(
   chart, 
   a, 
   b
): object;

Defined in: core/coords.ts:282

A vertical line at a and a horizontal line at b.

Parameters ​

chart ​

D3PChart

a ​

number | undefined

b ​

number | undefined

Returns ​

object

x ​
ts
x: 
  | {
  kind: "line";
  x1: number;
  x2: number;
  y1: 0;
  y2: number;
}
  | undefined;
y ​
ts
y: 
  | {
  kind: "line";
  x1: 0;
  x2: number;
  y1: number;
  y2: number;
}
  | undefined;

Overrides ​

D3PCoordinateSystem.cursor


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 ​

D3PChart

pts ​

D3PRangePoint[]

Returns ​

D3PRangePoint[]

Inherited from ​

D3PCoordinateSystem.densify


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 ​

D3PCoordinateSystem.destroy


detached() ​

ts
protected detached(chart): void;

Defined in: core/coords.ts:157

DOM / registry cleanup (subscriptions are released afterwards).

Parameters ​

chart ​

D3PChart

Returns ​

void

Inherited from ​

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

D3PCoordinateSystem.fire


getCharts() ​

ts
getCharts(): D3PChart[];

Defined in: core/object.ts:105

The charts the object is attached to.

Returns ​

D3PChart[]

Inherited from ​

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

D3PCoordinateSystem.hasChart


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 ​

D3PChart

_a ​

number

_b ​

number

Returns ​

boolean

Inherited from ​

D3PCoordinateSystem.inRange


label() ​

ts
label(
   chart, 
   axis, 
   dim, 
   a, 
   b
): D3PLabelAnchor | undefined;

Defined in: core/coords.ts:291

The label of the cursor for an axis: it hangs under (or above) an X axis, and sits beside a Y axis.

Parameters ​

chart ​

D3PChart

axis ​

D3PAxis

dim ​

D3PDimension

a ​

number | undefined

b ​

number | undefined

Returns ​

D3PLabelAnchor | undefined

Overrides ​

D3PCoordinateSystem.label


linePath() ​

ts
linePath(
   _chart, 
   pts, 
   curve?
): string | null;

Defined in: core/coords.ts:260

Points whose second value is not finite are gaps: the line breaks there.

Parameters ​

_chart ​

D3PChart

pts ​

D3PRangePoint[]

curve? ​

D3PCurve

Returns ​

string | null

Overrides ​

D3PCoordinateSystem.linePath


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 ​

D3PCoordinateSystem.onDestroy


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 ​

D3PViewportPoint

options? ​
strict? ​

boolean

cache? ​

D3PProjectionCache

Returns ​

D3PRangePoint | undefined

Inherited from ​

D3PCoordinateSystem.projectFrom


projectTo() ​

ts
projectTo(
   chart, 
   a, 
   b, 
   cache?
): D3PViewportPoint;

Defined in: core/coords.ts:186

Range units to a viewport point.

Parameters ​

chart ​

D3PChart

a ​

number

b ​

number

cache? ​

D3PProjectionCache

Returns ​

D3PViewportPoint

Inherited from ​

D3PCoordinateSystem.projectTo


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 ​

D3PChart

Returns ​

D3PSystemRanges

Inherited from ​

D3PCoordinateSystem.ranges


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 ​

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

D3PCoordinateSystem.render


selectionShape() ​

ts
selectionShape(
   _chart, 
   from, 
   to
): D3PSelectionShape;

Defined in: core/coords.ts:272

Shape of a selection dragged between two points of the inner area.

Parameters ​

_chart ​

D3PChart

from ​

[number, number]

to ​

[number, number]

Returns ​

D3PSelectionShape

Overrides ​

D3PCoordinateSystem.selectionShape


snapshot() ​

ts
snapshot(chart): D3PSystemSnapshot<{
  height: number;
  width: number;
}>;

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 ​

D3PChart

Returns ​

D3PSystemSnapshot<{ height: number; width: number; }>

Inherited from ​

D3PCoordinateSystem.snapshot


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 ​

D3PCoordinateSystem.tagDirty


tooltipAnchor() ​

ts
tooltipAnchor(
   chart, 
   a, 
   _b, 
   ratioY
): [number, number];

Defined in: core/coords.ts:278

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 ​

D3PChart

a ​

number

_b ​

number

ratioY ​

number

Returns ​

[number, number]

Overrides ​

D3PCoordinateSystem.tooltipAnchor


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 ​

D3PChart

dim ​

D3PDimension

delta ​

number

Returns ​

number

Inherited from ​

D3PCoordinateSystem.wrap

Properties ​

bus ​

ts
readonly bus: D3PBus;

Defined in: core/object.ts:27

The bus the object uses for its events.

Inherited from ​

D3PCoordinateSystem.bus


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 ​

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

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

D3PCoordinateSystem.isDestroying


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.

Inherited from ​

D3PCoordinateSystem.kind


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.

Inherited from ​

D3PCoordinateSystem.name


subs ​

ts
protected readonly subs: D3PSubscriptions;

Defined in: core/object.ts:33

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

Inherited from ​

D3PCoordinateSystem.subs