Skip to content

Class: PolarSubplot ​

Experimental

A polar subplot laid out (see the module comment).

Constructors ​

Constructor ​

ts
new PolarSubplot(input): PolarSubplot;

Experimental

Parameters ​

ParameterType
inputPolarSubplotInput

Returns ​

PolarSubplot

Properties ​

PropertyModifierTypeDefault valueDescription
angularreadonlyAngularConvertundefinedExperimental
angularAxisreadonlyContainerundefinedExperimental
cxreadonlynumberundefinedExperimental
cyreadonlynumberundefinedExperimental
directionreadonly-1 | 1undefinedExperimental 1 counterclockwise, -1 clockwise.
fullreadonlybooleanundefinedExperimental
idreadonlystringundefinedExperimental
initialAnglereadonlynumberundefinedExperimental
initialRangereadonlyreadonly [number, number]undefinedExperimental The radial range autorange / range gave (linear), before any interaction.
initialRotationreadonlynumberundefinedExperimental
innerRadiusreadonlynumberundefinedExperimental
layoutreadonlyContainerundefinedExperimental The subplot's defaulted layout container (fullLayout.polarN) of the build.
placementreadonlyPolarPlacementundefinedExperimental
plotWidthreadonlynumberundefinedExperimental Plot area width (px), which sizes the angular axis' auto ticks as in Plotly.
radialAxisreadonlyContainerundefinedExperimental
radialScalereadonlyScaleundefinedExperimental
radiusreadonlynumberundefinedExperimental
sectorreadonlyreadonly [number, number]undefinedExperimental
sectorDegreadonlyreadonly [number, number]undefinedExperimental sector, sorted, in degrees and radians.
versionpublicnumber0Experimental Incremented by every setView: views and caches compare it.

Accessors ​

angle ​

Get Signature ​

ts
get angle(): number;

Experimental

Radial axis angle in use (degrees), before snapping to a polygon vertex.

Returns ​

number


radialAxisAngle ​

Get Signature ​

ts
get radialAxisAngle(): number;

Experimental

The radial axis' drawn angle in degrees (snapped to the nearest vertex on polygon grids).

Returns ​

number


region ​

Get Signature ​

ts
get region(): PolarRegion;

Experimental

The subplot's region in geometric px (see geometry.ts).

Returns ​

PolarRegion


rl ​

Get Signature ​

ts
get rl(): readonly [number, number];

Experimental

Radial range in use (linear coordinates).

Returns ​

readonly [number, number]


rotation ​

Get Signature ​

ts
get rotation(): number;

Experimental

Angular rotation in use (degrees).

Returns ​

number


tester ​

Get Signature ​

ts
get tester(): RegionTester;

Experimental

Returns ​

RegionTester


vangles ​

Get Signature ​

ts
get vangles(): readonly number[] | null;

Experimental

Polygon vertex angles (radians, counterclockwise) for gridshape: 'linear', else null.

Returns ​

readonly number[] | null

Methods ​

angularTicks() ​

ts
angularTicks(): readonly PolarTick[];

Experimental

Angular ticks (at: geometric radians), cached per view.

Returns ​

readonly PolarTick[]


c2g() ​

ts
c2g(c): number;

Experimental

Angular calc value → geometric radians.

Parameters ​

ParameterType
cnumber

Returns ​

number


g2c() ​

ts
g2c(g): number;

Experimental

Geometric radians → angular calc value.

Parameters ​

ParameterType
gnumber

Returns ​

number


inside() ​

ts
inside(x, y): boolean;

Experimental

Whether a point in geometric px is inside the subplot's region.

Parameters ​

ParameterType
xnumber
ynumber

Returns ​

boolean


onChange() ​

ts
onChange(fn): () => void;

Experimental

Call fn after every setView; returns the unsubscribe function.

Parameters ​

ParameterType
fn() => void

Returns ​

() => void


px2r() ​

ts
px2r(px): number;

Experimental

Px from the center → radial linear coordinate (for zooms and hover).

Parameters ​

ParameterType
pxnumber

Returns ​

number


r2px() ​

ts
r2px(l): number;

Experimental

Radial linear coordinate → px from the center (NaN for NaN).

Parameters ​

ParameterType
lnumber

Returns ​

number


radialTicks() ​

ts
radialTicks(): readonly PolarTick[];

Experimental

Radial ticks (at: px from the center), cached per view.

Returns ​

readonly PolarTick[]


rLabel() ​

ts
rLabel(l): string;

Experimental

Hover text of a radial linear coordinate (Plotly formatLabels' rLabel).

Parameters ​

ParameterType
lnumber

Returns ​

string


setView() ​

ts
setView(view): void;

Experimental

Change the view (drags): the radial range (linear), the rotation or the radial axis angle (degrees). Every listener is notified.

Parameters ​

ParameterType
view{ angle?: number; range?: readonly [number, number]; rotation?: number; }
view.angle?number
view.range?readonly [number, number]
view.rotation?number

Returns ​

void


t2g() ​

ts
t2g(t): number;

Experimental

Angular tick value (degrees, or category index) → geometric radians.

Parameters ​

ParameterType
tnumber

Returns ​

number


thetaLabel() ​

ts
thetaLabel(c): string;

Experimental

Hover text of an angular calc value (thetaLabel: degrees with °, radians, or category).

Parameters ​

ParameterType
cnumber

Returns ​

string


toGeometric() ​

ts
toGeometric(x, y): [number, number];

Experimental

Container px → geometric px.

Parameters ​

ParameterType
xnumber
ynumber

Returns ​

[number, number]

Released under the MIT License.