Class: PositionedMinimap
Defined in: positioned_minimap.ts:20
A positionable version of minimap that implements IPositionable.
Extends
Implements
IPositionable
Properties index
| Property | Description |
|---|---|
| focusRegion | - |
| height | - |
| id | The 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
| Method | Description |
|---|---|
| disableFocusRegion | Disables the focus region. |
| dispose | Disposes the minimap. Unlinks from all DOM elements and remove all event listeners to prevent memory leaks. |
| enableFocusRegion | Enables the focus region; A highlight of the viewport in the minimap. |
| getBoundingRectangle | Returns the bounding rectangle of the UI element in pixel units relative to the Blockly injection div. |
| getKeyboardPanStep | Returns the current keyboard pan step in primary-workspace pixels. |
| init | Initialize. |
| isFocusEnabled | Returns whether the focus region is enabled. |
| position | Positions the minimap. |
| setKeyboardPanStep | Sets how far (in primary-workspace pixels) each arrow keypress pans the workspace when the minimap is focused. |
| minimapToPrimaryCoords | Converts 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
| Parameter | Type | Description |
|---|---|---|
workspace | WorkspaceSvg | The workspace to mirror. |
Returns
PositionedMinimap
Overrides
Properties
focusRegion
protected focusRegion: FocusRegion | null = null;
Defined in: minimap.ts:40
Inherited from
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
minimapWrapper
protected minimapWrapper: HTMLDivElement | null = null;
Defined in: minimap.ts:44
Inherited from
onMouseDownWrapper
protected onMouseDownWrapper: Data | null = null;
Defined in: minimap.ts:42
Inherited from
onMouseMoveWrapper
protected onMouseMoveWrapper: Data | null = null;
Defined in: minimap.ts:41
Inherited from
onMouseUpWrapper
protected onMouseUpWrapper: Data | null = null;
Defined in: minimap.ts:43
Inherited from
panStep
protected panStep: number = DEFAULT_PAN_STEP;
Defined in: minimap.ts:48
Inherited from
primaryWorkspace
protected primaryWorkspace: WorkspaceSvg;
Defined in: minimap.ts:38
Inherited from
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
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
enableFocusRegion()
enableFocusRegion(): void;
Defined in: minimap.ts:434
Enables the focus region; A highlight of the viewport in the minimap.
Returns
void
Inherited from
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
init()
init(): void;
Defined in: positioned_minimap.ts:49
Initialize.
Returns
void
Overrides
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
position()
position(metrics, savedPositions): void;
Defined in: positioned_minimap.ts:80
Positions the minimap.
Parameters
| Parameter | Type | Description |
|---|---|---|
metrics | UiMetrics | The workspace metrics. |
savedPositions | Rect[] | 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
| Parameter | Type | Description |
|---|---|---|
stepPixels | number | Pixels to pan per keypress. |
Returns
void
Inherited from
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
| Parameter | Type | Description |
|---|---|---|
primaryMetrics | Metrics | The metrics from the primary workspace. |
minimapMetrics | Metrics | The metrics from the minimap workspace. |
offsetX | number | The x offset of the mouse event. |
offsetY | number | The y offset of the mouse event. |
Returns
[number, number]
(x, y) primary workspace scroll coordinates.