Skip to content

API > @blocksuite/blocks > ConnectorElement

Class: ConnectorElement ​

Extends ​

Constructors ​

constructor ​

new ConnectorElement( yMap, options, data = {}): ConnectorElement

Parameters ​

ParameterType
yMapMap< unknown >
optionsobject
options.getGroupParentfunction
options.getLocalRecordfunction
options.onElementUpdatedfunction
options.pickByIdfunction
options.selectionManager?EdgelessSelectionManager
options.setGroupParentfunction
options.updateElementLocalRecordfunction
dataPartial< IConnector >

Returns ​

ConnectorElement

Inherited from ​

SurfaceElement<IConnector>.constructor

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:95

Properties ​

_connectable ​

protected _connectable: boolean = false

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:36

Overrides ​

SurfaceElement._connectable


_path ​

private _path: PointLocation[] = []

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:34


_xywh ​

private _xywh: `[${number},${number},${number},${number}]`

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:35


computedValue ​

computedValue: ComputedValue

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:93

Inherited from ​

SurfaceElement.computedValue


options ​

protected options: object

Type declaration ​

options.getGroupParent ​

getGroupParent: function

Parameters ​
ParameterType
elementstring | EdgelessElement
Returns ​

GroupElement

options.getLocalRecord ​

getLocalRecord: function

Parameters ​
ParameterType
idstring
Returns ​

undefined | IShapeLocalRecord | ISurfaceElementLocalRecord

options.onElementUpdated ​

onElementUpdated: function

Parameters ​
ParameterType
updateobject
update.idstring
update.propsobject
Returns ​

void

options.pickById ​

pickById: function

Parameters ​
ParameterType
idstring
Returns ​

null | EdgelessElement

options.selectionManager ​

optional selectionManager: EdgelessSelectionManager

options.setGroupParent ​

setGroupParent: function

Parameters ​
ParameterType
elementstring | EdgelessElement
groupGroupElement
Returns ​

void

options.updateElementLocalRecord ​

updateElementLocalRecord: function

Parameters ​
ParameterType
idstring
recordRecord< string, unknown >
Returns ​

void

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:70

Inherited from ​

SurfaceElement.options


renderer ​

protected renderer: null | Renderer = null

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:90

Inherited from ​

SurfaceElement.renderer


yMap ​

yMap: Map< unknown >

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:68

Inherited from ​

SurfaceElement.yMap

Accessors ​

absolutePath ​

get absolutePath(): PointLocation[]

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:111


batch ​

get batch(): null | NonNullable< T["batch"] >

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:144

Inherited from ​

SurfaceElement.batch


bezierParameters ​

get bezierParameters(): BezierCurveParameters

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:142


connectable ​

get connectable(): boolean

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:179

Inherited from ​

SurfaceElement.connectable


controllers ​

get controllers(): Controller[]

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:92


frontEndpointStyle ​

get frontEndpointStyle(): ConnectorEndpointStyle

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:96


gridBound ​

get gridBound(): Bound

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:148

Inherited from ​

SurfaceElement.gridBound


h ​

get h(): number

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:170

Inherited from ​

SurfaceElement.h


id ​

get id(): T["id"]

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:114

Inherited from ​

SurfaceElement.id


index ​

get index(): T["index"]

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:119

Inherited from ​

SurfaceElement.index


localRecord ​

get localRecord(): undefined | IShapeLocalRecord | ISurfaceElementLocalRecord

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:175

Inherited from ​

SurfaceElement.localRecord


mode ​

get mode(): ConnectorMode

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:57


path ​

get path(): PointLocation[]

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:39

packages/blocks/src/surface-block/elements/connector/connector-element.ts:43


rearEndpointStyle ​

get rearEndpointStyle(): ConnectorEndpointStyle

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:104


rotate ​

get rotate(): T["rotate"]

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:139

Inherited from ​

SurfaceElement.rotate


rough ​

get rough(): boolean

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:80


roughness ​

get roughness(): number

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:73


seed ​

get seed(): T["seed"]

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:134

Inherited from ​

SurfaceElement.seed


source ​

get source(): Connection

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:88


stroke ​

get stroke(): string

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:65


strokeStyle ​

get strokeStyle(): StrokeStyle

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:69


