Skip to main content

Class: MouseCaptor<N, E, G>

Mouse captor class.

Extends

  • default<MouseCaptorEvents, N, E, G>

Type Parameters

N extends Attributes = Attributes

E extends Attributes = Attributes

G extends Attributes = Attributes

Constructors

new MouseCaptor()

new MouseCaptor<N, E, G>(container, renderer): MouseCaptor<N, E, G>

Parameters

container: HTMLElement

renderer: Sigma<N, E, G>

Returns

MouseCaptor<N, E, G>

Overrides

Captor<MouseCaptorEvents, N, E, G>.constructor

Defined in

sigma/src/core/captors/mouse.ts:78

Properties

clicks

clicks: number = 0

Defined in

sigma/src/core/captors/mouse.ts:70


container

container: HTMLElement

Inherited from

Captor.container

Defined in

sigma/src/core/captors/captor.ts:142


currentWheelDirection

currentWheelDirection: -1 | 0 | 1 = 0

Defined in

sigma/src/core/captors/mouse.ts:73


doubleClickTimeout

doubleClickTimeout: null | number = null

Defined in

sigma/src/core/captors/mouse.ts:71


downStartTime

downStartTime: null | number = null

Defined in

sigma/src/core/captors/mouse.ts:63


draggedEvents

draggedEvents: number = 0

Defined in

sigma/src/core/captors/mouse.ts:62


enabled

enabled: boolean = true

Defined in

sigma/src/core/captors/mouse.ts:61


isMouseDown

isMouseDown: boolean = false

Defined in

sigma/src/core/captors/mouse.ts:66


isMoving

isMoving: boolean = false

Defined in

sigma/src/core/captors/mouse.ts:67


lastMouseX

lastMouseX: null | number = null

Defined in

sigma/src/core/captors/mouse.ts:64


lastMouseY

lastMouseY: null | number = null

Defined in

sigma/src/core/captors/mouse.ts:65


lastWheelTriggerTime?

optional lastWheelTriggerTime: number

Defined in

sigma/src/core/captors/mouse.ts:74


movingTimeout

movingTimeout: null | number = null

Defined in

sigma/src/core/captors/mouse.ts:68


rawEmitter

rawEmitter: EventEmitter<DefaultEventMap>

Inherited from

Captor.rawEmitter

Defined in

sigma/src/types.ts:109


renderer

renderer: Sigma<N, E, G>

Inherited from

Captor.renderer

Defined in

sigma/src/core/captors/captor.ts:143


settings

settings: MouseSettings = DEFAULT_MOUSE_SETTINGS

Defined in

sigma/src/core/captors/mouse.ts:76


startCameraState

startCameraState: null | CameraState = null

Defined in

sigma/src/core/captors/mouse.ts:69

Methods

addListener()

addListener<Event>(type, listener): this

Type Parameters

Event extends keyof MouseCaptorEvents

Parameters

type: Event

listener: MouseCaptorEvents[Event]

Returns

this

Inherited from

Captor.addListener

Defined in

sigma/src/types.ts:115


emit()

emit<Event>(type, ...args): boolean

Type Parameters

Event extends keyof MouseCaptorEvents

Parameters

type: Event

• ...args: Parameters<MouseCaptorEvents[Event]>

Returns

boolean

Inherited from

Captor.emit

Defined in

sigma/src/types.ts:114


eventNames()

eventNames<Event>(): Event[]

Type Parameters

Event extends keyof MouseCaptorEvents

Returns

Event[]

Inherited from

Captor.eventNames

Defined in

sigma/src/types.ts:111


getMaxListeners()

getMaxListeners(): number

Returns

number

Inherited from

Captor.getMaxListeners

Defined in

sigma/src/types.ts:113


handleClick()

handleClick(e): void

Parameters

e: MouseEvent

Returns

void

Defined in

sigma/src/core/captors/mouse.ts:117


handleDoubleClick()

handleDoubleClick(e): void

Parameters

e: MouseEvent

Returns

void

Defined in

sigma/src/core/captors/mouse.ts:147


handleDown()

handleDown(e): void

Parameters

e: MouseEvent

Returns

void

Defined in

sigma/src/core/captors/mouse.ts:168


