Skip to content

BlockSuite API Documentation / @blocksuite/affine-block-surface / 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/src/managers/connector-manager.ts:839

Properties

_renderer

protected _renderer: null | CanvasRenderer = null

Inherited from

Overlay._renderer

Defined in

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


gfx

protected gfx: GfxController

Inherited from

Overlay.gfx

Defined in

packages/affine/block-surface/src/renderer/overlay.ts:21


highlightPoint

highlightPoint: null | IVec = null

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:831


points

points: IVec[] = []

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:833


sourceBounds

sourceBounds: null | IBound = null

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:835


targetBounds

targetBounds: null | IBound = null

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:837


overlayName

static overlayName: string = 'connection'

Overrides

Overlay.overlayName

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:825

Methods

_clearRect()

_clearRect(): void

Returns

void

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:865


clear()

clear(): void

Returns

void

Overrides

Overlay.clear

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:871


dispose()

dispose(): void

Returns

void

Overrides

Overlay.dispose

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:877


refresh()

refresh(): void

Returns

void

Inherited from

Overlay.refresh

Defined in

packages/affine/block-surface/src/renderer/overlay.ts:42


render()

render(ctx): void

Parameters

ctx

CanvasRenderingContext2D

Returns

void

Overrides

Overlay.render

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:884


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/src/managers/connector-manager.ts:931


setRenderer()

setRenderer(renderer): void

Parameters

renderer

null | CanvasRenderer

Returns

void

Inherited from

Overlay.setRenderer

Defined in

packages/affine/block-surface/src/renderer/overlay.ts:50


setup()

static setup(di): void

Parameters

di

Container

Returns

void

Inherited from

Overlay.setup

Defined in

packages/affine/block-surface/src/renderer/overlay.ts:25