Class: Minimap
Defined in: minimap.ts:37
A minimap is a miniature version of your blocks that appears on top of your main workspace. This gives you an overview of what your code looks like, and how it is organized.
Extended by
Properties index
| Property | Description |
|---|---|
| focusRegion | - |
| minimapWorkspace | - |
| minimapWrapper | - |
| onMouseDownWrapper | - |
| onMouseMoveWrapper | - |
| onMouseUpWrapper | - |
| panStep | - |
| primaryWorkspace | - |
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. |
| getKeyboardPanStep | Returns the current keyboard pan step in primary-workspace pixels. |
| init | Initialize. |
| isFocusEnabled | Returns whether the focus region is enabled. |
| 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 Minimap(workspace): Minimap;
Defined in: minimap.ts:55
Constructor for a minimap.
Parameters
| Parameter | Type | Description |
|---|---|---|
workspace | WorkspaceSvg | The workspace to mirror. |
Returns
Minimap
Properties
focusRegion
protected focusRegion: FocusRegion | null = null;
Defined in: minimap.ts:40
minimapWorkspace
protected minimapWorkspace: WorkspaceSvg | null = null;
Defined in: minimap.ts:39
minimapWrapper
protected minimapWrapper: HTMLDivElement | null = null;
Defined in: minimap.ts:44
onMouseDownWrapper
protected onMouseDownWrapper: Data | null = null;
Defined in: minimap.ts:42
onMouseMoveWrapper
protected onMouseMoveWrapper: Data | null = null;
Defined in: minimap.ts:41
onMouseUpWrapper
protected onMouseUpWrapper: Data | null = null;
Defined in: minimap.ts:43
panStep
protected panStep: number = DEFAULT_PAN_STEP;
Defined in: minimap.ts:48
primaryWorkspace
protected primaryWorkspace: WorkspaceSvg;
Defined in: minimap.ts:38
Methods
disableFocusRegion()
disableFocusRegion(): void;
Defined in: minimap.ts:443
Disables the focus region.
Returns
void
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
enableFocusRegion()
enableFocusRegion(): void;
Defined in: minimap.ts:434
Enables the focus region; A highlight of the viewport in the minimap.
Returns
void
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.
init()
init(): void;
Defined in: minimap.ts:62
Initialize.
Returns
void
isFocusEnabled()
isFocusEnabled(): boolean;
Defined in: minimap.ts:454
Returns whether the focus region is enabled.
Returns
boolean
True if the focus region is enabled.
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
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.