Class: ControllerFocusContext

ControllerFocusContext

Controller for handling Focus+Context visualization interactions. Manages lens-based focus region and context region interactions including panning, zooming, and lens radius adjustments.


new ControllerFocusContext(options)

Creates a new ControllerFocusContext instance.

Parameters:
Name Type Description
options Object

Configuration options

Properties
Name Type Argument Default Description
updateTimeInterval number <optional>
50

Time interval for position updates in ms

updateDelay number <optional>
100

Delay for position updates in ms

zoomDelay number <optional>
150

Delay for zoom animations in ms

zoomAmount number <optional>
1.5

Scale factor for zoom operations

priority number <optional>
-100

Controller priority

enableDirectContextControl boolean <optional>
true

Enable direct manipulation of context region

lensLayer Layer

Layer to use for lens visualization

camera Camera

Camera instance to control

canvas Canvas

Canvas instance to monitor

Source:
Fires:
  • ControllerFocusContext#panStart - Emitted when a pan operation begins,event: with timestamp
  • ControllerFocusContext#panEnd - Emitted when a pan operation ends,event: with timestamp
  • ControllerFocusContext#pinchStart - Emitted when a pinch operation begins,event: with timestamp
  • ControllerFocusContext#pinchEnd - Emitted when a pinch operation ends,event: with timestamp
Throws:

If required options (lensLayer, camera, canvas) are missing

Type
Error

Extends

Methods


<abstract> fingerDoubleTap(e)

Called for quick double mouse press or double finger touch.

Parameters:
Name Type Description
e Event

The double tap event

Inherited From:
Overrides:
Source:

<abstract> fingerSingleTap(e)

Called for quick mouse press or short finger touch.

Parameters:
Name Type Description
e Event

The tap event

Inherited From:
Overrides:
Source:

getFocus()

Gets current focus state.

Inherited From:
Overrides:
Source:
Returns:

Focus state object

Type
Object

getPixelPosition(e)

Converts position from canvas HTML coordinates to viewport coordinates.

Parameters:
Name Type Description
e PointerEvent

event

Inherited From:
Overrides:
Source:
Returns:

Position in viewport coordinates (origin at bottom-left, y up)

Type
Object

getScenePosition(e)

Converts position from canvas HTML coordinates to scene coordinates.

Parameters:
Name Type Description
e PointerEvent

event

Inherited From:
Overrides:
Source:
Returns:

Position in scene coordinates (origin at center, y up)

Type
Object

initLens()

Initializes lens position and size.

Source:

isInsideLens(p)

Checks if a point is inside the lens.

Parameters:
Name Type Description
p Object

Point to check in scene coordinates

Properties
Name Type Description
x number

X coordinate

y number

Y coordinate

Inherited From:
Overrides:
Source:
Returns:

Whether point is inside lens and/or on border

Type
Object

modifierState(e)

Gets the modifier state from an event.

Parameters:
Name Type Description
e Event

The event to check

Inherited From:
Overrides:
Source:
Returns:

Modifier state bitmask where:

  • 0 = No modifiers
  • 1 = Ctrl key
  • 2 = Shift key
  • 4 = Alt key Multiple modifiers combine their values (e.g., Ctrl+Shift = 3)
Type
number

updateRadiusAndScale(dz)

Updates lens radius and adjusts camera to maintain Focus+Context condition.

Parameters:
Name Type Description
dz number

Scale factor for radius adjustment

Source:

zoomEnd()

Handles end of zoom operation.

Overrides:
Source:

zoomMove(pe)

Handles zoom movement when dragging lens border.

Parameters:
Name Type Description
pe PointerEvent

Pointer event

Overrides:
Source:

zoomStart(pe)

Starts zoom operation when clicking on lens border.

Parameters:
Name Type Description
pe PointerEvent

Pointer event

Overrides:
Source: