BlockSuite API Documentation / @blocksuite/blocks / GroupElement
Class: GroupElement ​
Contents ​
Extends ​
SurfaceElement
<IGroup
,IGroupLocalRecord
>
Constructors ​
new GroupElement(yMap, options, data) ​
new GroupElement(
yMap
,options
,data
):GroupElement
Parameters ​
• yMap: Map
<unknown
>
• options: Object
• options.getGroupParent: (element
) => GroupElement
• options.getLocalRecord: (id
) => undefined
| CanvasElementLocalRecordValues
• options.onElementUpdated: (update
) => void
• options.pickById: (id
) => null
| EdgelessElement
• options.removeElement: (id
) => void
• options.selectionManager?: EdgelessSelectionManager
• options.setGroupParent: (element
, group
) => void
• options.updateElementLocalRecord: (id
, record
) => void
• data: Partial
<IGroup
>= {}
Returns ​
Inherited from ​
SurfaceElement<IGroup, IGroupLocalRecord>.constructor
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:95
Properties ​
_cachedChildren ​
private
_cachedChildren:string
[] =[]
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:27
_connectable ​
protected
_connectable:boolean
=false
Overrides ​
SurfaceElement._connectable
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:33
_padding ​
private
_padding:number
[]
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:31
_radius ​
private
_radius:number
=0
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:32
_titleHeight ​
private
_titleHeight:number
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:29
_titleWidth ​
private
_titleWidth:number
=0
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:30
computedValue ​
computedValue:
ComputedValue
Inherited from ​
SurfaceElement.computedValue
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:93
options ​
protected
options:Object
Type declaration ​
getGroupParent ​
getGroupParent: (
element
) =>GroupElement
Parameters ​
• element: string
| EdgelessElement
Returns ​
getLocalRecord ​
getLocalRecord: (
id
) =>undefined
|CanvasElementLocalRecordValues
Parameters ​
• id: string
Returns ​
undefined
| CanvasElementLocalRecordValues
onElementUpdated ​
onElementUpdated: (
update
) =>void
Parameters ​
• update: Object
• update.id: string
• update.props: Record
<string
, unknown
>
Returns ​
void
pickById ​
pickById: (
id
) =>null
|EdgelessElement
Parameters ​
• id: string
Returns ​
null
| EdgelessElement
removeElement ​
removeElement: (
id
) =>void
Parameters ​
• id: string
Returns ​
void
selectionManager? ​
selectionManager?:
EdgelessSelectionManager
setGroupParent ​
setGroupParent: (
element
,group
) =>void
Parameters ​
• element: string
• group: GroupElement
Returns ​
void
updateElementLocalRecord ​
updateElementLocalRecord: (
id
,record
) =>void
Parameters ​
• id: string
• record: Record
<string
, unknown
>
Returns ​
void
Inherited from ​
SurfaceElement.options
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:74
renderer ​
protected
renderer:null
|Renderer
=null
Inherited from ​
SurfaceElement.renderer
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:90
yMap ​
yMap:
Map
<unknown
>
Inherited from ​
SurfaceElement.yMap
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:72
Accessors ​
_children ​
get
private
_children():string
[]
Returns ​
string
[]
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:103
batch ​
get
batch():null
|NonNullable
<T
["batch"
]>
Returns ​
null
| NonNullable
<T
["batch"
]>
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:144
childElements ​
get
childElements():EdgelessElement
[]
Returns ​
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:107
children ​
get
children():Map
<boolean
>
Returns ​
Map
<boolean
>
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:99
connectable ​
get
connectable():boolean
Returns ​
boolean
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:179
elementBound ​
get
elementBound():Bound
Returns ​
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:137
h ​
get
h():number
Returns ​
number
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:170
id ​
get
id():T
["id"
]
Returns ​
T
["id"
]
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:114
index ​
get
index():T
["index"
]
Returns ​
T
["index"
]
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:119
localRecord ​
get
localRecord():undefined
|CanvasElementLocalRecordValues
Returns ​
undefined
| CanvasElementLocalRecordValues
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:175
padding ​
get
padding():number
[]
Returns ​
number
[]
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:119
radius ​
get
radius():number
Returns ​
number
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:123
rotate ​
get
rotate():T
["rotate"
]
Returns ​
T
["rotate"
]
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:139
seed ​
get
seed():T
["seed"
]
Returns ​
T
["seed"
]
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:134
title ​
get
title():Text
Returns ​
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:95
titleBound ​
get
titleBound():Bound
Returns ​
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:127
titleHeight ​
get
titleHeight():number
Returns ​
number
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:111
titleWidth ​
get
titleWidth():number
Returns ​
number
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:115
type ​
get
type():T
["type"
]
Returns ​
T
["type"
]
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:124
w ​
get
w():number
Returns ​
number
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:165
x ​
get
x():number
Returns ​
number
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:155
xywh ​
get
xywh(): `[${number},${number},${number},${number}]`
Returns ​
`[${number},${number},${number},${number}]`
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:81
y ​
get
y():number
Returns ​
number
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:160
Methods ​
_renderTitle() ​
private
_renderTitle(ctx
):void
Parameters ​
• ctx: CanvasRenderingContext2D
Returns ​
void
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:166
applyUpdate() ​
applyUpdate(
updates
):void
Parameters ​
• updates: Partial
<IGroup
>
Returns ​
void
Inherited from ​
SurfaceElement.applyUpdate
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:187
boxSelect() ​
boxSelect(
bound
):boolean
Parameters ​
• bound: Bound
Returns ​
boolean
Inherited from ​
SurfaceElement.boxSelect
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:63
containedByBounds() ​
containedByBounds(
bound
):boolean
Parameters ​
• bound: Bound
Returns ​
boolean
Overrides ​
SurfaceElement.containedByBounds
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:35
deserializeXYWH() ​
deserializeXYWH():
XYWH
Returns ​
Inherited from ​
SurfaceElement.deserializeXYWH
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:193
getLocalRecord() ​
getLocalRecord():
IGroupLocalRecord
Returns ​
IGroupLocalRecord
Inherited from ​
SurfaceElement.getLocalRecord
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:183
getNearestPoint() ​
getNearestPoint(
_
):IVec
Parameters ​
• _: IVec
Returns ​
Inherited from ​
SurfaceElement.getNearestPoint
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:54
getRelativePointLocation() ​
getRelativePointLocation(
_
):PointLocation
Parameters ​
• _: IVec
Returns ​
Inherited from ​
SurfaceElement.getRelativePointLocation
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:60
hitTest() ​
hitTest(
x
,y
,_options
?):boolean
Parameters ​
• x: number
• y: number
• _options?: HitTestOptions
Returns ​
boolean
Overrides ​
SurfaceElement.hitTest
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:216
init() ​
init():
void
Returns ​
void
Overrides ​
SurfaceElement.init
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:44
intersectWithLine() ​
intersectWithLine(
start
,end
):null
|PointLocation
[]
Parameters ​
• start: IVec
• end: IVec
Returns ​
null
| PointLocation
[]
Overrides ​
SurfaceElement.intersectWithLine
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:39
mount() ​
mount(
renderer
):void
Parameters ​
• renderer: Renderer
Returns ​
void
Inherited from ​
SurfaceElement.mount
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:219
render() ​
render(
_ctx
,_matrix
,_rc
):void
Parameters ​
• _ctx: CanvasRenderingContext2D
• _matrix: DOMMatrix
• _rc: RoughCanvas
Returns ​
void
Overrides ​
SurfaceElement.render
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:144
serialize() ​
serialize():
IGroup
Returns ​
IGroup
Inherited from ​
SurfaceElement.serialize
Source ​
packages/blocks/src/surface-block/elements/surface-element.ts:197
unmount() ​
unmount():
void
Returns ​
void
Overrides ​
SurfaceElement.unmount
Source ​
packages/blocks/src/surface-block/elements/group/group-element.ts:231
Generated using typedoc-plugin-markdown and TypeDoc