@mocanvas/mocanvas · class
declare class GeoShapeUtil extends BaseBoxShapeUtil<GeoShape>This one ships without a description. The signature above is read from the package, and the guides cover the area it belongs to.
Methods · 16
canEdit(_shape: GeoShape): booleancomponent(shape: GeoShape): ReactNodegetDefaultProps(): GeoShapePropsgetEngineGeometry(shape: GeoShape): EngineGeometry | undefinedThe engine has a generator for every built-in geo kind, so a built-in
travels as (kind, w, h, flips) rather than as its vertices. A custom geo
type returns undefined and keeps uploading whatever its getPath builds.
getFontFaces(shape: GeoShape): TLFontFace[]A geo shape needs its family's faces only while it carries a label.
getGeometry(shape: GeoShape): Geometry2dgetGeoTypeDefinition(geo: string): GeoTypeDefinitionThe silhouette for geo, taking this util's customGeoTypes into account.
Falls back to the rectangle so an unknown value still draws something.
getGeoValue(shape: {The geo value this util will actually draw.
props.geo is a *style* prop, and its validator only knows the built-in
silhouettes — so reading it through the style would turn every custom geo
type back into a rectangle before it ever reached the table. A stored value
this util has a definition for is therefore kept as it is; anything else
falls back to the validated style, which is what keeps a value from another
editor's vocabulary drawing something rather than nothing.
getIndicatorPath(shape: GeoShape): Path2DgetRenderStyle(shape: GeoShape): StyleWordsgetText(shape: GeoShape): stringhasOverlayLabel(shape: GeoShape): booleanneedsOverlay(_shape: GeoShape): booleanThe GPU keeps drawing the body while editing; only the label lives in the DOM.
onBeforeCreate(next: GeoShape): GeoShape | voidonBeforeUpdate(prev: GeoShape, next: GeoShape): GeoShape | voidonEditEnd(shape: GeoShape): voidProperties · 5
static migrations: _mocanvas_editor.PropsMigrationsstatic options: GeoShapeOptionsreadonly options: GeoShapeOptionsstatic props: _mocanvas_editor.RecordProps<GeoShape>static type: "geo"mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.