Skip to content

Class: D3PRadiusAxis ​

Defined in: core/axis.ts:457

Radius (magnitude) axis of a polar system: new D3PAxis({ position: 'radius', ... }).

Extends ​

Accessors ​

props ​

Get Signature ​

ts
get props(): D3PProps<D3PAxisProps>;

Defined in: core/axis.ts:217

The props of the axis: ticks, format, grid, name.

Returns ​

D3PProps<D3PAxisProps>

Set Signature ​

ts
set props(v): void;

Defined in: core/axis.ts:221

Merges props into those of the axis.

Parameters ​
v ​
displayName? ​

string

The name the axis shows (the text of its title): the name of the axis by default.

grid? ​

{ enabled?: boolean; opacity?: number; stroke?: string; strokeDasharray?: string; strokeWidth?: number; }

The grid drawn from the ticks.

grid.enabled? ​

boolean

Whether the grid is drawn.

grid.opacity? ​

number

Opacity of the grid lines (0 to 1).

grid.stroke? ​

string

Color of the grid lines.

grid.strokeDasharray? ​

string

Dash of the grid lines, as an SVG stroke-dasharray ('2,2').

grid.strokeWidth? ​

number

Width of the grid lines, in pixels.

postProcess? ​

(group) => void

Called after each draw with the axis group, to customize the SVG.

tickCount? ​

number

The number of ticks wanted (d3 may give a few more or less).

tickFormat? ​

((v) => string) | null

Writes a value, for the ticks and the labels of the cursor and the tooltip. null: the default format of the scale. A cursor label is not a tick: round its value.

Returns ​

void

Inherited from ​

D3PAxis.props

Constructors ​

Constructor ​

ts
new D3PRadiusAxis(opts): D3PRadiusAxis;

Defined in: core/axis.ts:458

Parameters ​

opts ​

Omit<D3PAxisOptions, "position">

Returns ​

D3PRadiusAxis

Overrides ​

D3PAxis.constructor

Methods ​

addToChart() ​

ts
addToChart(chart, offset?): void;

Defined in: core/axis.ts:228

offset overrides the one of the options for this chart.

Parameters ​

chart ​

D3PChart

offset? ​

number

Returns ​

void

Inherited from ​

D3PAxis.addToChart


attached() ​

ts
protected attached(
   chart, 
   data, 
   subs
): void;

Defined in: core/axis.ts:239

Subscribe / create DOM. Subscriptions added to subs are released on detach.

Parameters ​

chart ​

D3PChart

data ​

AxisChartData

subs ​

D3PSubscriptions

Returns ​

void

Inherited from ​

D3PAxis.attached


createData() ​

ts
protected createData(chart): AxisChartData;

Defined in: core/axis.ts:233

Build the per-chart record. Must not rely on other objects of the chart.

Parameters ​

chart ​

D3PChart

Returns ​

AxisChartData

Inherited from ​

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

D3PAxis.destroy


detached() ​

ts
protected detached(chart, data): void;

Defined in: core/axis.ts:247

DOM / registry cleanup (subscriptions are released afterwards).

Parameters ​

chart ​

D3PChart

data ​

AxisChartData

Returns ​

void

Inherited from ​

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

D3PAxis.fire


getAxisDomain() ​

ts
getAxisDomain(): D3PAxisDomain;

Defined in: core/axis.ts:360

The domain the axis reads.

Returns ​

D3PAxisDomain

Inherited from ​

D3PAxis.getAxisDomain


getCharts() ​

ts
getCharts(): D3PChart[];

Defined in: core/object.ts:105

The charts the object is attached to.

Returns ​

D3PChart[]

Inherited from ​

D3PAxis.getCharts


getExtent() ​

ts
getExtent(chart): number | undefined;

Defined in: core/axis.ts:330

How far the axis reaches from its line, outward: the ticks and their labels, in pixels. undefined before it is drawn, or where nothing is laid out. A title that sits against the axis uses it.

Parameters ​

chart ​

D3PChart

Returns ​

number | undefined

Inherited from ​

D3PAxis.getExtent


getOffset() ​

ts
getOffset(chart): number;

Defined in: core/axis.ts:388

How far the axis is from the plot, outward, in pixels: what stacks several axes on a side.

Parameters ​

chart ​

D3PChart

Returns ​

number

Inherited from ​

D3PAxis.getOffset


getScale() ​

ts
getScale(chart): D3PScale | undefined;

Defined in: core/axis.ts:289

The scale of the axis on a chart, in line with its domain (undefined if the axis is not on it).

Parameters ​

chart ​

D3PChart

Returns ​

D3PScale | undefined

Inherited from ​

D3PAxis.getScale


getSystem() ​

ts
getSystem(chart): D3PCoordinateSystem<any> | undefined;

Defined in: core/axis.ts:355

Coordinate system of the axis on chart.

Parameters ​

chart ​

D3PChart

Returns ​

D3PCoordinateSystem<any> | undefined

Inherited from ​

D3PAxis.getSystem


getTickFormatter() ​

ts
getTickFormatter(chart): (v) => string;

Defined in: core/axis.ts:367

