Skip to content

Class: D3PPolarSystem ​

Defined in: core/coords.ts:370

Polar system: the first dimension is the angle (radians on screen, 0 = up, clockwise by default), the second the distance to the center. The disc is centered in the inner area.

Extends ​

Accessors ​

props ​

Get Signature ​

ts
get props(): D3PProps<D3PPolarProps>;

Defined in: core/coords.ts:382

The props of the system: where the angle starts, the hole, the padding...

Returns ​

D3PProps<D3PPolarProps>

Set Signature ​

ts
set props(v): void;

Defined in: core/coords.ts:386

Merges props into those of the system; the chart is drawn again.

Parameters ​
v ​
clockwise? ​

boolean

Whether the angle grows clockwise (default true).

innerRadius? ​

number

Hole radius as a fraction of the outer radius (0 = full disc, 0.5 = ring).

padding? ​

number

Pixels kept free around the disc, for the angle labels.

reach? ​

number

How far beyond the ring, in pixels, the pointer still counts as being over the system. There it reads the angle and the outer radius, so the tooltip, the markers and the radius axis that follows the pointer keep working around the chart, not only on the disc.

shift? ​

[number, number]

Moves the center, as fractions of the outer radius: [0, 0.5] lowers a half disc so that it sits in the middle.

startAngle? ​

number

Screen angle (degrees) at which the angle range starts: 0 = up.

sweep? ​

number

Angle covered by the system, in degrees: 360 is a full circle, 180 a half (gauges, semi-donuts).

Returns ​

void

Constructors ​

Constructor ​

ts
new D3PPolarSystem(opts?): D3PPolarSystem;

Defined in: core/coords.ts:376

Parameters ​

opts? ​

D3PPolarOptions = {}

Returns ​

D3PPolarSystem

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:515

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:566

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;

Defined in: core/coords.ts:542

Ring (disc minus the hole) limiting the drawing, so a zoomed radius never overflows it.

Parameters ​

chart ​

D3PChart

Returns ​

string

Overrides ​

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:588

A spoke at the angle a and a circle at the radius b.

Parameters ​

chart ​

D3PChart

a ​

number | undefined

b ​

number | undefined

Returns ​

object

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

Overrides ​

D3PCoordinateSystem.cursor


densify() ​

ts
densify(_chart, pts): D3PRangePoint[];

Defined in: core/coords.ts:438

Extra points so that a polyline in range units draws the right curve once projected.

Parameters ​

_chart ​

D3PChart

pts ​

D3PRangePoint[]

Returns ​

D3PRangePoint[]

Overrides ​

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:560

DOM / registry cleanup (subscriptions are released afterwards).

Parameters ​

chart ​

D3PChart

Returns ​

void

Overrides ​

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


geometry() ​

ts
geometry(chart): D3PPolarGeometry;

Defined in: core/coords.ts:397

The geometry of the system on a chart: the center and the radii in pixels, the angle range and the reach of the pointer.

Parameters ​

chart ​

D3PChart

Returns ​

D3PPolarGeometry


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:533

Whether a point in range units is inside the system (points outside are not drawn).

Parameters ​

chart ​

D3PChart

a ​

number

b ​

number

Returns ​

boolean

Overrides ​

D3PCoordinateSystem.inRange


label() ​

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

Defined in: core/coords.ts:605

The label of the cursor for an axis: against the disc, on its angle axis, and beside the radius.

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:505

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:572

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<D3PPolarGeometry>;

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<D3PPolarGeometry>

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, 
   pointer?
): [number, number];

Defined in: core/coords.ts:583

Follows the pointer; on a chart the pointer is not over, falls back to the data point.

Parameters ​

chart ​

D3PChart

a ​

number

b ​

number

_ratioY ​

number

pointer? ​

[number, 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