GeoTypeDefinition
Table of contents
Defines the behavior for a custom geo shape type. Register custom geo types via .
interface GeoTypeDefinition {}Properties
defaultSize
optional
Default creation size when clicking (not dragging). Defaults to 200x200.
defaultSize?: {
h: number;
w: number;
};icon
Icon name for the style panel geo picker.
icon: string;snapType
Snap behavior: 'polygon' snaps to vertices + center, 'blobby' snaps to center only.
snapType: "blobby" | "polygon";Methods
getPath
Generate the path geometry for this geo type.
Parameters
| Name | Description |
|---|---|
| The width of the shape (already clamped to min 1) |
| The height of the shape (already clamped to min 1, includes growY) |
| The full geo shape record, for access to props like id, dash, fill, etc. |
| The scaled stroke width (strokeWidth * scale) |
Returns
onDoubleClick
optional
Optional double-click handler. Return an object with partial props to update the shape, or void to do nothing.
Parameters
| Name | Description |
|---|---|
|
Returns
{
props: Partial<TLGeoShape["props"]>;
} | void;Prev
GeoShapeUtilDisplayValuesNext
HighlightShapeOptions