strokeWidth ​

get strokeWidth(): number

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:61


target ​

get target(): Connection

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:84


type ​

get type(): T["type"]

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:124

Inherited from ​

SurfaceElement.type


w ​

get w(): number

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:165

Inherited from ​

SurfaceElement.w


x ​

get x(): number

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:155

Inherited from ​

SurfaceElement.x


xywh ​

get xywh(): `[${number},${number},${number},${number}]`

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:47

packages/blocks/src/surface-block/elements/connector/connector-element.ts:51

Overrides ​

SurfaceElement.xywh


y ​

get y(): number

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:160

Inherited from ​

SurfaceElement.y

Methods ​

_getArrowOptions ​

private _getArrowOptions(end): ArrowOptions

Parameters ​

ParameterType
endConnectorEndpoint

Returns ​

ArrowOptions

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:260


_renderEndpoint ​

private _renderEndpoint( location, ctx, rc, end, style): void

Parameters ​

ParameterType
locationPointLocation[]
ctxCanvasRenderingContext2D
rcRoughCanvas
endConnectorEndpoint
styleConnectorEndpointStyle

Returns ​

void

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:277


_renderPoints ​

private _renderPoints( ctx, rc, points, dash, curve): void

Parameters ​

ParameterType
ctxCanvasRenderingContext2D
rcRoughCanvas
pointsPointLocation[]
dashboolean
curveboolean

Returns ​

void

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:195


applyUpdate ​

applyUpdate(updates): void

Parameters ​

ParameterType
updatesPartial< IConnector >

Returns ​

void

Inherited from ​

SurfaceElement.applyUpdate

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:187


boxSelect ​

boxSelect(bound): boolean

Parameters ​

ParameterType
boundBound

Returns ​

boolean

Inherited from ​

SurfaceElement.boxSelect

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:59


containedByBounds ​

containedByBounds(bounds): boolean

Parameters ​

ParameterType
boundsBound

Returns ​

boolean

Overrides ​

SurfaceElement.containedByBounds

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:130


deserializeXYWH ​

deserializeXYWH(): XYWH

Returns ​

XYWH

Inherited from ​

SurfaceElement.deserializeXYWH

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:193


getLocalRecord ​

getLocalRecord(): ISurfaceElementLocalRecord

Returns ​

ISurfaceElementLocalRecord

Inherited from ​

SurfaceElement.getLocalRecord

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:183


getNearestPoint ​

getNearestPoint(point): IVec

Parameters ​

ParameterType
pointIVec

Returns ​

IVec

Overrides ​

SurfaceElement.getNearestPoint

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:134


getRelativePointLocation ​

getRelativePointLocation(point): PointLocation

Parameters ​

ParameterType
pointIVec

Returns ​

PointLocation

Overrides ​

SurfaceElement.getRelativePointLocation

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:301


hitTest ​

hitTest( x, y, options?): boolean

Parameters ​

ParameterType
xnumber
ynumber
options?HitTestOptions

Returns ​

boolean

Overrides ​

SurfaceElement.hitTest

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:116


init ​

init(): void

Returns ​

void

Inherited from ​

SurfaceElement.init

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:112


intersectWithLine ​

intersectWithLine(start, end): null | PointLocation[]

Parameters ​

ParameterType
startIVec
endIVec

Returns ​

null | PointLocation[]

Overrides ​

SurfaceElement.intersectWithLine

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:138


mount ​

mount(renderer): void

Parameters ​

ParameterType
rendererRenderer

Returns ​

void

Inherited from ​

SurfaceElement.mount

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:219


render ​

render( ctx, matrix, rc): void

Parameters ​

ParameterType
ctxCanvasRenderingContext2D
matrixDOMMatrix
rcRoughCanvas

Returns ​

void

Overrides ​

SurfaceElement.render

Defined In ​

packages/blocks/src/surface-block/elements/connector/connector-element.ts:147


serialize ​

serialize(): IConnector

Returns ​

IConnector

Inherited from ​

SurfaceElement.serialize

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:197


unmount ​

unmount(): void

Returns ​

void

Inherited from ​

SurfaceElement.unmount

Defined In ​

packages/blocks/src/surface-block/elements/surface-element.ts:225