Skip to content

BlockSuite API Documentation / @blocksuite/blocks / ConnectionOverlay

Class: ConnectionOverlay

An overlay is a layer covered on top of elements, can be used for rendering non-CRDT state indicators.

Extends

Constructors

new ConnectionOverlay()

new ConnectionOverlay(gfx): ConnectionOverlay

Parameters

gfx

GfxController

Returns

ConnectionOverlay

Overrides

Overlay.constructor

Defined in

packages/affine/block-surface/dist/managers/connector-manager.d.ts:30

Properties

_renderer

protected _renderer: null | CanvasRenderer

Inherited from

Overlay._renderer

Defined in

packages/affine/block-surface/dist/renderer/overlay.d.ts:13


gfx

protected gfx: GfxController

Inherited from

Overlay.gfx

Defined in

packages/affine/block-surface/dist/renderer/overlay.d.ts:11


highlightPoint

highlightPoint: null | IVec

Defined in

packages/affine/block-surface/dist/managers/connector-manager.d.ts:26


points

points: IVec[]

Defined in

packages/affine/block-surface/dist/managers/connector-manager.d.ts:27


sourceBounds

sourceBounds: null | IBound

Defined in

packages/affine/block-surface/dist/managers/connector-manager.d.ts:28


targetBounds

targetBounds: null | IBound

Defined in

packages/affine/block-surface/dist/managers/connector-manager.d.ts:29


overlayName

static overlayName: string

Overrides

Overlay.overlayName

Defined in

packages/affine/block-surface/dist/managers/connector-manager.d.ts:25

Methods

_clearRect()

_clearRect(): void

Returns

void

Defined in

packages/affine/block-surface/dist/managers/connector-manager.d.ts:32


clear()

clear(): void

Returns

void

Overrides

Overlay.clear

Defined in

packages/affine/block-surface/dist/managers/connector-manager.d.ts:33


refresh()

refresh(): void

Returns

void

Inherited from

Overlay.refresh

Defined in

packages/affine/block-surface/dist/renderer/overlay.d.ts:17


render()

render(ctx): void

Parameters

ctx

CanvasRenderingContext2D

Returns

void

Overrides

Overlay.render

Defined in

packages/affine/block-surface/dist/managers/connector-manager.d.ts:34


renderConnector()

renderConnector(point, excludedIds?): Connection

Render the connector at the given point. It will try to find the closest connectable element and render the connector. If the point is not close to any connectable element, it will just render the connector at the given point.

Parameters

point

IVec

the point to render the connector

excludedIds?

string[]

the ids of the elements that should be excluded

Returns

Connection

the connection result

Defined in

packages/affine/block-surface/dist/managers/connector-manager.d.ts:44


setRenderer()

setRenderer(renderer): void

Parameters

renderer

null | CanvasRenderer

Returns

void

Inherited from

Overlay.setRenderer

Defined in

packages/affine/block-surface/dist/renderer/overlay.d.ts:19


setup()

static setup(di): void

Parameters

di

Container

Returns

void

Inherited from

Overlay.setup

Defined in

packages/affine/block-surface/dist/renderer/overlay.d.ts:15