The function that writes a value of this axis: props.tickFormat, or the default format of its scale.

Parameters ​

chart ​

D3PChart

Returns ​

(v) => string

Inherited from ​

D3PAxis.getTickFormatter


getTranslation() ​

ts
getTranslation(chart): object;

Defined in: core/axis.ts:374

Translation of a side axis inside the chart's inner coordinates (nothing for polar axes).

Parameters ​

chart ​

D3PChart

Returns ​

object

x ​
ts
x: number;
y ​
ts
y: number;

Inherited from ​

D3PAxis.getTranslation


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 ​

D3PAxis.hasChart


isVisible() ​

ts
isVisible(chart): boolean;

Defined in: core/axis.ts:403

Whether the axis is drawn on this chart.

Parameters ​

chart ​

D3PChart

Returns ​

boolean

Inherited from ​

D3PAxis.isVisible


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 ​

D3PAxis.onDestroy


projectFrom() ​

ts
projectFrom(
   point, 
   options?, 
   cache?
): D3PDomainValue | undefined;

Defined in: core/axis.ts:309

The value of this axis under a point of the chart, or undefined if there is none (strict refuses the points outside of the plot).

Parameters ​

point ​

D3PViewportPoint

options? ​
strict? ​

boolean

cache? ​

D3PProjectionCache

Returns ​

D3PDomainValue | undefined

Inherited from ​

D3PAxis.projectFrom


projectTo() ​

ts
projectTo(
   chart, 
   value, 
   cache?
): number | undefined;

Defined in: core/axis.ts:299

The place of a value along this axis, in range units (undefined if the scale has none for it).

Parameters ​

chart ​

D3PChart

value ​

D3PDomainValue

cache? ​

D3PProjectionCache

Returns ​

number | undefined

Inherited from ​

D3PAxis.projectTo


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 ​

D3PAxis.removeFromChart


render() ​

ts
render(chart): void;

Defined in: core/axis.ts:419

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

Inherited from ​

D3PAxis.render


setOffset() ​

ts
setOffset(chart, px): void;

Defined in: core/axis.ts:380

Move the axis away from the plot (see the offset option), to stack several axes on one side.

Parameters ​

chart ​

D3PChart

px ​

number

Returns ​

void

Inherited from ​

D3PAxis.setOffset


setVisible() ​

ts
setVisible(visible, chart?): void;

Defined in: core/axis.ts:393

Show/hide on one chart, or on all of them.

Parameters ​

visible ​

boolean

chart? ​

D3PChart

Returns ​

void

Inherited from ​

D3PAxis.setVisible


snapshot() ​

ts
snapshot(chart, system): D3PAxisSnapshot;

Defined in: core/axis.ts:321

The axis as it is now on chart (see D3PAxisSnapshot); system is the snapshot of its system.

Parameters ​

chart ​

D3PChart

system ​

D3PSystemSnapshot

Returns ​

D3PAxisSnapshot

Inherited from ​

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

D3PAxis.tagDirty

Properties ​

bus ​

ts
readonly bus: D3PBus;

Defined in: core/object.ts:27

The bus the object uses for its events.

Inherited from ​

D3PAxis.bus


chartData ​

ts
protected readonly chartData: Map<D3PChart, AxisChartData>;

Defined in: core/object.ts:66

What the object keeps for each chart it is attached to.

Inherited from ​

D3PAxis.chartData


component ​

ts
readonly component: D3PAxisComponent;

Defined in: core/axis.ts:177

x or y: the dimension of the axis (the angle is x and the radius y in polar).

Inherited from ​

D3PAxis.component


domain ​

ts
readonly domain: D3PAxisDomain;

Defined in: core/axis.ts:173

The domain the axis reads.

Inherited from ​

D3PAxis.domain


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 ​

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

D3PAxis.isDestroying


name ​

ts
readonly name: string;

Defined in: core/axis.ts:171

The name of the axis. It is unique among the axes of a dimension in a chart.

Inherited from ​

D3PAxis.name


position ​

ts
readonly position: D3PAxisPosition;

Defined in: core/axis.ts:175

Where the axis is drawn: bottom, top, left, right, or angle and radius in polar.

Inherited from ​

D3PAxis.position


renderer ​

ts
readonly renderer: D3PAxisRenderer;

Defined in: core/axis.ts:181

What draws the axis: a line along a side, a ring, a radius.

Inherited from ​

D3PAxis.renderer


scaleOptions ​

ts
readonly scaleOptions: D3PScaleOptions;

Defined in: core/axis.ts:185

Options of the scale.

Inherited from ​

D3PAxis.scaleOptions


scaleType ​

ts
readonly scaleType: D3PScaleType;

Defined in: core/axis.ts:183

The type of scale.

Inherited from ​

D3PAxis.scaleType


subs ​

ts
protected readonly subs: D3PSubscriptions;

Defined in: core/object.ts:33

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

Inherited from ​

D3PAxis.subs


systemName ​

ts
readonly systemName: string;

Defined in: core/axis.ts:179

The name of the coordinate system the axis is in.

Inherited from ​

D3PAxis.systemName