BlockSuite API Documentation / @blocksuite/blocks / ConnectorElementModel
Class: ConnectorElementModel
Extends
GfxPrimitiveElementModel<ConnectorElementProps>
Constructors
new ConnectorElementModel()
new ConnectorElementModel(
options):ConnectorElementModel
Parameters
• options
• options.id: string
• options.model: SurfaceBlockModel
• options.onChange
• options.stashedStore: Map<unknown, unknown>
• options.yMap: YMap<unknown>
Returns
Inherited from
GfxPrimitiveElementModel<ConnectorElementProps>.constructor
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:68
Properties
_disposable
protected_disposable:DisposableGroup
Inherited from
GfxPrimitiveElementModel._disposable
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:52
_id
protected_id:string
Inherited from
GfxPrimitiveElementModel._id
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:53
_local
protected_local:Map<string|symbol,unknown>
Inherited from
GfxPrimitiveElementModel._local
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:55
_onChange()
protected_onChange: (payload) =>void
Parameters
• payload
• payload.local: boolean
• payload.oldValues: Record<string, unknown>
• payload.props: Record<string, unknown>
Returns
void
Inherited from
GfxPrimitiveElementModel._onChange
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:56
_preserved
protected_preserved:Map<string,unknown>
Used to store a copy of data in the yMap.
Inherited from
GfxPrimitiveElementModel._preserved
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:64
_stashed
protected_stashed:Map<string,unknown>
Inherited from
GfxPrimitiveElementModel._stashed
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:65
surface
surface:
SurfaceBlockModel
Inherited from
GfxPrimitiveElementModel.surface
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:66
updatingPath
updatingPath:
boolean
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:50
yMap
yMap:
YMap<unknown>
Inherited from
GfxPrimitiveElementModel.yMap
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:67
Accessors
absolutePath
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:86
connectable
getconnectable():false
Returns
false
Overrides
GfxPrimitiveElementModel.connectable
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:82
connected
getconnected():boolean
Returns
boolean
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:83
deserializedXYWH
getdeserializedXYWH():XYWH
Returns
XYWH
Inherited from
GfxPrimitiveElementModel.deserializedXYWH
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:91
display
Inherited from
GfxPrimitiveElementModel.display
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:106
elementBound
getelementBound():Bound
The bound of the element after rotation. The bound without rotation should be created by Bound.deserialize(this.xywh).
Returns
Bound
Overrides
GfxPrimitiveElementModel.elementBound
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:84
externalBound
getexternalBound():null|Bound
Returns
null | Bound
Inherited from
GfxPrimitiveElementModel.externalBound
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:97
externalXYWH
Inherited from
GfxPrimitiveElementModel.externalXYWH
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:107
frontEndpointStyle
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:87
group
getgroup():null|GfxGroupLikeElementModel<BaseElementProps>
Returns
null | GfxGroupLikeElementModel<BaseElementProps>
Inherited from
GfxPrimitiveElementModel.group
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:98
groups
getgroups():GfxGroupLikeElementModel<BaseElementProps>[]
Returns
GfxGroupLikeElementModel<BaseElementProps>[]
Inherited from
GfxPrimitiveElementModel.groups
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:99
h
geth():number
Returns
number
Inherited from
GfxPrimitiveElementModel.h
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:100
id
getid():string
Returns
string
Inherited from
GfxPrimitiveElementModel.id
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:101
index
Inherited from
GfxPrimitiveElementModel.index
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:108
isConnected
getisConnected():boolean
Returns
boolean
Inherited from
GfxPrimitiveElementModel.isConnected
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:102
labelConstraints
Defines the size constraints of the label.
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:91
labelDisplay
Control display and hide.
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:95
labelOffset
The offset property specifies the label along the connector path.
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:99
labelStyle
Defines the style of the label.
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:103
labelXYWH
Returns a XYWH array providing information about the size of a label and its position relative to the viewport.
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:108
lableEditing
Local control display and hide, mainly used in editing scenarios.
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:112
mode
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:113
opacity
Inherited from
GfxPrimitiveElementModel.opacity
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:109
path
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:114
rearEndpointStyle
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:115
rotate
Overrides
GfxPrimitiveElementModel.rotate
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:116
rough
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:117
roughness
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:118
seed
Inherited from
GfxPrimitiveElementModel.seed
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:111
source
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:119
stroke
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:120
strokeStyle
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:121
strokeWidth
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:122
target
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:123
text
The content of the label.
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:127
type
gettype():string
Returns
string
Overrides
GfxPrimitiveElementModel.type
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:85
w
getw():number
Returns
number
Inherited from
GfxPrimitiveElementModel.w
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:103
x
getx():number
Returns
number
Inherited from
GfxPrimitiveElementModel.x
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:104
xywh
Overrides
GfxPrimitiveElementModel.xywh
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:128
y
gety():number
Returns
number
Inherited from
GfxPrimitiveElementModel.y
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:105
Methods
containsBound()
containsBound(
bounds):boolean
Parameters
• bounds: Bound
Returns
boolean
Overrides
GfxPrimitiveElementModel.containsBound
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:52
getLineIntersections()
getLineIntersections(
start,end):null|PointLocation[]
Parameters
• start: IVec
• end: IVec
Returns
null | PointLocation[]
Overrides
GfxPrimitiveElementModel.getLineIntersections
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:53
getNearestPoint()
getNearestPoint(
point):IVec
Calculate the closest point on the curve via a point.
Parameters
• point: IVec
Returns
IVec
Overrides
GfxPrimitiveElementModel.getNearestPoint
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:57
getOffsetDistanceByPoint()
getOffsetDistanceByPoint(
point,bounds?):number
Calculating the computed distance along a path via a point.
The point is relative to the viewport.
Parameters
• point: IVec
• bounds?: Bound
Returns
number
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:63
getPointByOffsetDistance()
getPointByOffsetDistance(
offsetDistance?,bounds?):IVec
Calculating the computed point along a path via a offset distance.
Returns a point relative to the viewport.
Parameters
• offsetDistance?: number
• bounds?: Bound
Returns
IVec
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:69
getRelativePointLocation()
getRelativePointLocation(
point):PointLocation
Parameters
• point: IVec
Returns
PointLocation
Overrides
GfxPrimitiveElementModel.getRelativePointLocation
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:70
hasLabel()
hasLabel():
boolean
Returns
boolean
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:71
includesPoint()
includesPoint(
x,y,options?):boolean
Parameters
• x: number
• y: number
• options?: PointTestOptions
Returns
boolean
Overrides
GfxPrimitiveElementModel.includesPoint
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:72
intersectsBound()
intersectsBound(
bound):boolean
Parameters
• bound: Bound
Returns
boolean
Inherited from
GfxPrimitiveElementModel.intersectsBound
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:85
labelIncludesPoint()
labelIncludesPoint(
point):boolean
Parameters
• point: IVec
Returns
boolean
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:73
moveTo()
moveTo(
bound):void
Parameters
• bound: Bound
Returns
void
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:74
onCreated()
onCreated():
void
Returns
void
Inherited from
GfxPrimitiveElementModel.onCreated
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:86
pop()
pop(
prop):void
Parameters
• prop: string
Returns
void
Inherited from
GfxPrimitiveElementModel.pop
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:87
resize()
resize(
bounds,originalPath,matrix):object
Parameters
• bounds: Bound
• originalPath: PointLocation[]
• matrix: DOMMatrix
Returns
object
labelXYWH?
optionallabelXYWH:XYWH
source?
optionalsource:Connection
target?
optionaltarget:Connection
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:75
resizePath()
resizePath(
originalPath,matrix):PointLocation[]
Parameters
• originalPath: PointLocation[]
• matrix: DOMMatrix
Returns
PointLocation[]
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:80
serialize()
serialize():
SerializedConnectorElement
Returns
Overrides
GfxPrimitiveElementModel.serialize
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:81
stash()
stash(
prop):void
Parameters
• prop: string
Returns
void
Inherited from
GfxPrimitiveElementModel.stash
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:89
propsToY()
staticpropsToY(props):ConnectorElementProps
Parameters
• props: ConnectorElementProps
Returns
Overrides
GfxPrimitiveElementModel.propsToY
Defined in
packages/affine/model/dist/elements/connector/connector.d.ts:51