Skip to content

Class: D3PPassiveZoomTool ​

Defined in: core/tools/zoom.ts:93

Passive zoom tool (name: 'zoom'): API only, no mouse listener.

Extends ​

Constructors ​

Constructor ​

ts
new D3PPassiveZoomTool(opts?): D3PPassiveZoomTool;

Defined in: core/tools/zoom.ts:94

Parameters ​

opts? ​

D3PZoomToolOptions = {}

Returns ​

D3PPassiveZoomTool

Overrides ​

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

D3PZoomTool.addToChart


attached() ​

ts
protected attached(
   _chart, 
   _data, 
   _subs
): void;

Defined in: core/tools/zoom.ts:55

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

Parameters ​

_chart ​

D3PChart

_data ​

{ }

_subs ​

D3PSubscriptions

Returns ​

void

Inherited from ​

D3PZoomTool.attached


centeredZoom() ​

ts
centeredZoom(chart, magnification): void;

Defined in: core/tools/zoom.ts:66

Zoom every axis around the middle of its range (the center of the chart for cartesian axes).

Parameters ​

chart ​

D3PChart

magnification ​

number

Returns ​

void

Inherited from ​

D3PZoomTool.centeredZoom


createData() ​

ts
protected createData(): object;

Defined in: core/tools/zoom.ts:52

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

Returns ​

object

Inherited from ​

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

D3PZoomTool.destroy


detached() ​

ts
protected detached(_chart, _data): void;

Defined in: core/object.ts:74

DOM / registry cleanup (subscriptions are released afterwards).

Parameters ​

_chart ​

D3PChart

_data ​

{ }

Returns ​

void

Inherited from ​

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

D3PZoomTool.fire


getCharts() ​

ts
getCharts(): D3PChart[];

Defined in: core/object.ts:105

The charts the object is attached to.

Returns ​

D3PChart[]

Inherited from ​

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

D3PZoomTool.hasChart


isActiveOn() ​

ts
protected isActiveOn(chart): boolean;

Defined in: core/tools/base.ts:55

Whether the tool is attached to this chart and alive.

Parameters ​

chart ​

D3PChart

Returns ​

boolean

Inherited from ​

D3PZoomTool.isActiveOn


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 ​

D3PZoomTool.onDestroy


rangeOf() ​

ts
protected rangeOf(
   axis, 
   point, 
   system?, 
   cache?
): number | undefined;

Defined in: core/tools/base.ts:44

Position of point along axis, in the range units of its system (pixels for a cartesian axis, radians or distance to the center for a polar one). Not limited to the system, so a drag keeps working when the pointer leaves it. system defaults to the live one of the axis; a gesture that compares with its start passes the system of its snapshot.

Parameters ​

axis ​

D3PAxis

point ​

D3PViewportPoint

system? ​

D3PSystemProjector | undefined = ...

cache? ​

D3PProjectionCache

Returns ​

number | undefined

Inherited from ​

D3PZoomTool.rangeOf


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 ​

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

D3PZoomTool.render


requireArea() ​

ts
protected requireArea(chart): void;

Defined in: core/tools/base.ts:50

Ask for an interaction area (tools driven by the mouse need one).

Parameters ​

chart ​

D3PChart

Returns ​

void

Inherited from ​

D3PZoomTool.requireArea


resolveAxes() ​

ts
protected resolveAxes(chart): D3PAxis[];

Defined in: core/tools/base.ts:33

The axes the tool acts on: the ones it is restricted to, or all those of the chart.

Parameters ​

chart ​

D3PChart

Returns ​

D3PAxis[]

Inherited from ​

D3PZoomTool.resolveAxes


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 ​

D3PZoomTool.tagDirty


zoom() ​

ts
zoom(point, magnification): void;

Defined in: core/tools/zoom.ts:58

Zoom around a viewport point; magnification > 1 zooms in.

Parameters ​

point ​

D3PViewportPoint

magnification ​

number

Returns ​

void

Inherited from ​

D3PZoomTool.zoom


zoomAll() ​

ts
zoomAll(magnification): void;

Defined in: core/tools/zoom.ts:71

Zoom every attached chart around its center; a domain shared by several axes/charts is zoomed once.

Parameters ​

magnification ​

number

Returns ​

void

Inherited from ​

D3PZoomTool.zoomAll


zoomInAll() ​

ts
zoomInAll(): void;

Defined in: core/tools/zoom.ts:83

Zooms in on every axis the tool acts on, around its center.

Returns ​

void

Inherited from ​

D3PZoomTool.zoomInAll


zoomOutAll() ​

ts
zoomOutAll(): void;

Defined in: core/tools/zoom.ts:87

Zooms out on every axis the tool acts on, around its center.

Returns ​

void

Inherited from ​

D3PZoomTool.zoomOutAll

Properties ​

axes ​

ts
readonly axes: D3PAxisFilter | undefined;

Defined in: core/tools/base.ts:25

The axes the tool is restricted to (objects or names), if any.

Inherited from ​

D3PZoomTool.axes


bus ​

ts
readonly bus: D3PBus;

Defined in: core/object.ts:27

The bus the object uses for its events.

Inherited from ​

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

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

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

D3PZoomTool.isDestroying


name ​

ts
readonly name: string;

Defined in: core/tools/base.ts:27

Inherited from ​

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

D3PZoomTool.subs


zoomFactor ​

ts
zoomFactor: number;

Defined in: core/tools/zoom.ts:45

The factor of one step: the domain is divided by it to zoom in, multiplied to zoom out.

Inherited from ​

D3PZoomTool.zoomFactor