GeoShapeUtil
Public Class
Table of Contents
Signature
class GeoShapeUtil extends BaseBoxShapeUtil<TLGeoShape> {}
References
Properties
canEdit
Public Property
Signature
canEdit: () => boolean
onBeforeCreate
Public Property
Signature
onBeforeCreate: (shape: TLGeoShape) =>
| {
props: {
growY: number
geo:
| 'arrow-down'
| 'arrow-left'
| 'arrow-right'
| 'arrow-up'
| 'check-box'
| 'diamond'
| 'ellipse'
| 'hexagon'
| 'octagon'
| 'oval'
| 'pentagon'
| 'rectangle'
| 'rhombus-2'
| 'rhombus'
| 'star'
| 'trapezoid'
| 'triangle'
| 'x-box'
labelColor:
| 'black'
| 'blue'
| 'green'
| 'grey'
| 'light-blue'
| 'light-green'
| 'light-red'
| 'light-violet'
| 'orange'
| 'red'
| 'violet'
| 'yellow'
color:
| 'black'
| 'blue'
| 'green'
| 'grey'
| 'light-blue'
| 'light-green'
| 'light-red'
| 'light-violet'
| 'orange'
| 'red'
| 'violet'
| 'yellow'
fill: 'none' | 'pattern' | 'semi' | 'solid'
dash: 'dashed' | 'dotted' | 'draw' | 'solid'
size: 'l' | 'm' | 's' | 'xl'
font: 'draw' | 'mono' | 'sans' | 'serif'
align: 'end' | 'middle' | 'start'
verticalAlign: 'end' | 'middle' | 'start'
url: string
w: number
h: number
text: string
}
type: 'geo'
x: number
y: number
rotation: number
index: string
parentId: import('@tldraw/tlschema').TLParentId
isLocked: boolean
opacity: number
id: import('@tldraw/tlschema').TLShapeId
typeName: 'shape'
}
| undefined
References
TLGeoShape, TLParentId, TLShapeId
onBeforeUpdate
Public Property
Signature
onBeforeUpdate: (
prev: TLGeoShape,
next: TLGeoShape
) =>
| {
props: {
growY: number
geo:
| 'arrow-down'
| 'arrow-left'
| 'arrow-right'
| 'arrow-up'
| 'check-box'
| 'diamond'
| 'ellipse'
| 'hexagon'
| 'octagon'
| 'oval'
| 'pentagon'
| 'rectangle'
| 'rhombus-2'
| 'rhombus'
| 'star'
| 'trapezoid'
| 'triangle'
| 'x-box'
labelColor:
| 'black'
| 'blue'
| 'green'
| 'grey'
| 'light-blue'
| 'light-green'
| 'light-red'
| 'light-violet'
| 'orange'
| 'red'
| 'violet'
| 'yellow'
color:
| 'black'
| 'blue'
| 'green'
| 'grey'
| 'light-blue'
| 'light-green'
| 'light-red'
| 'light-violet'
| 'orange'
| 'red'
| 'violet'
| 'yellow'
fill: 'none' | 'pattern' | 'semi' | 'solid'
dash: 'dashed' | 'dotted' | 'draw' | 'solid'
size: 'l' | 'm' | 's' | 'xl'
font: 'draw' | 'mono' | 'sans' | 'serif'
align: 'end' | 'middle' | 'start'
verticalAlign: 'end' | 'middle' | 'start'
url: string
w: number
h: number
text: string
}
type: 'geo'
x: number
y: number
rotation: number
index: string
parentId: import('@tldraw/tlschema').TLParentId
isLocked: boolean
opacity: number
id: import('@tldraw/tlschema').TLShapeId
typeName: 'shape'
}
| undefined
References
TLGeoShape, TLParentId, TLShapeId
onDoubleClick
Public Property
Signature
onDoubleClick: (shape: TLGeoShape) =>
| {
props: {
geo: 'check-box'
}
type: 'geo'
x: number
y: number
rotation: number
index: string
parentId: import('@tldraw/tlschema').TLParentId
isLocked: boolean
opacity: number
id: import('@tldraw/tlschema').TLShapeId
typeName: 'shape'
}
| {
props: {
geo: 'rectangle'
}
type: 'geo'
x: number
y: number
rotation: number
index: string
parentId: import('@tldraw/tlschema').TLParentId
isLocked: boolean
opacity: number
id: import('@tldraw/tlschema').TLShapeId
typeName: 'shape'
}
| undefined
References
TLGeoShape, TLParentId, TLShapeId
onEditEnd
Public Property
Signature
onEditEnd: TLOnEditEndHandler<TLGeoShape>
References
TLOnEditEndHandler, TLGeoShape
onResize
Public Property
Signature
onResize: TLOnResizeHandler<TLGeoShape>
References
type
Public Static Property
Signature
static type: 'geo'
Methods
defaultProps()
Public Method
Parameters
None
Returns
TLGeoShape['props']
References
getBounds()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
Box2d
References
getCenter()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
Vec2d
References
getOutline()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
Vec2d[]
References
hitTestLineSegment()
Public Method
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
Returns
boolean
References
hitTestPoint()
Public Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
boolean
References
indicator()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
JSX.Element
References
render()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
JSX.Element
References
toSvg()
Public Method
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
Returns
SVGElement
References
TLGeoShape, TLExportColors, SVGElement