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/canvas-renderer.d.ts:13


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

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


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/canvas-renderer.d.ts:17