BlockSuite API Documentation / @blocksuite/blocks / ShapeElementModel
Class: ShapeElementModel
Extends
GfxPrimitiveElementModel
<ShapeProps
>
Constructors
new ShapeElementModel()
new ShapeElementModel(
options
):ShapeElementModel
Parameters
• options
• options.id: string
• options.model: SurfaceBlockModel
• options.onChange
• options.stashedStore: Map
<unknown
, unknown
>
• options.yMap: YMap
<unknown
>
Returns
Inherited from
GfxPrimitiveElementModel<ShapeProps>.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
textBound
textBound:
null
|IBound
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:26
yMap
yMap:
YMap
<unknown
>
Inherited from
GfxPrimitiveElementModel.yMap
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:67
Accessors
color
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:34
connectable
get
connectable():boolean
Returns
boolean
Inherited from
GfxPrimitiveElementModel.connectable
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:90
deserializedXYWH
get
deserializedXYWH():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
get
elementBound():Bound
The bound of the element after rotation. The bound without rotation should be created by Bound.deserialize(this.xywh)
.
Returns
Bound
Inherited from
GfxPrimitiveElementModel.elementBound
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:96
externalBound
get
externalBound():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
fillColor
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:35
filled
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:36
fontFamily
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:37
fontSize
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:38
fontStyle
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:39
fontWeight
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:40
group
get
group():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
get
groups():GfxGroupLikeElementModel
<BaseElementProps
>[]
Returns
GfxGroupLikeElementModel
<BaseElementProps
>[]
Inherited from
GfxPrimitiveElementModel.groups
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:99
h
get
h():number
Returns
number
Inherited from
GfxPrimitiveElementModel.h
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:100
id
get
id():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
get
isConnected():boolean
Returns
boolean
Inherited from
GfxPrimitiveElementModel.isConnected
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:102
maxWidth
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:41
opacity
Inherited from
GfxPrimitiveElementModel.opacity
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:109
padding
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:42
radius
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:43
rotate
Overrides
GfxPrimitiveElementModel.rotate
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:44
roughness
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:45
seed
Inherited from
GfxPrimitiveElementModel.seed
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:111
shadow
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:46
shapeStyle
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:52
shapeType
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:53
strokeColor
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:54
strokeStyle
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:55
strokeWidth
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:56
text
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:57
textAlign
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:58
textDisplay
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:59
textHorizontalAlign
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:60
textResizing
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:61
textVerticalAlign
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:62
type
get
type():string
Returns
string
Overrides
GfxPrimitiveElementModel.type
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:33
w
get
w():number
Returns
number
Inherited from
GfxPrimitiveElementModel.w
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:103
x
get
x():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/shape/shape.d.ts:63
y
get
y():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/shape/shape.d.ts:28
getLineIntersections()
getLineIntersections(
start
,end
):null
|PointLocation
[]
Parameters
• start: IVec
• end: IVec
Returns
null
| PointLocation
[]
Overrides
GfxPrimitiveElementModel.getLineIntersections
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:29
getNearestPoint()
getNearestPoint(
point
):IVec
Parameters
• point: IVec
Returns
IVec
Overrides
GfxPrimitiveElementModel.getNearestPoint
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:30
getRelativePointLocation()
getRelativePointLocation(
point
):PointLocation
Parameters
• point: IVec
Returns
PointLocation
Overrides
GfxPrimitiveElementModel.getRelativePointLocation
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:31
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/shape/shape.d.ts:32
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
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
serialize()
serialize():
SerializedElement
Returns
SerializedElement
Inherited from
GfxPrimitiveElementModel.serialize
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:88
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()
static
propsToY(props
):ShapeProps
Parameters
• props: ShapeProps
Returns
Overrides
GfxPrimitiveElementModel.propsToY
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:27