Skip to content
Design System
GitHub

Waypoint editor

v0.64.0, changelogBeta

A robot's route as an ordered list of waypoints, edited in a list and on robot-map together, with actions on arrival, reordering, checks that say why Save is disabled and a read-only mode.

API reference

Generated from the types. Every part also takes className.

WaypointEditor

valuerequired
Waypoint[]The saved route. The editor edits a draft of it; a new value replaces the draft unless it has unsaved changes.
defaultDraft
Waypoint[]A draft to start from instead of value, such as one kept across a reload: it counts as unsaved changes.
defaultSelected
stringThe waypoint selected at first (its id), with its details open.
onSave
(waypoints: Waypoint[]) => void | Promise<unknown>Save: called with the draft. Return a promise to keep Save busy until it settles; a rejection keeps the draft and says so.
onCancel
() => voidCancel: the draft goes back to value (with Undo in a toast), then this is called, e.g. to close the editor.
onDirtyChange
(dirty: boolean) => voidCalled when the draft gains or loses unsaved changes: warn before leaving the page with it.
map
WaypointEditorMapThe plan to draw the route on (robot-map's props). Without it the editor is the list alone.
speed
numberCruise speed in m/s, for the estimated time. Without it only the distance is shown.
minSpacing
number = 0.5Metres a waypoint must be from the one before it. 0.5 by default.
readOnly
booleanFor viewers: the route, the map and the details, without anything that changes them.
createId
() => stringA new waypoint's id. By default one unique to this editor.
labels
Partial<WaypointEditorLabels>
locale
stringFormats numbers (BCP 47, "zh-TW").