graph
.
zoomTo
(
1.5
,
false
,
graph
.
getCanvasCenter
(
)
)
;
Graph.zoomBy(ratio, animation, origin)
Zoom based on the current zoom scale (relative zoom).
zoomBy(ratio: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void>;
Parameters
Parameter
|
Description
|
Type
|
Default
|
Required
|
ratio
|
Zoom ratio (>1 zoom in, <1 zoom out)
|
number
|
-
|
✓
|
animation
|
Animation configuration
|
ViewportAnimationEffectTiming
|
-
|
|
origin
|
Zoom center point (viewport coordinates)
|
Point
|
-
|
|
Example
Graph.translateTo(position, animation)
Pan the graph to a specified position (absolute pan).
translateTo(position: Point, animation?: ViewportAnimationEffectTiming): Promise<void>;
Parameters
Example
graph.translateTo([100, 100]);
graph.translateTo([200, 200], {
Graph.translateBy(offset, animation)
Pan the graph by a specified distance relative to the current position (relative pan).
translateBy(offset: Point, animation?: ViewportAnimationEffectTiming): Promise<void>;
Parameters
Example
graph.translateBy([100, 50]);
graph.translateBy([-50, -50], {
Graph.rotateTo(angle, animation, origin)
Rotate the canvas to a specified angle (absolute rotation).
rotateTo(angle: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void>;
Parameters
Parameter
|
Description
|
Type
|
Default
|
Required
|
angle
|
Target rotation angle (radians)
|
number
|
-
|
✓
|
animation
|
Animation configuration
|
ViewportAnimationEffectTiming
|
-
|
|
origin
|
Rotation center point (viewport coordinates)
|
Point
|
-
|
|
Example
graph.rotateTo(Math.PI / 4);