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
Overrides
Defined in
packages/affine/block-surface/dist/managers/connector-manager.d.ts:30
Properties
_renderer
protected
_renderer:null
|CanvasRenderer
Inherited from
Defined in
packages/affine/block-surface/dist/renderer/overlay.d.ts:13
gfx
protected
gfx:GfxController
Inherited from
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
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
Defined in
packages/affine/block-surface/dist/managers/connector-manager.d.ts:33
render()
render(
ctx
):void
Parameters
ctx
CanvasRenderingContext2D
Returns
void
Overrides
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
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
Defined in
packages/affine/block-surface/dist/renderer/overlay.d.ts:18
setup()
static
setup(di
):void
Parameters
di
Container
Returns
void
Inherited from
Defined in
packages/affine/block-surface/dist/renderer/overlay.d.ts:15