TLGeoUtil
Public Class
Table of Contents
Signature
class TLGeoUtil extends TLBoxUtil<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'
        opacity: '0.1' | '0.25' | '0.5' | '0.75' | '1'
        font: 'draw' | 'mono' | 'sans' | 'serif'
        align: '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
      id: import('@tldraw/tlstore').ID<TLGeoShape>
      typeName: 'shape'
    }
  | undefined
References
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'
        opacity: '0.1' | '0.25' | '0.5' | '0.75' | '1'
        font: 'draw' | 'mono' | 'sans' | 'serif'
        align: '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
      id: import('@tldraw/tlstore').ID<TLGeoShape>
      typeName: 'shape'
    }
  | undefined
References
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
      id: import('@tldraw/tlstore').ID<TLGeoShape>
      typeName: 'shape'
    }
  | {
      props: {
        geo: 'rectangle'
      }
      type: 'geo'
      x: number
      y: number
      rotation: number
      index: string
      parentId: import('@tldraw/tlschema').TLParentId
      isLocked: boolean
      id: import('@tldraw/tlstore').ID<TLGeoShape>
      typeName: 'shape'
    }
  | undefined
References
onEditEnd
Public Property
Signature
onEditEnd: OnEditEndHandler<TLGeoShape>
References
onResize
Public Property
Signature
onResize: OnResizeHandler<TLGeoShape>
References
type
Public Static Property
Signature
static type: string
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