Skip to main content

Class: PositionedMinimap

Defined in: positioned_minimap.ts:20

A positionable version of minimap that implements IPositionable.

Extends​

Implements​

  • IPositionable

Properties index​

PropertyDescription
focusRegion-
height-
idThe unique ID for this component that is used to register with the ComponentManager.
left-
margin-
minimapWorkspace-
minimapWrapper-
onMouseDownWrapper-
onMouseMoveWrapper-
onMouseUpWrapper-
panStep-
primaryWorkspace-
top-
width-

Methods index​

MethodDescription
disableFocusRegionDisables the focus region.
disposeDisposes the minimap. Unlinks from all DOM elements and remove all event listeners to prevent memory leaks.
enableFocusRegionEnables the focus region; A highlight of the viewport in the minimap.
getBoundingRectangleReturns the bounding rectangle of the UI element in pixel units relative to the Blockly injection div.
getKeyboardPanStepReturns the current keyboard pan step in primary-workspace pixels.
initInitialize.
isFocusEnabledReturns whether the focus region is enabled.
positionPositions the minimap.
setKeyboardPanStepSets how far (in primary-workspace pixels) each arrow keypress pans the workspace when the minimap is focused.
minimapToPrimaryCoordsConverts the coorindates from a mouse event on the minimap into scroll coordinates for the primary viewport.

Constructors​

Constructor​

new PositionedMinimap(workspace): PositionedMinimap;

Defined in: positioned_minimap.ts:36

Constructor for a positionable minimap.

Parameters​

ParameterTypeDescription
workspaceWorkspaceSvgThe workspace to mirror.

Returns​

PositionedMinimap

Overrides​

Minimap.constructor

Properties​

focusRegion​

protected focusRegion: FocusRegion | null = null;

Defined in: minimap.ts:40

Inherited from​

Minimap.focusRegion


height​

protected height: number;

Defined in: positioned_minimap.ts:28


id​

id: string;

Defined in: positioned_minimap.ts:29

The unique ID for this component that is used to register with the ComponentManager.

Implementation of​

Blockly.IPositionable.id


left​

protected left: number;

Defined in: positioned_minimap.ts:26


margin​

protected margin: number;

Defined in: positioned_minimap.ts:24


minimapWorkspace​

protected minimapWorkspace: WorkspaceSvg | null = null;

Defined in: minimap.ts:39

Inherited from​

Minimap.minimapWorkspace


minimapWrapper​

protected minimapWrapper: HTMLDivElement | null = null;

Defined in: minimap.ts:44

Inherited from​

Minimap.minimapWrapper


onMouseDownWrapper​

protected onMouseDownWrapper: Data | null = null;

Defined in: minimap.ts:42

Inherited from​

Minimap.onMouseDownWrapper


onMouseMoveWrapper​

protected onMouseMoveWrapper: Data | null = null;

Defined in: minimap.ts:41

Inherited from​

Minimap.onMouseMoveWrapper


onMouseUpWrapper​

protected onMouseUpWrapper: Data | null = null;

Defined in: minimap.ts:43

Inherited from​

Minimap.onMouseUpWrapper


panStep​

protected panStep: number = DEFAULT_PAN_STEP;

Defined in: minimap.ts:48

Inherited from​

Minimap.panStep


primaryWorkspace​

protected primaryWorkspace: WorkspaceSvg;

Defined in: minimap.ts:38

Inherited from​

Minimap.primaryWorkspace


top​

protected top: number;

Defined in: positioned_minimap.ts:25


width​

protected width: number;

Defined in: positioned_minimap.ts:27

Methods​

disableFocusRegion()​

disableFocusRegion(): void;

Defined in: minimap.ts:443

Disables the focus region.

Returns​

void

Inherited from​

Minimap.disableFocusRegion


dispose()​

dispose(): void;

Defined in: minimap.ts:203

Disposes the minimap. Unlinks from all DOM elements and remove all event listeners to prevent memory leaks.

Returns​

void

Inherited from​

Minimap.dispose


enableFocusRegion()​

enableFocusRegion(): void;

Defined in: minimap.ts:434

Enables the focus region; A highlight of the viewport in the minimap.

Returns​

void

Inherited from​

Minimap.enableFocusRegion


getBoundingRectangle()​

getBoundingRectangle(): Rect;

Defined in: positioned_minimap.ts:65

Returns the bounding rectangle of the UI element in pixel units relative to the Blockly injection div.

Returns​

Rect

The component’s bounding box.

Implementation of​

Blockly.IPositionable.getBoundingRectangle


getKeyboardPanStep()​

getKeyboardPanStep(): number;

Defined in: minimap.ts:427

Returns the current keyboard pan step in primary-workspace pixels.

Returns​

number

The pan step in pixels.

Inherited from​

Minimap.getKeyboardPanStep


init()​

init(): void;

Defined in: positioned_minimap.ts:49

Initialize.

Returns​

void

Overrides​

Minimap.init


isFocusEnabled()​

isFocusEnabled(): boolean;

Defined in: minimap.ts:454

Returns whether the focus region is enabled.

Returns​

boolean

True if the focus region is enabled.

Inherited from​

Minimap.isFocusEnabled


position()​

position(metrics, savedPositions): void;

Defined in: positioned_minimap.ts:80

Positions the minimap.

Parameters​

ParameterTypeDescription
metricsUiMetricsThe workspace metrics.
savedPositionsRect[]List of rectangles already on the workspace.

Returns​

void

Implementation of​

Blockly.IPositionable.position


setKeyboardPanStep()​

setKeyboardPanStep(stepPixels): void;

Defined in: minimap.ts:418

Sets how far (in primary-workspace pixels) each arrow keypress pans the workspace when the minimap is focused.

Parameters​

ParameterTypeDescription
stepPixelsnumberPixels to pan per keypress.

Returns​

void

Inherited from​

Minimap.setKeyboardPanStep


minimapToPrimaryCoords()​

static minimapToPrimaryCoords(
primaryMetrics,
minimapMetrics,
offsetX,
offsetY
): [number, number];

Defined in: minimap.ts:270

Converts the coorindates from a mouse event on the minimap into scroll coordinates for the primary viewport.

Parameters​

ParameterTypeDescription
primaryMetricsMetricsThe metrics from the primary workspace.
minimapMetricsMetricsThe metrics from the minimap workspace.
offsetXnumberThe x offset of the mouse event.
offsetYnumberThe y offset of the mouse event.

Returns​

[number, number]

(x, y) primary workspace scroll coordinates.

Inherited from​

Minimap.minimapToPrimaryCoords