handleEnter()

handleEnter(e): void

Parameters

e: MouseEvent

Returns

void

Defined in

sigma/src/core/captors/mouse.ts:305


handleLeave()

handleLeave(e): void

Parameters

e: MouseEvent

Returns

void

Defined in

sigma/src/core/captors/mouse.ts:301


handleMove()

handleMove(e): void

Parameters

e: MouseEvent

Returns

void

Defined in

sigma/src/core/captors/mouse.ts:238


handleRightClick()

handleRightClick(e): void

Parameters

e: MouseEvent

Returns

void

Defined in

sigma/src/core/captors/mouse.ts:141


handleUp()

handleUp(e): void

Parameters

e: MouseEvent

Returns

void

Defined in

sigma/src/core/captors/mouse.ts:188


handleWheel()

handleWheel(e): void

Parameters

e: WheelEvent

Returns

void

Defined in

sigma/src/core/captors/mouse.ts:309


kill()

kill(): void

Returns

void

Overrides

Captor.kill

Defined in

sigma/src/core/captors/mouse.ts:103


listenerCount()

listenerCount<Event>(type): number

Type Parameters

Event extends keyof MouseCaptorEvents

Parameters

type: Event

Returns

number

Inherited from

Captor.listenerCount

Defined in

sigma/src/types.ts:124


listeners()

listeners<Event>(type): MouseCaptorEvents[Event][]

Type Parameters

Event extends keyof MouseCaptorEvents

Parameters

type: Event

Returns

MouseCaptorEvents[Event][]

Inherited from

Captor.listeners

Defined in

sigma/src/types.ts:123


off()

off<Event>(type, listener): this

Type Parameters

Event extends keyof MouseCaptorEvents

Parameters

type: Event

listener: MouseCaptorEvents[Event]

Returns

this

Inherited from

Captor.off

Defined in

sigma/src/types.ts:121


on()

on<Event>(type, listener): this

Type Parameters

Event extends keyof MouseCaptorEvents

Parameters

type: Event

listener: MouseCaptorEvents[Event]

Returns

this

Inherited from

Captor.on

Defined in

sigma/src/types.ts:116


once()

once<Event>(type, listener): this

Type Parameters

Event extends keyof MouseCaptorEvents

Parameters

type: Event

listener: MouseCaptorEvents[Event]

Returns

this

Inherited from

Captor.once

Defined in

sigma/src/types.ts:117


prependListener()

prependListener<Event>(type, listener): this

Type Parameters

Event extends keyof MouseCaptorEvents

Parameters

type: Event

listener: MouseCaptorEvents[Event]

Returns

this

Inherited from

Captor.prependListener

Defined in

sigma/src/types.ts:118


prependOnceListener()

prependOnceListener<Event>(type, listener): this

Type Parameters

Event extends keyof MouseCaptorEvents

Parameters

type: Event

listener: MouseCaptorEvents[Event]

Returns

this

Inherited from

Captor.prependOnceListener

Defined in

sigma/src/types.ts:119


rawListeners()

rawListeners<Event>(type): MouseCaptorEvents[Event][]

Type Parameters

Event extends keyof MouseCaptorEvents

Parameters

type: Event

Returns

MouseCaptorEvents[Event][]

Inherited from

Captor.rawListeners

Defined in

sigma/src/types.ts:125


removeAllListeners()

removeAllListeners<Event>(type?): this

Type Parameters

Event extends keyof MouseCaptorEvents

Parameters

type?: Event

Returns

this

Inherited from

Captor.removeAllListeners

Defined in

sigma/src/types.ts:122


removeListener()

removeListener<Event>(type, listener): this

Type Parameters

Event extends keyof MouseCaptorEvents

Parameters

type: Event

listener: MouseCaptorEvents[Event]

Returns

this

Inherited from

Captor.removeListener

Defined in

sigma/src/types.ts:120


setMaxListeners()

setMaxListeners(n): this

Parameters

n: number

Returns

this

Inherited from

Captor.setMaxListeners

Defined in

sigma/src/types.ts:112


setSettings()

setSettings(settings): void

Parameters

settings: MouseSettings

Returns

void

Defined in

sigma/src/core/captors/mouse.ts:355