4.2 KiB
title |
---|
DragCanvasOptions |
Overview - v5.0.0-beta.21 / Modules / behaviors / DragCanvasOptions
behaviors.DragCanvasOptions
Properties
direction
• Optional
direction: "x"
| "y"
| "both"
The direction to drag the canvas. 'both' by default.
Defined in
packages/g6/src/stdlib/behavior/drag-canvas.ts:22
dragOnItems
• Optional
dragOnItems: boolean
Whether allow trigger this behavior when drag start on nodes / edges / combos.
Defined in
packages/g6/src/stdlib/behavior/drag-canvas.ts:14
enableOptimize
• Optional
enableOptimize: boolean
Whether enable optimize strategies, which will hide all the shapes excluding node keyShape while dragging.
Defined in
packages/g6/src/stdlib/behavior/drag-canvas.ts:10
eventName
• Optional
eventName: string
The event name to trigger when drag end.
Defined in
packages/g6/src/stdlib/behavior/drag-canvas.ts:48
scalableRange
• Optional
scalableRange: string
| number
The range of canvas to limit dragging, 0 by default, which means the graph cannot be dragged totally out of the view port range. If scalableRange is number or a string without 'px', means it is a ratio of the graph content. If scalableRange is a string with 'px', it is regarded as pixels. If scalableRange = 0, no constrains; If scalableRange > 0, the graph can be dragged out of the view port range If scalableRange < 0, the range is smaller than the view port. Refer to https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*IFfoS67_HssAAAAAAAAAAAAAARQnAQ
Defined in
packages/g6/src/stdlib/behavior/drag-canvas.ts:44
secondaryKey
• Optional
secondaryKey: string
The assistant secondary key on keyboard. If it is not assigned, the behavior will be triggered when trigger happens.
Defined in
packages/g6/src/stdlib/behavior/drag-canvas.ts:26
secondaryKeyToDisable
• Optional
secondaryKeyToDisable: string
The assistant secondary key on keyboard to prevent the behavior to be tiggered. 'shift' by default.
Defined in
packages/g6/src/stdlib/behavior/drag-canvas.ts:30
shouldBegin
• Optional
shouldBegin: (event
: IG6GraphEvent
) => boolean
Type declaration
▸ (event
): boolean
Whether allow the behavior happen on the current item.
Parameters
Name | Type |
---|---|
event |
IG6GraphEvent |
Returns
boolean
Defined in
packages/g6/src/stdlib/behavior/drag-canvas.ts:52
speedUpKey
• Optional
speedUpKey: string
The key on keyboard to speed up translating while pressing and drag-canvas by direction keys. The trigger should be 'directionKeys' for this option.
Defined in
packages/g6/src/stdlib/behavior/drag-canvas.ts:34
trigger
• Optional
trigger: "drag"
| "directionKeys"
The trigger for the behavior, 'drag' by default. 'directionKeys' means trigger this behavior by up / down / left / right keys on keyboard.