Classes

OrbitImportError

A file that can’t be read as a map at all.

Extends

  • Error

Constructors

Constructor
new OrbitImportError(code, message): OrbitImportError;
Parameters
Parameter Type
code | "empty" | "unknown-format" | "unreadable" | "password-protected" | "too-large"
message string
Returns

OrbitImportError

Overrides
Error.constructor

Properties

code
readonly code: 
  | "empty"
  | "unknown-format"
  | "unreadable"
  | "password-protected"
  | "too-large";

OrbitParseError

Extends

  • Error

Constructors

Constructor
new OrbitParseError(
   message, 
   line, 
   code?
): OrbitParseError;
Parameters
Parameter Type Default value
message string undefined
line number undefined
code | "empty-document" | "no-structure" | "synthetic-root" | "invalid-frontmatter" | "unknown-frontmatter-key" | "unsupported-schema-version" | "format-upgraded" | "invalid-attributes" | "unknown-attribute" | "invalid-option-value" | "media-missing-source" | "unknown-content-type" | "caption-without-media" | "unknown-link-target" | "invalid-yaml" | "unknown-yaml-key" | "ignored-node-entry" | "misnamed-node-key" | "comment-without-orbit" | "attributes-after-list" 'invalid-yaml'
Returns

OrbitParseError

Overrides
Error.constructor

Properties

code
readonly code: 
  | "empty-document"
  | "no-structure"
  | "synthetic-root"
  | "invalid-frontmatter"
  | "unknown-frontmatter-key"
  | "unsupported-schema-version"
  | "format-upgraded"
  | "invalid-attributes"
  | "unknown-attribute"
  | "invalid-option-value"
  | "media-missing-source"
  | "unknown-content-type"
  | "caption-without-media"
  | "unknown-link-target"
  | "invalid-yaml"
  | "unknown-yaml-key"
  | "ignored-node-entry"
  | "misnamed-node-key"
  | "comment-without-orbit"
  | "attributes-after-list";
line
readonly line: number;

OrbitSVGRenderer

Constructors

Constructor
new OrbitSVGRenderer(container, options?): OrbitSVGRenderer;
Parameters
Parameter Type
container HTMLElement
options OrbitRendererOptions
Returns

OrbitSVGRenderer

Methods

addNode()
addNode(
   parentId, 
   input, 
   index?
): OrbitNode | null;

Adds a node under parentId, at index among its children (default: last), with any children it lists under it; it flies out of its parent into place. Ids come from the text, as when the map is read from markdown. Fires edit once. Returns the new node, or null when there’s no such parent. In a map written for a newer format, it throws, changing nothing, where the parent’s ideas are in a form this version can’t read.

Parameters
Parameter Type
parentId string
input OrbitNewNode
index? number
Returns

OrbitNode | null

closeMedia()
closeMedia(): void;

Closes the media viewer, if it’s open (fires media-close).

Returns

void

destroy()
destroy(): void;
Returns

void

editNewNode()
editNewNode(parentId?, index?): boolean;

Adds an idea by typing it on the map: a field opens in the orbit of parentId (default: the node in focus), at index among its children (default: after the last), flying there first. Enter adds the idea where it was typed and opens the next one after it; Escape, or Enter with nothing typed, stops. Fires editor-open, edit for each idea, then editor-close. Returns false when there’s no such node, or when its ideas are hidden (hideChildren): a new one would be typed out of sight, among ideas the page keeps for later, so reveal them first.

Parameters
Parameter Type
parentId? string
index? number
Returns

boolean

editNode()
editNode(id): boolean;

Opens a field over a node to type its text where it is: Enter saves, Escape cancels, and leaving the field saves. A moon, or a node out of view, flies into view first. Fires editor-open, then editor-close. Returns false when there’s no such node.

Parameters
Parameter Type
id string
Returns

boolean

endSpotlight()
endSpotlight(): void;

Takes back the node spotlight brought up close: the camera flies back where it was (or to the view fitted for the room there is now, if that’s where it was), the map brightens, the node’s name and badges come back, and the map takes input again as it lands, when spotlight fires with end. Nothing happens when no node is up close.

Returns

void

fit()
fit(): void;

Returns the camera to the fitted view.

Returns

void

flyTo()
flyTo(id): boolean;

Flies to a node by id, switching to focus mode if needed (fires onFocusChange and onViewModeChange). Returns false when there’s no such node.

Parameters
Parameter Type
id string
Returns

boolean

focusNode()
focusNode(id): boolean;

Focuses a node by id and flies to it (fires onFocusChange). In the overview, the camera moves to the node instead. Returns false when the id isn’t in the map.

Parameters
Parameter Type
id string
Returns

boolean

getDocument()
getDocument(): OrbitDocument | null;

The map as a document: its tree, the options its source set in frontmatter, and the problems found reading it (diagnostics, empty for a bare tree). Edits change this tree in place.

Returns

OrbitDocument | null

getFocusedNode()
getFocusedNode(): OrbitNode | null;

The node focused in focus mode (the sun).

Returns

OrbitNode | null

getFocusPath()
getFocusPath(): string[];

Ids from the root to the focused node.

Returns

string[]

getNodeAt()
getNodeAt(x, y): OrbitNode | null;

The node drawn at a point on the page, in client coordinates (an event’s clientX and clientY): the sun, a planet, a moon, or a node of the overview. A node catches a point a little past its edge, so small moons can be hit, and the most central catch wins. Null where no node is drawn, or outside the map. With setDropTarget, for what’s dragged onto the map from elsewhere, such as text or files.

Parameters
Parameter Type
x number
y number
Returns

OrbitNode | null

getNodeCircle()
getNodeCircle(id): OrbitNodeCircle | null;

Where node id is drawn on screen now: its circle’s center, in px from the map’s top left, and its radius in px. Null when the current view doesn’t draw it.

Parameters
Parameter Type
id string
Returns

OrbitNodeCircle | null

getNodeColor()
getNodeColor(id): string | null;

The color a node is drawn with: its own, its type’s, or its branch’s from the palette and theme. For lists and legends next to the map. A hex color, or the CSS color as written when Orbit can’t read it; null when the id isn’t in the map.

Parameters
Parameter Type
id string
Returns

string | null

getSVGElement()
getSVGElement(): SVGSVGElement;

The map’s <svg> element, inside the container.

Returns

SVGSVGElement

getViewMode()
getViewMode(): OrbitViewMode;
Returns

OrbitViewMode

hideChildren()
hideChildren(ids): boolean;

Hides the ideas under each node ids names, to show later with revealChildren: the next card of a quiz, or the next step of a talk. In the node’s own focus view its orbit keeps a faint place for each of them, in their colors, laid out where they’ll land; elsewhere the node shows as if folded, with a “+N” and no moons. The outline and the media viewer’s gallery leave them out, and the node tells assistive technology how many are hidden. A node in focus has its children shrink into it.

Only the view changes: the map, its toMarkdown() and its events stay as they were, and nothing is edited, so what reads the map itself (prints, renderToSVGString and map tools) reads every idea. A node an edit renames keeps its ideas hidden. Returns whether any node’s ideas were newly hidden; ids not in the map, and nodes with no ideas under them, are left out.

Parameters
Parameter Type
ids string | readonly string[]
Returns

boolean

moveNode()
moveNode(
   id, 
   parentId, 
   index?
): OrbitNode | null;

Moves a node, with everything under it, under parentId at index among its children (default: last). Fires edit. Returns the node, or null when either node is missing, the node is the root, or parentId is inside the node. In a map written for a newer format, it throws, changing nothing, where the parent’s ideas are in a form this version can’t read.

Parameters
Parameter Type
id string
parentId string
index? number
Returns

OrbitNode | null

on()
on<Name>(name, listener): () => void;

Listens for a map event; returns a function that stops listening. The same events are dispatched on the container as orbit-<name> DOM events.

Type Parameters
Type Parameter
Name extends keyof OrbitEventMap
Parameters
Parameter Type
name Name
listener (detail) => void
Returns

() => void

openMedia()
openMedia(nodeId, options?): boolean;

Shows a node’s picture, video or sound in the media viewer, over the whole window, opening it if it’s closed: to show a picture big, or play a video or a sound, from your own controls. A node with more than one shows its picture, then its video, then its sound, unless kind says which, and a video or sound starts playing unless autoplay is false, from the start or startAt seconds in. It opens whatever showMediaViewer, showDetailSheet and interactive say; on a map that isn’t interactive, the viewer takes no input of its own and has no buttons. Fires media-open. Returns false when the map has no such node, or the node no such picture, video or sound.

Parameters
Parameter Type
nodeId string
options OrbitMediaOptions
Returns

boolean

overview()
overview(): void;

Flies out to the overview of the whole map (fires onViewModeChange).

Returns

void

pauseMedia()
pauseMedia(): boolean;

Pauses the video or sound in the media viewer, or settles a live photo’s motion back on its picture. Returns false when it shows none it can pause.

Returns

boolean

playMedia()
playMedia(): boolean;

Plays the video or sound in the media viewer, or a live photo’s motion through once, with its sound. Returns false when it shows none of them, or a video on a site Orbit has no player for. Files, YouTube and Vimeo play.

Returns

boolean

removeNode()
removeNode(id): OrbitNode | null;

Removes a node and everything under it. When the node in focus goes, the nearest node left takes the focus. The root stays. Fires edit. Returns the removed node, or null.

Parameters
Parameter Type
id string
Returns

OrbitNode | null

render()
render(input): void;

Draws a map: markdown or YAML source (parsed forgivingly), a parsed document, or a node tree. A document’s frontmatter options apply, though options given to the renderer win. Drawing a new version of the same map keeps the reader’s place: the focused node, or its closest ancestor that still exists.

Parameters
Parameter Type
input string | OrbitDocument | OrbitNode
Returns

void

revealChildren()
revealChildren(ids?): boolean;

Shows the ideas hideChildren hid under ids, or under every node when none are given: in focus, they grow out of their node to their places with Orbit’s own motion, and the outline lists them again. A node in focus announces them to assistive technology. Returns whether any were shown.

Parameters
Parameter Type
ids? string | readonly string[]
Returns

boolean

seekMedia()
seekMedia(seconds): boolean;

Moves the video or sound in the media viewer to seconds from its start. Returns false when it shows none it can move: a live photo’s motion always plays from its start.

Parameters
Parameter Type
seconds number
Returns

boolean

setDropTarget()
setDropTarget(id): void;

Lights node id up as where something dragged onto the map from elsewhere would go, as a node dragged on the map lights its target: it grows and takes a ring. Null puts it out, as drawing another map does. While a node of the map is being dragged, its own target shows instead.

Parameters
Parameter Type
id string | null
Returns

void

setOptions()
setOptions(options): void;

Changes the options given, which win over the document’s frontmatter as the constructor’s do, and keeps the others: to follow the page’s theme or language, say.

Parameters
Parameter Type
options OrbitRendererOptions
Returns

void

setViewMode()
setViewMode(mode): void;

Switches between focus mode and the overview (fires onViewModeChange).

Parameters
Parameter Type
mode OrbitViewMode
Returns

void

spin()
spin(speed): void;

Flicks the orbit at speed degrees per second; negative speeds turn it counterclockwise. Only in focus mode.

Parameters
Parameter Type
speed number
Returns

void

spotlight()
spotlight(id, options?): boolean;

Brings node id up close, for something of the page’s own to lie over it, such as a surface to draw on: the camera flies until the node fills share of the room insets leave, across, along the room’s shorter side; the rest of the map dims under the sheet’s backdrop; and the node’s name, icon, badges and its type’s content step aside, leaving its color and its picture. While it’s up close the map takes no gestures or keys, nor a press anywhere over it, and the orbit doesn’t drift. The camera holds the node where it lands whatever changes under it, an edit to the node included, and spotlight events say where its circle is on screen (see OrbitSpotlightEvent). endSpotlight takes it back.

Bringing another node up close meanwhile flies there, and the camera still goes back where it was in the end. Returns false when the current view doesn’t draw the node.

Parameters
Parameter Type
id string
options OrbitSpotlightOptions
Returns

boolean

stopEditing()
stopEditing(save?): void;

Closes the field for typing on the map, keeping what was typed unless save is false.

Parameters
Parameter Type Default value
save boolean true
Returns

void

toMarkdown()
toMarkdown(): string;

The map as orbit-md, frontmatter included: what to save after an edit. A map read from markdown comes back as it was written, with only what the edits changed written again, so a file written by hand or by another app keeps its formatting and everything Orbit doesn’t read.

Returns

string

toSVGString()
toSVGString(): string;

The current view as a standalone SVG document: colors resolved, labels as SVG text, nothing that depends on the page’s stylesheet, and ids made from the drawing, so exports of different maps can share a page. It’s the view as it is: ideas hidden with hideChildren stay hidden, and a node in focus keeps their places, as on screen. renderToSVGString has no view to follow, so it draws every idea.

Returns

string

unmount()
static unmount(target): boolean;

Destroys the renderer drawing into target, if there is one. Returns whether there was.

Parameters
Parameter Type
target HTMLElement
Returns

boolean

unmuteMedia()
unmuteMedia(): boolean;

Turns on the sound of the video or sound in the media viewer: a video a browser started muted, say. A live photo’s motion has its sound from then on, its opening included. Browsers allow sound only once the reader has interacted with the page, so call it from a press, such as a “Tap for sound” button’s. Returns false when it shows none it can drive.

Returns

boolean

updateNode()
updateNode(id, changes): OrbitNode | null;

Changes a node’s text or attributes: { text: 'Budget' }, { status: 'done' }, or { color: undefined } to remove one. New text gives the node a new id when its id came from its text and no link points at it, so the saved map needs no id attribute. Fires edit. Returns the node, or null when there’s no such node. In a map written for a newer format, it throws, changing nothing, rather than replace a value this version can’t read.

Parameters
Parameter Type
id string
changes OrbitNodeInput
Returns

OrbitNode | null

zoomBy()
zoomBy(factor): void;

Zooms by factor around the middle of the map (above 1 zooms in).

Parameters
Parameter Type
factor number
Returns

void

Interfaces

OrbitAction

A button under the focused node and in its detail sheet.

Properties

Property Type Description
icon? string The icon: an emoji or short symbol ('✏️'), SVG path data on a 24-unit grid ('M4 20h4L20 8l-4-4L4 16z'), or one of Orbit’s icons ('note', 'link', 'goto', 'image', 'video', 'audio', 'list'). Default: the label’s first letter.
id string Names the action in the action event: event.action === 'assign'.
label string | ((node) => string) The button’s name, read by screen readers, shown as its tooltip and in the detail sheet.
run (node, event) => void Runs when the button is pressed, unless an action listener prevents it.
when? (node) => boolean Which nodes offer the action. Default: every node.

OrbitActionDetail

The action event: call preventDefault() to skip what the button does (the detail sheet, the link, or your action’s run).

Extends

Properties

Property Modifier Type Description Inherited from
action public string & object | OrbitContentAction One of Orbit’s buttons, or the id of one of your actions. OrbitActionEvent.action
defaultPrevented readonly boolean - -
node public OrbitNode - OrbitActionEvent.node
sourceEvent public MouseEvent | KeyboardEvent - OrbitActionEvent.sourceEvent

Methods

preventDefault()
preventDefault(): void;
Returns

void


OrbitActionEvent

A button pressed under the focused node or in its detail sheet.

Extended by

Properties

Property Type Description
action string & object | OrbitContentAction One of Orbit’s buttons, or the id of one of your actions.
node OrbitNode -
sourceEvent MouseEvent | KeyboardEvent -

OrbitAutoRenderOptions

What renderOrbitElement and hydrateOrbitBlocks take: the renderer’s options, over each block’s own, and these.

Extends

Properties

Property Type Description Inherited from
actions? OrbitAction[] Your own buttons under the focused node and in its detail sheet, before the registered ones. OrbitRendererOptions.actions
animation? boolean Keep the orbit turning slowly on its own. OrbitRendererOptions.animation
ariaLabel? string The map’s accessible name. Default: the document’s title. OrbitRendererOptions.ariaLabel
baseUrl? string Resolves relative image, video, sound and link URLs: an http, https or file address, or a relative one, which the page’s address completes. Joined to a base of any other kind, such as javascript:, they’d take its scheme, so they stay relative instead. OrbitRendererOptions.baseUrl
className? string Classes for each map’s container, over its frontmatter’s className. -
editable? boolean Build the map on the map: a + in the orbit adds an idea, typed right in its new planet, and a long press, a right click or F2 edits a node’s text where it is. A node held still, by a long press or the mouse, lifts: drag it onto another node to move it there, or to a place in the orbit to put it there. Default false. OrbitRendererOptions.editable
editingKeys? boolean Keys for building an editable map at speed, as in mind-map apps. On a node with keyboard focus, Tab (or Insert) adds an idea under it, Shift+Enter adds one beside it, and Delete removes it. While typing, Tab keeps what was typed and goes on a level down, under it; with nothing typed, it moves the field under the idea before. Shift+Tab goes on a level up, beside the parent. Tab then stays in the map; Shift+Tab from a node still leaves it. Default false. OrbitRendererOptions.editingKeys
focus? string The node in focus when the map first draws, by id: to open a map where the reader left it. Default: the root. Later renders keep the reader’s place. OrbitRendererOptions.focus
height? number Each map’s height, in px, over its frontmatter’s. Default 420. -
insets? OrbitInsets The parts of the map the page covers with its own controls, such as a toolbar floating over its bottom edge, in px from each edge. Views are fitted into what’s left, and the map still draws under the controls. Changing them moves a fitted view to its new place (see insetsTransition). OrbitRendererOptions.insets
insetsTransition? "instant" | "glide" How the insets a setOptions call brings take effect, for that call alone. By default ('instant') a fitted view is kept within its new room at once, as it has to be while the keyboard slides or a sheet is dragged and the insets change every frame. 'glide' glides it all the way from where it was, with the camera, for a change made once, such as a panel coming or going. OrbitRendererOptions.insetsTransition
interactive? boolean false draws a still picture: no clicks, drags, zoom or keyboard. Default true. OrbitRendererOptions.interactive
language? string The language of the map’s controls, sheets and announcements: a BCP 47 tag such as es or pt-BR. Default: the language the map’s element is in (the closest lang attribute), then English. Orbit speaks English, Spanish and Brazilian Portuguese; registerLanguage adds others. OrbitRendererOptions.language
longPressDelay? number How long (ms) a finger or pen holds still on a node before it counts as a long press (see onNodeContext). Default 500; apps can pass their platform’s own, such as Android’s 400. OrbitRendererOptions.longPressDelay
maxDepth? number Levels below the root to render (1 = root + direct children). OrbitRendererOptions.maxDepth
mediaViewer? boolean Deprecated Use showMediaViewer, named as showRings and the other switches are: this name goes in Orbit 1.0. OrbitRendererOptions.mediaViewer
nodeTypeFor? (node) => string | undefined The type a node that names none is drawn as, for display only: as if it said type: name, with that type’s look, content and actions. Orbit never writes it to the map, and asks again whenever it draws; return undefined to draw the node as it is. Called often: keep it quick. OrbitRendererOptions.nodeTypeFor
nodeTypes? Record<string, OrbitNodeType> Node types by name: what nodes with type: name look like, draw inside them, show in the detail sheet and offer as actions. They come before the ones registered with registerNodeType. OrbitRendererOptions.nodeTypes
noteRenderer? (note, context) => string Renders a note to HTML yourself. The HTML is used as-is: sanitize untrusted notes. OrbitRendererOptions.noteRenderer
onAction? (event) => false | void A button was pressed. Return false to skip what it does (the detail sheet, the link, or your action’s run). OrbitRendererOptions.onAction
onEdit? (edit) => void The map was edited with addNode, updateNode, removeNode or moveNode; save renderer.toMarkdown() to keep it. OrbitRendererOptions.onEdit
onEditorClose? (event) => void The field for typing on the map closed. OrbitRendererOptions.onEditorClose
onEditorOpen? (event) => void The field for typing on the map opened. OrbitRendererOptions.onEditorOpen
onFileOpen? (event) => false | void One of a node’s files was opened in the detail sheet. Return false to open it your way instead of in a new tab. OrbitRendererOptions.onFileOpen
onFocusChange? (node, path) => void A new node is in focus, with the path from the root to it, as focus-change has them. OrbitRendererOptions.onFocusChange
onMediaClose? (event) => void The media viewer closed. OrbitRendererOptions.onMediaClose
onMediaOpen? (event) => void The media viewer opened, or stepped to another picture, video or sound. OrbitRendererOptions.onMediaOpen
onMediaState? (state) => void The video, sound or live photo’s motion in the media viewer started, paused, moved on, ended or was muted; while it plays, its time a few times a second. OrbitRendererOptions.onMediaState
onNodeClick? (node) => void A node was clicked or activated with the keyboard, before the map reacts. OrbitRendererOptions.onNodeClick
onNodeContext? (event) => void A node was long-pressed, right-clicked or chosen with the context menu key: show a menu of things to do with it at (x, y). With this callback or a node-context listener, the press is yours: it doesn’t open the node, and the browser’s own menu stays closed. OrbitRendererOptions.onNodeContext
onNodeDrag? (event) => void A node is dragged somewhere else (see editable and the node-drag event). OrbitRendererOptions.onNodeDrag
onSpinSettle? (node) => void Called when a flicked orbit comes to rest, with the planet nearest the top. OrbitRendererOptions.onSpinSettle
onSpotlight? (event) => void A node spotlight brought up close moved on screen, came to rest there, or is back in its place. OrbitRendererOptions.onSpotlight
onViewModeChange? (mode) => void - OrbitRendererOptions.onViewModeChange
openFiles? boolean Whether the detail sheet opens a node’s files: with false it lists them, each with its name, kind and size, and says they stayed with the map, as in a web page made without them. Default true. OrbitRendererOptions.openFiles
orbitAnimation? boolean Deprecated Use animation, as a document writes it: this name goes in Orbit 1.0. OrbitRendererOptions.orbitAnimation
orbitSpeed? number Deprecated Use speed, as a document writes it: this name goes in Orbit 1.0. OrbitRendererOptions.orbitSpeed
palette? string[] Node colors: the first for the root, then one per top-level branch (cycling). Default: the theme’s. OrbitRendererOptions.palette
selector? string The blocks hydrateOrbitBlocks brings to life, as a CSS selector. Default: the marked extension’s placeholders, orbit code blocks and <orbit-map> elements. -
showActionButtons? boolean Buttons under the focused node for its note, media, link and actions. Default true. OrbitRendererOptions.showActionButtons
showControls? boolean Breadcrumbs, the view switch, the list button and zoom buttons. Default true. OrbitRendererOptions.showControls
showDetailSheet? boolean Open the built-in detail sheet for notes, embeds and the details of a node’s type. Default true. OrbitRendererOptions.showDetailSheet
showMediaViewer? boolean Show pictures, videos and sounds in the media viewer, over the whole window: “View picture”, “Play video” and “Play sound” open it, and so do the detail sheet’s pictures and its videos’ and sounds’ Expand buttons. Default true. With false, those buttons open the detail sheet instead (unless showDetailSheet is false too), whose videos and sounds then have no Expand button. openMedia opens the viewer either way. OrbitRendererOptions.showMediaViewer
showRings? boolean Draw the dashed orbit rings. Default true. OrbitRendererOptions.showRings
speed? number Seconds per turn of animation’s drift: bigger is slower. Default 90. OrbitRendererOptions.speed
spin? OrbitSpinOptions How a flicked orbit spins. OrbitRendererOptions.spin
statuses? Record<string, OrbitStatusStyle> Status words and how they look: a dot tone (active, done, blocked, todo, neutral) or any CSS color, as in { review: 'active', 'on hold': '#A855F7' }. OrbitRendererOptions.statuses
strict? boolean Show the error card on the first problem in a block’s source instead of working around it. -
strings? Partial<OrbitStrings> Words to change on this map only, over its language’s: { zoomIn: 'Closer' }. OrbitRendererOptions.strings
theme? | OrbitThemePreset | OrbitRendererTheme | string & object A theme name ('night', 'cosmos', or one registered with registerTheme) or a theme object. An object without a preset keeps the document’s theme and changes the tokens it names. OrbitRendererOptions.theme
transitionDuration? number | "auto" Navigation flight length in milliseconds, or auto to scale with the distance travelled. OrbitRendererOptions.transitionDuration
view? OrbitViewMode The first view: focus (default) or all, the overview. OrbitRendererOptions.view
viewMode? OrbitViewMode Deprecated Use view, as a document writes it: this name goes in Orbit 1.0. OrbitRendererOptions.viewMode
zoom? OrbitZoomOptions How the wheel, trackpads and pinches zoom. OrbitRendererOptions.zoom

OrbitDiagnostic

Properties

Property Type Description
code | "empty-document" | "no-structure" | "synthetic-root" | "invalid-frontmatter" | "unknown-frontmatter-key" | "unsupported-schema-version" | "format-upgraded" | "invalid-attributes" | "unknown-attribute" | "invalid-option-value" | "media-missing-source" | "unknown-content-type" | "caption-without-media" | "unknown-link-target" | "invalid-yaml" | "unknown-yaml-key" | "ignored-node-entry" | "misnamed-node-key" | "comment-without-orbit" | "attributes-after-list" -
line? number 1-based line in the source passed to the parser, when known.
message string -
severity OrbitDiagnosticSeverity -

OrbitDocument

A parsed map: its tree, its options and the problems the parser worked around.

Properties

Property Type Description
diagnostics? OrbitDiagnostic[] The same problems with a code, line and severity. Always set on parse results, and on a map’s getDocument().
extra? Record<string, unknown> Frontmatter or top-level YAML keys Orbit doesn’t read (another app’s, or a newer Orbit’s), as written. Both serializers write them back, so nothing a document says is lost by reading and saving it.
options OrbitDocumentOptions -
root OrbitNode -
warnings string[] Problems the parser recovered from, one line each (“Line 4: …”).

OrbitDocumentOptions

Options a document sets in its frontmatter (markdown) or top-level keys (YAML).

Properties

Property Type Description
animation? boolean Keep the orbit turning slowly on its own.
baseUrl? string Where the map’s relative addresses resolve from: a web address (http or https) or a relative path; others are reported and ignored.
className? string -
height? number Height in pixels, used by <orbit-map> elements and marked placeholders.
interactive? boolean -
maxDepth? number -
orbitAnimation? boolean Deprecated Use animation, as the document writes it: this name goes in Orbit 1.0.
orbitSpeed? number Deprecated Use speed, as the document writes it: this name goes in Orbit 1.0.
palette? string[] -
schemaVersion? number The format version the document is written for.
showRings? boolean -
speed? number Seconds per turn of the orbit’s drift.
theme? string A theme name, as written (unknown names are reported and ignored).
title? string The map’s accessible name and SVG title.
view? OrbitViewMode The first view: focus or all, the overview.
viewMode? OrbitViewMode Deprecated Use view, as the document writes it: this name goes in Orbit 1.0.

OrbitDue

An idea’s date, as Orbit reads its due attribute: a day, and a time of day when it has one.

Properties

Property Type Description
day number From 1 to the month’s last day.
hours? number The hour, from 0 to 23, when the date has a time.
minutes? number The minutes past the hour, when the date has a time.
month number From 1 (January) to 12.
year number -

OrbitEdit

An edit to the map, as the edit event and onEdit report it.

Properties

Property Type Description
kind "remove" | "move" | "add" | "update" -
node OrbitNode The node added, changed, removed or moved.
tree OrbitNode The whole tree after the edit. renderer.toMarkdown() writes it as orbit-md.

OrbitEditorEvent

The field for typing a node’s text on the map (see editable, editNode and editNewNode).

Properties

Property Type Description
node OrbitNode | null The node whose text is typed, or null for a new idea.
parent OrbitNode | null For a new idea, the node it goes under.

OrbitEventMap

What a map reports, by event name. Listen with renderer.on(name, listener), or for orbit-<name> DOM events, which bubble from the map’s container (and out of <orbit-map>).

Properties

Property Type Description
action OrbitActionDetail A content button under the focused node was pressed.
edit OrbitEdit The map was edited with addNode, updateNode, removeNode or moveNode.
editor-close OrbitEditorEvent The field for typing on the map closed.
editor-open OrbitEditorEvent The field for typing on the map opened: on a node, or in the orbit for a new idea.
file-open OrbitFileOpenDetail One of a node’s files was opened in the detail sheet. Without preventDefault(), the browser opens its address in a new tab: an app that keeps the files itself takes the press and opens the file its way.
focus-change object The focused node changed. path runs from the root to node.
focus-change.node OrbitNode -
focus-change.path OrbitNode[] -
media-close OrbitMediaEvent The media viewer closed.
media-open OrbitMediaEvent The media viewer opened, or stepped to another picture, video or sound.
media-state OrbitMediaState The video, sound or live photo’s motion in the media viewer started, paused, moved on, ended or was muted; while it plays, its time a few times a second.
node-click object A node was clicked or activated with the keyboard, before the map reacts.
node-click.node OrbitNode -
node-context OrbitNodeContextEvent A node was long-pressed, right-clicked, or chosen with the context menu key: the place for a menu of things to do with it. A DOM listener calls preventDefault() to take the press (see onNodeContext).
node-drag OrbitNodeDragEvent A node is dragged somewhere else on an editable map: lifted, carried over a place, or let go (see phase).
spin-settle object A spun orbit came to rest, with node on top.
spin-settle.node OrbitNode -
spin-settle.planet OrbitNode Deprecated Use node, as every other event names it: planet goes in Orbit 1.0.
spotlight OrbitSpotlightEvent A node spotlight brought up close moved on screen, came to rest there, or is back in its place (see phase).
view-mode-change object The map switched between focus mode and the overview.
view-mode-change.mode OrbitViewMode -

OrbitFile

A file an idea holds (see OrbitNode.files). Written media/report.pdf, or with what Orbit shows of it without opening it: { src: media/report.pdf, name: Q3 report.pdf, type: application/pdf, size: 482133 }.

Properties

Property Type Description
name? string Its name as people know it, which its address may not keep. Without one, the last part of its address.
size? number How big it is, in bytes.
src string Its address: relative ones resolve against baseUrl, as every media address does.
type? string Its media type, such as application/pdf. Without one, its kind comes from its name’s extension.

OrbitFileOpenDetail

The file-open event: call preventDefault() to open the file your way, instead of in a new tab.

Extends

Properties

Property Modifier Type Description Inherited from
defaultPrevented readonly boolean - -
file public OrbitFile The file, as the node has it. OrbitFileOpenEvent.file
index public number Its place among the node’s files, from 0. OrbitFileOpenEvent.index
node public OrbitNode - OrbitFileOpenEvent.node
sourceEvent public MouseEvent | KeyboardEvent - OrbitFileOpenEvent.sourceEvent

Methods

preventDefault()
preventDefault(): void;
Returns

void


OrbitFileOpenEvent

One of a node’s files opened in the detail sheet.

Extended by

Properties

Property Type Description
file OrbitFile The file, as the node has it.
index number Its place among the node’s files, from 0.
node OrbitNode -
sourceEvent MouseEvent | KeyboardEvent -

OrbitImport

What reading another app’s file gives.

Properties

Property Type Description
format OrbitImportFormat -
maps OrbitImportedMap[] The file’s maps: one, or one for each sheet of an XMind workbook.

OrbitImportedMap

One map read from another app’s file.

Properties

Property Type Description
document OrbitDocument -
media Record<string, Uint8Array> Pictures from inside the file, by the address the map gives them: media/sunrise.png. Save them next to the map.
warnings OrbitImportWarning[] What the other app had that Orbit keeps another way, or couldn’t keep.

OrbitImportOptions

Properties

Property Type Description
format? OrbitImportFormat The file’s format, when you know it. Default: from the name, then from what the file holds.
name? string The file’s name: its extension tells the format, and a map with no single center is named after it.
untitled? string The name of the center Orbit adds to a map with several top ideas and nothing to name it after. Default “Untitled map”.

OrbitImportWarning

Something the other app’s map had that Orbit keeps another way, or can’t keep.

Properties

Property Type Description
code | "floating-ideas-moved" | "summaries-moved" | "callouts-moved" | "boundaries-in-notes" | "links-in-notes" | "missing-link-targets" | "icons-not-kept" | "pictures-not-kept" | "attachments-not-kept" | "local-links-not-kept" | "encrypted-branches-not-read" | "formatting-not-kept" -
count number How many places in the map it’s about.
message string -

OrbitInsets

Room the page’s own controls take at the map’s edges, in px (see OrbitRendererOptions.insets).

Properties

Property Type
bottom? number
left? number
right? number
top? number

OrbitMapElement

The <orbit-map> element’s API, for code that holds a reference to one. It also dispatches the map’s events (orbit-focus-change, orbit-view-mode-change, orbit-node-click, orbit-action, orbit-spin-settle, orbit-media-open, orbit-media-close, orbit-media-state and the rest) and orbit-error.

Extends

  • HTMLElement

Properties

Property Modifier Type Description
renderer readonly OrbitSVGRenderer | null The renderer drawing the map, or null before the first render or after an error.
source public string The markdown or YAML the map is drawn from. Setting it updates the source attribute.

Methods

closeMedia()
closeMedia(): void;

Closes the media viewer.

Returns

void

endSpotlight()
endSpotlight(): void;

Takes the node spotlight brought up close back to its place.

Returns

void

flyTo()
flyTo(nodeId): boolean;

Flies to a node by id, in focus mode. Returns false when the map has no such node.

Parameters
Parameter Type
nodeId string
Returns

boolean

getNodeCircle()
getNodeCircle(nodeId): OrbitNodeCircle | null;

Where a node is drawn on screen now (see OrbitSVGRenderer.getNodeCircle), or null.

Parameters
Parameter Type
nodeId string
Returns

OrbitNodeCircle | null

hideChildren()
hideChildren(ids): boolean;

Hides the ideas under nodes, to show later (see OrbitSVGRenderer.hideChildren). Returns whether any were newly hidden.

Parameters
Parameter Type
ids string | readonly string[]
Returns

boolean

openMedia()
openMedia(nodeId, options?): boolean;

Shows a node’s picture, video or sound in the media viewer (see OrbitSVGRenderer.openMedia). Returns false when there’s nothing to show.

Parameters
Parameter Type
nodeId string
options? OrbitMediaOptions
Returns

boolean

overview()
overview(): void;

Flies out to the overview of the whole map.

Returns

void

pauseMedia()
pauseMedia(): boolean;

Pauses the video or sound in the media viewer. Returns false when it shows none it can pause.

Returns

boolean

playMedia()
playMedia(): boolean;

Plays the video or sound in the media viewer. Returns false when it shows none it can play.

Returns

boolean

refresh()
refresh(): void;

Re-reads the source and redraws the map, keeping the reader’s place when it can.

Returns

void

revealChildren()
revealChildren(ids?): boolean;

Shows ideas hidden under ids, or under every node (see OrbitSVGRenderer.revealChildren). Returns whether any were shown.

Parameters
Parameter Type
ids? string | readonly string[]
Returns

boolean

seekMedia()
seekMedia(seconds): boolean;

Moves the video or sound in the media viewer to seconds from its start. Returns false when it shows none it can move.

Parameters
Parameter Type
seconds number
Returns

boolean

spotlight()
spotlight(nodeId, options?): boolean;

Brings a node up close, for something of the page’s own to lie over it (see OrbitSVGRenderer.spotlight). Returns false when the view doesn’t draw it.

Parameters
Parameter Type
nodeId string
options? OrbitSpotlightOptions
Returns

boolean

unmuteMedia()
unmuteMedia(): boolean;

Turns on the sound of the video or sound in the media viewer, from a press. Returns false when it shows none it can drive.

Returns

boolean


OrbitMapOptions

What createOrbitMap takes: the renderer’s options, and strict.

Extends

Properties

Property Type Description Inherited from
actions? OrbitAction[] Your own buttons under the focused node and in its detail sheet, before the registered ones. OrbitRendererOptions.actions
animation? boolean Keep the orbit turning slowly on its own. OrbitRendererOptions.animation
ariaLabel? string The map’s accessible name. Default: the document’s title. OrbitRendererOptions.ariaLabel
baseUrl? string Resolves relative image, video, sound and link URLs: an http, https or file address, or a relative one, which the page’s address completes. Joined to a base of any other kind, such as javascript:, they’d take its scheme, so they stay relative instead. OrbitRendererOptions.baseUrl
editable? boolean Build the map on the map: a + in the orbit adds an idea, typed right in its new planet, and a long press, a right click or F2 edits a node’s text where it is. A node held still, by a long press or the mouse, lifts: drag it onto another node to move it there, or to a place in the orbit to put it there. Default false. OrbitRendererOptions.editable
editingKeys? boolean Keys for building an editable map at speed, as in mind-map apps. On a node with keyboard focus, Tab (or Insert) adds an idea under it, Shift+Enter adds one beside it, and Delete removes it. While typing, Tab keeps what was typed and goes on a level down, under it; with nothing typed, it moves the field under the idea before. Shift+Tab goes on a level up, beside the parent. Tab then stays in the map; Shift+Tab from a node still leaves it. Default false. OrbitRendererOptions.editingKeys
focus? string The node in focus when the map first draws, by id: to open a map where the reader left it. Default: the root. Later renders keep the reader’s place. OrbitRendererOptions.focus
insets? OrbitInsets The parts of the map the page covers with its own controls, such as a toolbar floating over its bottom edge, in px from each edge. Views are fitted into what’s left, and the map still draws under the controls. Changing them moves a fitted view to its new place (see insetsTransition). OrbitRendererOptions.insets
insetsTransition? "instant" | "glide" How the insets a setOptions call brings take effect, for that call alone. By default ('instant') a fitted view is kept within its new room at once, as it has to be while the keyboard slides or a sheet is dragged and the insets change every frame. 'glide' glides it all the way from where it was, with the camera, for a change made once, such as a panel coming or going. OrbitRendererOptions.insetsTransition
interactive? boolean false draws a still picture: no clicks, drags, zoom or keyboard. Default true. OrbitRendererOptions.interactive
language? string The language of the map’s controls, sheets and announcements: a BCP 47 tag such as es or pt-BR. Default: the language the map’s element is in (the closest lang attribute), then English. Orbit speaks English, Spanish and Brazilian Portuguese; registerLanguage adds others. OrbitRendererOptions.language
longPressDelay? number How long (ms) a finger or pen holds still on a node before it counts as a long press (see onNodeContext). Default 500; apps can pass their platform’s own, such as Android’s 400. OrbitRendererOptions.longPressDelay
maxDepth? number Levels below the root to render (1 = root + direct children). OrbitRendererOptions.maxDepth
mediaViewer? boolean Deprecated Use showMediaViewer, named as showRings and the other switches are: this name goes in Orbit 1.0. OrbitRendererOptions.mediaViewer
nodeTypeFor? (node) => string | undefined The type a node that names none is drawn as, for display only: as if it said type: name, with that type’s look, content and actions. Orbit never writes it to the map, and asks again whenever it draws; return undefined to draw the node as it is. Called often: keep it quick. OrbitRendererOptions.nodeTypeFor
nodeTypes? Record<string, OrbitNodeType> Node types by name: what nodes with type: name look like, draw inside them, show in the detail sheet and offer as actions. They come before the ones registered with registerNodeType. OrbitRendererOptions.nodeTypes
noteRenderer? (note, context) => string Renders a note to HTML yourself. The HTML is used as-is: sanitize untrusted notes. OrbitRendererOptions.noteRenderer
onAction? (event) => false | void A button was pressed. Return false to skip what it does (the detail sheet, the link, or your action’s run). OrbitRendererOptions.onAction
onEdit? (edit) => void The map was edited with addNode, updateNode, removeNode or moveNode; save renderer.toMarkdown() to keep it. OrbitRendererOptions.onEdit
onEditorClose? (event) => void The field for typing on the map closed. OrbitRendererOptions.onEditorClose
onEditorOpen? (event) => void The field for typing on the map opened. OrbitRendererOptions.onEditorOpen
onFileOpen? (event) => false | void One of a node’s files was opened in the detail sheet. Return false to open it your way instead of in a new tab. OrbitRendererOptions.onFileOpen
onFocusChange? (node, path) => void A new node is in focus, with the path from the root to it, as focus-change has them. OrbitRendererOptions.onFocusChange
onMediaClose? (event) => void The media viewer closed. OrbitRendererOptions.onMediaClose
onMediaOpen? (event) => void The media viewer opened, or stepped to another picture, video or sound. OrbitRendererOptions.onMediaOpen
onMediaState? (state) => void The video, sound or live photo’s motion in the media viewer started, paused, moved on, ended or was muted; while it plays, its time a few times a second. OrbitRendererOptions.onMediaState
onNodeClick? (node) => void A node was clicked or activated with the keyboard, before the map reacts. OrbitRendererOptions.onNodeClick
onNodeContext? (event) => void A node was long-pressed, right-clicked or chosen with the context menu key: show a menu of things to do with it at (x, y). With this callback or a node-context listener, the press is yours: it doesn’t open the node, and the browser’s own menu stays closed. OrbitRendererOptions.onNodeContext
onNodeDrag? (event) => void A node is dragged somewhere else (see editable and the node-drag event). OrbitRendererOptions.onNodeDrag
onSpinSettle? (node) => void Called when a flicked orbit comes to rest, with the planet nearest the top. OrbitRendererOptions.onSpinSettle
onSpotlight? (event) => void A node spotlight brought up close moved on screen, came to rest there, or is back in its place. OrbitRendererOptions.onSpotlight
onViewModeChange? (mode) => void - OrbitRendererOptions.onViewModeChange
openFiles? boolean Whether the detail sheet opens a node’s files: with false it lists them, each with its name, kind and size, and says they stayed with the map, as in a web page made without them. Default true. OrbitRendererOptions.openFiles
orbitAnimation? boolean Deprecated Use animation, as a document writes it: this name goes in Orbit 1.0. OrbitRendererOptions.orbitAnimation
orbitSpeed? number Deprecated Use speed, as a document writes it: this name goes in Orbit 1.0. OrbitRendererOptions.orbitSpeed
palette? string[] Node colors: the first for the root, then one per top-level branch (cycling). Default: the theme’s. OrbitRendererOptions.palette
showActionButtons? boolean Buttons under the focused node for its note, media, link and actions. Default true. OrbitRendererOptions.showActionButtons
showControls? boolean Breadcrumbs, the view switch, the list button and zoom buttons. Default true. OrbitRendererOptions.showControls
showDetailSheet? boolean Open the built-in detail sheet for notes, embeds and the details of a node’s type. Default true. OrbitRendererOptions.showDetailSheet
showMediaViewer? boolean Show pictures, videos and sounds in the media viewer, over the whole window: “View picture”, “Play video” and “Play sound” open it, and so do the detail sheet’s pictures and its videos’ and sounds’ Expand buttons. Default true. With false, those buttons open the detail sheet instead (unless showDetailSheet is false too), whose videos and sounds then have no Expand button. openMedia opens the viewer either way. OrbitRendererOptions.showMediaViewer
showRings? boolean Draw the dashed orbit rings. Default true. OrbitRendererOptions.showRings
speed? number Seconds per turn of animation’s drift: bigger is slower. Default 90. OrbitRendererOptions.speed
spin? OrbitSpinOptions How a flicked orbit spins. OrbitRendererOptions.spin
statuses? Record<string, OrbitStatusStyle> Status words and how they look: a dot tone (active, done, blocked, todo, neutral) or any CSS color, as in { review: 'active', 'on hold': '#A855F7' }. OrbitRendererOptions.statuses
strict? boolean Throw on the first problem in the source instead of working around it. -
strings? Partial<OrbitStrings> Words to change on this map only, over its language’s: { zoomIn: 'Closer' }. OrbitRendererOptions.strings
theme? | OrbitThemePreset | OrbitRendererTheme | string & object A theme name ('night', 'cosmos', or one registered with registerTheme) or a theme object. An object without a preset keeps the document’s theme and changes the tokens it names. OrbitRendererOptions.theme
transitionDuration? number | "auto" Navigation flight length in milliseconds, or auto to scale with the distance travelled. OrbitRendererOptions.transitionDuration
view? OrbitViewMode The first view: focus (default) or all, the overview. OrbitRendererOptions.view
viewMode? OrbitViewMode Deprecated Use view, as a document writes it: this name goes in Orbit 1.0. OrbitRendererOptions.viewMode
zoom? OrbitZoomOptions How the wheel, trackpads and pinches zoom. OrbitRendererOptions.zoom

OrbitMapToolResult

What a tool call did, to send back to the model.

Properties

Property Type Description
changed boolean Whether the map changed.
ok boolean False when the call couldn’t be carried out: nothing changed, and text says why and what to send instead.
text string What happened, for the model, with the ids to use next.

OrbitMapTools

Map tools for one map (see createMapTools).

Properties

Property Modifier Type Description
definitions readonly OrbitMapToolDefinition[] The tools: name, description, input as JSON Schema, and hints. The shape MCP takes, and the data for any other.
document readonly OrbitDocument | null The map as it is now. Edits change it in place.
instructions readonly string How to use the tools, to add to the model’s system prompt.

Methods

for()
for<Provider>(provider): OrbitMapToolFormats[Provider];

The tools in the shape a provider’s API takes: anthropic, openai (Responses), openai-chat (Chat Completions, and most other providers) or gemini.

Type Parameters
Type Parameter
Provider extends keyof OrbitMapToolFormats
Parameters
Parameter Type
provider Provider
Returns

OrbitMapToolFormats[Provider]

run()
run(name, input?): OrbitMapToolResult;

Carries out a tool call: its name, and its input as an object or as the JSON text OpenAI sends. Never throws for a call a model gets wrong: the result says what went wrong instead.

Parameters
Parameter Type
name string
input? unknown
Returns

OrbitMapToolResult


OrbitMapToolsOptions

Properties

Property Type Description
readLimit? number The most nodes read_map shows at once; a bigger map is cut short, whole levels first. Default 250.
readOnly? boolean Offer only the tools that read the map, for an assistant that answers questions about it. Default false.

OrbitMaterialThemeOptions

Properties

Property Type Description
dark? boolean Dark surfaces with light text, like material-night, instead of light ones.

OrbitMediaEvent

A node’s picture, video or sound in the media viewer.

Properties

Property Type Description
index number Its place among the map’s pictures, videos and sounds, in reading order, from 0.
kind "video" | "audio" | "image" image, the node’s picture, video, its video, or audio, its sound.
node OrbitNode -
total number How many pictures, videos and sounds the viewer steps through.

OrbitMediaOptions

What openMedia shows.

Properties

Property Type Description
autoplay? boolean Start a video or sound playing as it opens, and a live photo’s motion once (never with reduced motion). Default true.
kind? "video" | "audio" | "image" For a node with more than one: which to show. Default: the picture, then the video, then the sound.
startAt? number Start a video or sound this many seconds in. YouTube and Vimeo start at the whole second. Default 0.

OrbitMediaState

The video, sound or live photo’s motion in the media viewer, as it plays (see the media-state event).

Properties

Property Type Description
duration number | null How long it is, in seconds, once known.
ended boolean It played to the end.
kind "video" | "audio" | "image" What plays: the node’s video, its sound (audio), or its live photo’s motion over its picture (image).
muted boolean Its sound is off. Browsers let a video start with sound only once the reader has interacted with the page; a video started before that plays muted.
node OrbitNode -
playing boolean Playing, rather than paused, not started yet, or ended.
time number Where it is, in seconds from the start.

OrbitMotion

A live photo’s motion: the few seconds of video a phone records around a picture. Written motion: media/summit-motion.mp4 inside the picture’s value, or motion: { src, still }. The node’s picture is the still: the map and the detail sheet show it, and the media viewer plays the motion over it.

Properties

Property Type Description
src string The video’s address, such as an .mp4: relative ones resolve against baseUrl, as every media address does.
still? number Where in the video the picture was taken, in seconds, when the phone said so.

OrbitNode

One node of a map, as the parsers produce it.

Properties

Property Type Description
attrs? Record<string, unknown> Attributes Orbit doesn’t use itself, kept for your own code (<!-- orbit owner: Ana -->).
audio? object A sound: a voice memo, music or a recording, played in the detail sheet and the media viewer. Its caption is only ever in its own value (audio: { src: …, caption: … }): a caption key beside it stays with the node’s video, embed or picture, as older versions read it.
audio.caption? string -
audio.src string -
children OrbitNode[] -
collapsed? boolean Hide the node’s children until it is opened.
color? string Any CSS color. Without one, the node takes its branch’s color from the theme or palette.
due? string The idea’s date: a day, 2026-11-20, or a day and a time of day, 2026-11-20 09:30, always in this form (see parseDue). It’s local time, with no time zone: 9:30 is 9:30 wherever the map is read. Shown small on its planet, and in the detail sheet and the outline; once it’s past, in the theme’s attention color, unless the idea’s status is done.
embed? object A page shown in a frame in the detail sheet.
embed.caption? string -
embed.src string -
files? OrbitFile[] Files the idea holds: a PDF, a spreadsheet, a ticket, any file, each by its address (media/boarding-pass.pdf). Its planet shows a paperclip with how many, and the detail sheet lists them; opening one fires file-open (see OrbitFile).
icon? string An emoji (or any short symbol) shown before the text.
id string Unique within the map: a slug of the text (Product roadmap becomes product-roadmap), or the id attribute.
image? object A picture shown inside the node and in the detail sheet. A live photo’s picture carries its motion, the few seconds of video a phone records around it, which the media viewer plays (see OrbitMotion).
image.alt? string -
image.caption? string -
image.motion? OrbitMotion -
image.src string -
level number Depth in the tree: 0 for the root.
link? string A URL the node links to, offered as a button when the node is in focus. #id links to another node of the map: the button flies there.
note? string Longer text, shown in the detail sheet: markdown unless noteFormat is plain.
noteFormat? "markdown" | "plain" -
paletteColor? number Which of the palette’s colors the node takes when it has no color of its own: 1 is the first after the root’s, cycling. Without one, a top-level node takes the next in turn and a deeper node a shade of its branch’s. Edits on the map write it to keep a top-level node’s color when the nodes around it change.
parent? OrbitNode The parent node. Set by the parsers as a non-enumerable property, so trees stay JSON-serializable.
priority? number -
source? object Where the node comes from in a markdown source.
source.line number -
source.raw string -
status? string Free text. Some words get a colored dot: active (also doing, in progress), done (complete, shipped), blocked (stuck, at risk), todo (planned, next).
tags? string[] -
text string The node’s label, without its icon.
type? string The node’s type, such as milestone. A type defined in the nodeTypes option or with registerNodeType sets its look, content and actions.
typeVersion? number The version of its type the node was written for, when the type has changed its fields since its first one: type: task@2. Not written means 1. See OrbitNodeType.version.
video? object A video (YouTube, Vimeo or a file) played in the detail sheet.
video.caption? string -
video.provider? "youtube" | "vimeo" | "native" -
video.src string -
video.thumbnail? string -

OrbitNodeCircle

Where a node is drawn on screen: its circle’s center, in px from the map’s top left, and its radius in px.

Extended by

Properties

Property Type
radius number
x number
y number

OrbitNodeContextEvent

A long press, right click or context menu key on a node.

Properties

Property Type Description
node OrbitNode -
x number Where, in CSS pixels from the map’s top left corner: the press, or the node’s center for the keyboard.
y number -

OrbitNodeDragEvent

A node dragged somewhere else (see editable). start as it leaves its place under the finger, the moment to close a menu the long press opened; over whenever where it would go changes; end when it’s let go, after the edit that moved it, if it moved.

Properties

Property Type Description
index number | null -
node OrbitNode -
parent OrbitNode | null Where it would go, or (on end) went: into parent, at index among its children (null: after the last). On start, where it was; null over no place, and on an end that put it back.
phase "start" | "end" | "over" -

OrbitNodeType

How nodes of one type look and behave. Nodes pick a type with type: name.

Properties

Property Type Description
actions? OrbitAction[] Actions only nodes of this type offer, after the map’s own.
color? string The color these nodes get unless they set their own; their children take shades of it.
details? (node, element) => void Adds a section to the detail sheet, above the note; the node gets a “Details” button.
icon? string The icon these nodes get unless they set their own.
label? string The type’s name for people, shown in the detail sheet and the tooltip: 'Milestone'.
render? (node, element) => void | (() => void) Draws inside the node, the way a picture does: element is a 100 × 100 px box clipped to the node’s circle and scaled with it, and the label moves outside. Return a function to clean up when the node leaves the map.
tokens? Partial<Record< | "overdue" | "sans-font" | "serif-font" | "mono-font" | "font-family" | "label-font" | "display-font" | "label-weight" | "display-weight" | "label-letter-spacing" | "label-shadow" | "surface" | "surface-pattern" | "text" | "muted-text" | "root-text" | "node-text" | "node-text-inverse" | "color-root" | "color-1" | "color-2" | "color-3" | "color-4" | "color-5" | "color-6" | "color-7" | "shade-light" | "shade-dark" | "node-fill-opacity" | "moon-opacity" | "node-highlight" | "node-terminator" | "node-shading" | "node-shade-circle" | "node-stroke" | "node-stroke-tint" | "node-stroke-width" | "badge-stroke" | "node-shadow" | "node-shadow-tint" | "node-shadow-opacity" | "node-shadow-offset" | "node-shadow-size" | "sun-shadow-opacity" | "sun-shadow-size" | "sun-halo" | "sun-halo-tint" | "sun-halo-opacity" | "sun-halo-width" | "sun-halo-dash" | "sun-halo-size" | "ring-stroke" | "ring-tint" | "ring-opacity" | "ring-width" | "ring-dash" | "link-stroke" | "link-tint" | "link-opacity" | "link-width" | "link-dash" | "focus-ring" | "note-indicator" | "control-background" | "control-border" | "control-text" | "control-muted-text" | "control-active-background" | "control-active-text" | "control-shadow" | "control-blur" | "tooltip-background" | "tooltip-text" | "action-background" | "action-border" | "action-text" | "action-shadow" | "sheet-background" | "sheet-text" | "sheet-muted-text" | "sheet-border" | "sheet-backdrop" | "sheet-shadow" | "sheet-blur" | "chip-background" | "chip-text" | "link-text" | "status-active" | "status-done" | "status-blocked" | "status-todo" | "status-neutral" | "error-background" | "error-border" | "error-text", string>> Theme tokens for these nodes only, without --orbit-: their rim, shadow, glow, label and status colors, such as { 'node-stroke': '#B45309', 'node-stroke-width': '3' }.
upgrade? (node, from) => void Brings a node written for an older version of the type up to date: renames or reshapes its attributes, in place. from is the version it was written for. Runs once per node when a map is drawn (or with upgradeNodeTypes), and the next save writes the node as upgraded. Nodes written for a newer version than this one are left as they are, and drawn as plain ideas.
version? number The version of the fields these nodes keep in their attributes, once the type changes them: 1 at first. Nodes say which version they were written for (type: task@2; none means 1), and older ones are brought up to date with upgrade when a map is drawn.

OrbitNoteCheck

A box of a note’s checklist checked or unchecked: its line in the note, from 0, and whether it’s checked now.

Properties

Property Type
checked boolean
line number

OrbitNoteOptions

Properties

Property Type Description
baseUrl? string Where relative links and pictures resolve from: the map’s baseUrl.
onCheck? (check) => void Called when someone checks or unchecks a box of the note’s checklists, with the box’s line in the note and whether it’s checked now: setNoteCheckbox writes that into the note. Without it, the boxes show but don’t change.
resolveLink? (href) => unknown Whether a #id link points at a node of the map; links to missing nodes show as text.

OrbitOPMLOptions

Properties

Property Type Description
title? string The outline’s title, in its head. Default: the map’s title, or its root’s text.

OrbitParseOptions

Properties

Property Type Description
strict? boolean Throw an OrbitParseError on the first problem instead of recording a diagnostic and carrying on. Off by default; orbit validate turns it on.
untitled? string The name of the root Orbit makes up for a document with no single top heading and no title, in the reader’s language. Default “Untitled map”. Its id is untitled-map whatever its name.

OrbitPluralText

Text that depends on a number: one form for each plural category the language uses (see Intl.PluralRules), other for any it leaves out. {count} is the number, written the language’s way.

Properties

Property Type
few? string
many? string
one? string
other string
two? string
zero? string

OrbitPrintOptions

Properties

Property Type Description
baseUrl? string Resolves relative picture, video and link URLs. Default: the document’s baseUrl.
focus? string The node in the middle of the picture in focus mode, by id. Default: the root.
idPrefix? string Prefix for the picture’s SVG ids; give each layout in one page its own. Default: orbit-print.
language? string The language of the few words the layout has: a BCP 47 tag. Default: English.
nodeTypeFor? (node) => string | undefined The type a node that names none is laid out as (see OrbitRendererOptions.nodeTypeFor).
nodeTypes? Record<string, OrbitNodeType> Node types by name, before the registered ones: their icons, colors, labels and details.
palette? string[] The map’s colors: the root’s, then one per top-level branch. Default: the document’s, or the theme’s.
picture? boolean Whether the map’s picture comes before the outline. Default: true.
statuses? Record<string, OrbitStatusStyle> Status words and how they look, before the registered ones.
strings? Partial<OrbitStrings> Words to change, over the language’s.
theme? | OrbitThemePreset | OrbitRendererTheme | string & object The map’s theme: a theme name or { preset, tokens }. Default: the document’s. Paper is light, so a dark theme prints as its light counterpart (see printTheme), and nothing prints a background.
title? string The heading at the top. Default: the map’s title, or its root’s text.
view? OrbitViewMode What the picture shows: focus, a node with its orbit, or all, the whole map. Default: the map’s view, or focus.
viewMode? OrbitViewMode Deprecated Use view, as the renderer and a document name it: this name goes in Orbit 1.0.

OrbitRendererOptions

How a map looks and behaves. Every option is optional; options passed to the renderer win over the document’s frontmatter.

Extended by

Properties

Property Type Description
actions? OrbitAction[] Your own buttons under the focused node and in its detail sheet, before the registered ones.
animation? boolean Keep the orbit turning slowly on its own.
ariaLabel? string The map’s accessible name. Default: the document’s title.
baseUrl? string Resolves relative image, video, sound and link URLs: an http, https or file address, or a relative one, which the page’s address completes. Joined to a base of any other kind, such as javascript:, they’d take its scheme, so they stay relative instead.
editable? boolean Build the map on the map: a + in the orbit adds an idea, typed right in its new planet, and a long press, a right click or F2 edits a node’s text where it is. A node held still, by a long press or the mouse, lifts: drag it onto another node to move it there, or to a place in the orbit to put it there. Default false.
editingKeys? boolean Keys for building an editable map at speed, as in mind-map apps. On a node with keyboard focus, Tab (or Insert) adds an idea under it, Shift+Enter adds one beside it, and Delete removes it. While typing, Tab keeps what was typed and goes on a level down, under it; with nothing typed, it moves the field under the idea before. Shift+Tab goes on a level up, beside the parent. Tab then stays in the map; Shift+Tab from a node still leaves it. Default false.
focus? string The node in focus when the map first draws, by id: to open a map where the reader left it. Default: the root. Later renders keep the reader’s place.
insets? OrbitInsets The parts of the map the page covers with its own controls, such as a toolbar floating over its bottom edge, in px from each edge. Views are fitted into what’s left, and the map still draws under the controls. Changing them moves a fitted view to its new place (see insetsTransition).
insetsTransition? "instant" | "glide" How the insets a setOptions call brings take effect, for that call alone. By default ('instant') a fitted view is kept within its new room at once, as it has to be while the keyboard slides or a sheet is dragged and the insets change every frame. 'glide' glides it all the way from where it was, with the camera, for a change made once, such as a panel coming or going.
interactive? boolean false draws a still picture: no clicks, drags, zoom or keyboard. Default true.
language? string The language of the map’s controls, sheets and announcements: a BCP 47 tag such as es or pt-BR. Default: the language the map’s element is in (the closest lang attribute), then English. Orbit speaks English, Spanish and Brazilian Portuguese; registerLanguage adds others.
longPressDelay? number How long (ms) a finger or pen holds still on a node before it counts as a long press (see onNodeContext). Default 500; apps can pass their platform’s own, such as Android’s 400.
maxDepth? number Levels below the root to render (1 = root + direct children).
mediaViewer? boolean Deprecated Use showMediaViewer, named as showRings and the other switches are: this name goes in Orbit 1.0.
nodeTypeFor? (node) => string | undefined The type a node that names none is drawn as, for display only: as if it said type: name, with that type’s look, content and actions. Orbit never writes it to the map, and asks again whenever it draws; return undefined to draw the node as it is. Called often: keep it quick.
nodeTypes? Record<string, OrbitNodeType> Node types by name: what nodes with type: name look like, draw inside them, show in the detail sheet and offer as actions. They come before the ones registered with registerNodeType.
noteRenderer? (note, context) => string Renders a note to HTML yourself. The HTML is used as-is: sanitize untrusted notes.
onAction? (event) => false | void A button was pressed. Return false to skip what it does (the detail sheet, the link, or your action’s run).
onEdit? (edit) => void The map was edited with addNode, updateNode, removeNode or moveNode; save renderer.toMarkdown() to keep it.
onEditorClose? (event) => void The field for typing on the map closed.
onEditorOpen? (event) => void The field for typing on the map opened.
onFileOpen? (event) => false | void One of a node’s files was opened in the detail sheet. Return false to open it your way instead of in a new tab.
onFocusChange? (node, path) => void A new node is in focus, with the path from the root to it, as focus-change has them.
onMediaClose? (event) => void The media viewer closed.
onMediaOpen? (event) => void The media viewer opened, or stepped to another picture, video or sound.
onMediaState? (state) => void The video, sound or live photo’s motion in the media viewer started, paused, moved on, ended or was muted; while it plays, its time a few times a second.
onNodeClick? (node) => void A node was clicked or activated with the keyboard, before the map reacts.
onNodeContext? (event) => void A node was long-pressed, right-clicked or chosen with the context menu key: show a menu of things to do with it at (x, y). With this callback or a node-context listener, the press is yours: it doesn’t open the node, and the browser’s own menu stays closed.
onNodeDrag? (event) => void A node is dragged somewhere else (see editable and the node-drag event).
onSpinSettle? (node) => void Called when a flicked orbit comes to rest, with the planet nearest the top.
onSpotlight? (event) => void A node spotlight brought up close moved on screen, came to rest there, or is back in its place.
onViewModeChange? (mode) => void -
openFiles? boolean Whether the detail sheet opens a node’s files: with false it lists them, each with its name, kind and size, and says they stayed with the map, as in a web page made without them. Default true.
orbitAnimation? boolean Deprecated Use animation, as a document writes it: this name goes in Orbit 1.0.
orbitSpeed? number Deprecated Use speed, as a document writes it: this name goes in Orbit 1.0.
palette? string[] Node colors: the first for the root, then one per top-level branch (cycling). Default: the theme’s.
showActionButtons? boolean Buttons under the focused node for its note, media, link and actions. Default true.
showControls? boolean Breadcrumbs, the view switch, the list button and zoom buttons. Default true.
showDetailSheet? boolean Open the built-in detail sheet for notes, embeds and the details of a node’s type. Default true.
showMediaViewer? boolean Show pictures, videos and sounds in the media viewer, over the whole window: “View picture”, “Play video” and “Play sound” open it, and so do the detail sheet’s pictures and its videos’ and sounds’ Expand buttons. Default true. With false, those buttons open the detail sheet instead (unless showDetailSheet is false too), whose videos and sounds then have no Expand button. openMedia opens the viewer either way.
showRings? boolean Draw the dashed orbit rings. Default true.
speed? number Seconds per turn of animation’s drift: bigger is slower. Default 90.
spin? OrbitSpinOptions How a flicked orbit spins.
statuses? Record<string, OrbitStatusStyle> Status words and how they look: a dot tone (active, done, blocked, todo, neutral) or any CSS color, as in { review: 'active', 'on hold': '#A855F7' }.
strings? Partial<OrbitStrings> Words to change on this map only, over its language’s: { zoomIn: 'Closer' }.
theme? | OrbitThemePreset | OrbitRendererTheme | string & object A theme name ('night', 'cosmos', or one registered with registerTheme) or a theme object. An object without a preset keeps the document’s theme and changes the tokens it names.
transitionDuration? number | "auto" Navigation flight length in milliseconds, or auto to scale with the distance travelled.
view? OrbitViewMode The first view: focus (default) or all, the overview.
viewMode? OrbitViewMode Deprecated Use view, as a document writes it: this name goes in Orbit 1.0.
zoom? OrbitZoomOptions How the wheel, trackpads and pinches zoom.

OrbitRenderErrorDetail

Detail of the orbit-error event dispatched on an element whose map couldn’t be drawn.

Properties

Property Type
diagnostics OrbitDiagnostic[]
error Error | null
line? number
message string

OrbitRendererTheme

A theme with your own values: { preset: 'night', tokens: { surface: '#0b1020', 'ring-dash': 'none' } }. Each token sets the matching --orbit-* CSS custom property on the map, so a value the page sets in its own CSS still wins.

Properties

Property Type Description
preset? OrbitThemePreset | string & object The theme to start from: a built-in one or one registered with registerTheme. Without one, the document’s theme (or paper).
tokens? Partial<Record< | "overdue" | "sans-font" | "serif-font" | "mono-font" | "font-family" | "label-font" | "display-font" | "label-weight" | "display-weight" | "label-letter-spacing" | "label-shadow" | "surface" | "surface-pattern" | "text" | "muted-text" | "root-text" | "node-text" | "node-text-inverse" | "color-root" | "color-1" | "color-2" | "color-3" | "color-4" | "color-5" | "color-6" | "color-7" | "shade-light" | "shade-dark" | "node-fill-opacity" | "moon-opacity" | "node-highlight" | "node-terminator" | "node-shading" | "node-shade-circle" | "node-stroke" | "node-stroke-tint" | "node-stroke-width" | "badge-stroke" | "node-shadow" | "node-shadow-tint" | "node-shadow-opacity" | "node-shadow-offset" | "node-shadow-size" | "sun-shadow-opacity" | "sun-shadow-size" | "sun-halo" | "sun-halo-tint" | "sun-halo-opacity" | "sun-halo-width" | "sun-halo-dash" | "sun-halo-size" | "ring-stroke" | "ring-tint" | "ring-opacity" | "ring-width" | "ring-dash" | "link-stroke" | "link-tint" | "link-opacity" | "link-width" | "link-dash" | "focus-ring" | "note-indicator" | "control-background" | "control-border" | "control-text" | "control-muted-text" | "control-active-background" | "control-active-text" | "control-shadow" | "control-blur" | "tooltip-background" | "tooltip-text" | "action-background" | "action-border" | "action-text" | "action-shadow" | "sheet-background" | "sheet-text" | "sheet-muted-text" | "sheet-border" | "sheet-backdrop" | "sheet-shadow" | "sheet-blur" | "chip-background" | "chip-text" | "link-text" | "status-active" | "status-done" | "status-blocked" | "status-todo" | "status-neutral" | "error-background" | "error-border" | "error-text", string>> Token values by name, as listed in THEME_TOKENS (surface, color-1, ring-dash, …).

OrbitSerializeOptions

Properties

Property Type Description
keepSource? boolean Keep the source’s own lines for everything an edit didn’t change (the default, for a document parsed from markdown): its formatting, and the text Orbit doesn’t read, such as other HTML comments or frontmatter keys of other apps. false writes the whole map in Orbit’s own form.

OrbitSpinOptions

How a flicked orbit spins in focus mode.

Properties

Property Type Description
decay? number Seconds for a free spin to lose about two thirds of its speed. Default 1.4.
haptics? boolean Vibrate briefly as planets pass the top, on devices that support it. Off by default.
maxSpeed? number Fastest spin, in degrees per second. Default 1440 (four turns a second).
snap? false | "planet" Bring the nearest planet to the top as a spin comes to rest. Off by default.

OrbitSpotlightEvent

A node spotlight brought up close, and where its circle is on screen (see OrbitNodeCircle). move as the camera flies to it or back from it, on each frame its circle moves; rest once the flight to it lands, and again whenever its circle changes while it’s held there (the map resized, say), for whatever the page lays over it to follow; end once the camera is back from it and the map takes input again, with where the node is then.

Extends

Properties

Property Type Inherited from
node OrbitNode -
phase "end" | "move" | "rest" -
radius number OrbitNodeCircle.radius
x number OrbitNodeCircle.x
y number OrbitNodeCircle.y

OrbitSpotlightOptions

How spotlight brings a node up close.

Properties

Property Type Description
insets? OrbitInsets The parts of the map the page covers with its own controls while the node is up close, such as a toolbar for what’s laid over it, in px: the node is held in the middle of what’s left. Default none; the map’s own insets aren’t used, nor changed.
share? number How much of the room the node fills across, along the room’s shorter side: more than 0, up to 1. Default 0.86.

OrbitStrings

Everything Orbit says, in one language. {name}-style placeholders are filled in as described on each; keep them in a translation, in any order.

Properties

Property Type Description
added string Announced when an idea is added: {name}.
addIdeaTo string The + in an orbit: {name} is the idea it adds to.
anIdea string {name} in those announcements when the idea has no text.
audio string A sound’s name in the viewer and the detail sheet when it has no caption.
audioUnavailable string -
back string The back button, when the idea it goes back to has no name.
backTo string The back button’s label: {name} is the idea it goes back to.
backToParent string The back button’s label when that idea has no text.
close string -
date string Part of an idea’s description: {date} is its date (see OrbitWords.fullDate).
dateLabel string An idea’s date in the tooltip and, for assistive technology, in the detail sheet: {date}.
details string The detail sheet’s name when the idea has no text.
emptyMap string The message on a map with nothing in it.
emptyMapHint string The hint under it.
expand string The button over a video or a sound in the detail sheet, which moves it to the media viewer.
expandAudio string That button over a sound, for assistive technology.
expandVideo string That button over a video, for assistive technology.
fileArchive string -
fileAudio string -
fileCount OrbitPluralText How many files an idea holds, in its description and the outline: {count}.
fileDocument string -
fileImage string -
fileOther string A file of no kind Orbit names, without an extension.
filePdf string The kinds of file the detail sheet and prints name under a file’s name, beside its size. A kind Orbit doesn’t name is its extension in capitals.
filePresentation string -
files string The heading over an idea’s files in the detail sheet and prints.
fileSpreadsheet string -
filesStayed string Under the files in the detail sheet when they can’t be opened from there (see openFiles), as in a web page made without them.
fileText string -
fileVideo string -
fitMap string The button that zooms to fit the view.
fitPicture string The viewer’s button that zooms the picture to fit.
focus string The button that shows the focused idea with the ideas around it.
goTo string A link to another idea of the map: {name} is that idea, or theIdea when it has no text.
has string Part of an idea’s description: {list} lists what it has, from the words below.
hasAudio string -
hasDetails string -
hasEmbed string -
hasImage string -
hasLink string -
hasNote string -
hasVideo string -
hiddenIdeaCount OrbitPluralText How many ideas are hidden under an idea (see hideChildren), as announced and in the outline: {count}.
holdToPlay string The tooltip of a live photo’s mark in the viewer, which screen readers read after its name.
ideaActions string The buttons under an idea: {name}.
ideaActionsUntitled string The buttons under an idea with no text.
ideaCount OrbitPluralText How many ideas an idea holds, as announced and in its description: {count}.
live string The mark on a live photo, a picture with the few seconds of video a phone records around it, in the viewer and the detail sheet: a word or two, as phones show it.
mapNotDrawn string The title of the card shown where a map couldn’t be drawn.
mapNotDrawnReason string The card’s message when the problem came with none of its own.
mapPath string The breadcrumbs, for assistive technology.
mindMap string The map’s name for assistive technology, and an exported SVG’s title, when it has no ariaLabel and its root no text.
mindMapRole string What assistive technology calls the map (aria-roledescription), in lower case.
moved string Announced when an idea moves: {name} into {parent}.
movedToTop string Announced when an idea moves to a parent with no text: {name}.
moveHere string Where an idea being moved would land: {name} is that idea.
mute string -
newIdea string The empty text field’s placeholder for a new idea.
newIdeaFor string The text field for a new idea: {name} is the idea it goes into.
next string -
openAudioInNewTab string -
openEmbed string -
openFile string A file in the detail sheet, which opens it: {name} is its name.
openLink string -
openPictureInNewTab string -
openVideoInNewTab string -
outline string The map as a list, for assistive technology.
overdue string Part of an idea’s description, after its date, once the date is past and the idea isn’t done.
overdueLabel string dateLabel once the date is past and the idea isn’t done: {date}.
overview string The button that shows the whole map at once.
overviewAnnouncement string Announced when the overview opens.
pause string -
picture string A picture’s name in the viewer when it has no description or caption.
pictureUnavailable string -
play string A sound player’s play button, while it’s paused.
playAudio string -
playbackPosition string The slider that moves a sound to another time.
playLivePhoto string A live photo’s mark in the viewer, the button that plays its motion, for assistive technology: keep the mark’s words (live) in it.
playVideo string -
position string Where the viewer is among the map’s pictures and videos: {index} of {total}.
present string The button that presents a map shared as a web page, one idea at a time with its note as a caption.
previous string -
priority string The priority chip: {priority}.
problemOnLine string The card’s message for a problem on a line of the map’s source: {line} and {message}, which stays as Orbit wrote it.
readNote string -
removed string Announced when an idea is deleted: {name}.
revealed string Announced when the ideas hidden under the idea in focus are shown: {name} is that idea, and {list} names them.
scrollToZoom string Shown when the wheel scrolls the page over a map: {key} is Ctrl, or ⌘ on Apple devices.
seeIdea string The same link printed, where it can’t be followed: {name} is that idea.
showDetails string -
showFiles string The button under an idea that shows its files.
showOutline string The button that shows the map as a list.
skipBack OrbitPluralText The player’s buttons that go back and on: {count} seconds.
skipForward OrbitPluralText -
status string Part of an idea’s description: {status} is its status, as statusName says it.
statusActive string A status written active.
statusBlocked string A status written blocked.
statusDone string A status written done.
statusLabel string The status in the tooltip: {status}.
statusTodo string A status a file writes as todo, as people read it. Other status words are said as written.
textOf string The text field over an idea being renamed: {name}.
theIdea string {name} in moveHere when the idea has no text.
thisIdea string {name} in the text fields and the + when the idea has no text.
timeOf string Where a sound is, for screen readers: {time} of {duration}.
today string A date on a planet, when it’s today (and has no time: one today shows its time).
tomorrow string A date on a planet, when it’s tomorrow.
unmute string -
untitled string An idea with no text, wherever its name shows.
untitledMap string The root Orbit makes up for a map that’s just a list, or has several top headings, and no title.
video string A video’s name in the viewer when it has no caption.
videoUnavailable string -
videoUnavailableHere string A video its site doesn’t let other pages play.
view string The group of view buttons.
viewImage string -
viewImageOf string The picture in the detail sheet, which opens the viewer: {description} is its alternative text.
viewLivePhoto string A live photo in the detail sheet, which opens the viewer, when it has no alternative text.
viewLivePhotoOf string A live photo in the detail sheet: {description} is its alternative text.
watchOn string A video’s link to its site: {provider} is YouTube or Vimeo.
yesterday string A date on a planet, when it was yesterday.
zoom string The group of zoom buttons.
zoomIn string -
zoomOut string -

OrbitSVGOptions

Properties

Property Type Description
baseUrl? string Resolves relative image URLs.
focus? string The node at the center in focus mode, by id. Default: the root.
height? number Height of the drawing, in pixels: positive, at most MAX_SVG_EXPORT_SIZE. Default 600.
idPrefix? string Prefix for the SVG’s ids. Without one, they’re made from the drawing, so SVGs of different maps can share a page, and the same drawing always gets the same ones.
language? string The language of the few words the drawing has (an untitled idea, the empty map): a BCP 47 tag. Default: English.
maxDepth? number -
nodeTypeFor? (node) => string | undefined The type a node that names none is drawn as, for display only (see OrbitRendererOptions.nodeTypeFor).
nodeTypes? Record<string, OrbitNodeType> Node types by name, before the registered ones: their icons, colors and tokens.
palette? string[] -
responsive? boolean Size the SVG to its container (100% wide and tall) instead of in pixels.
showRings? boolean -
statuses? Record<string, OrbitStatusStyle> Status words and how they look, before the registered ones.
strings? Partial<OrbitStrings> Words to change, over the language’s.
theme? | OrbitThemePreset | OrbitRendererTheme | string & object A theme name or an object of theme values. Default: the document’s theme, or paper.
title? string The SVG’s title and accessible name. Default: the document’s title, or the root’s text.
view? OrbitViewMode focus (default) or all for the overview.
viewMode? OrbitViewMode Deprecated Use view, as the renderer and a document name it: this name goes in Orbit 1.0.
width? number Width of the drawing, in pixels: positive, at most MAX_SVG_EXPORT_SIZE. Default 800.

OrbitWebPageOptions

Properties

Property Type Description
focus? string The node in focus when the map opens, by id. Default: the root.
language? string The language of the page and the map’s words: a tag like es. Default: English.
media? Record<string, string> Pictures and sounds to put inside the page, by the address the map gives them: { 'photos/summit.jpg': 'data:image/jpeg;base64,…', 'memos/idea.m4a': 'data:audio/mp4;base64,…' }. A node’s picture and sound, a video’s thumbnail and pictures in notes are swapped for them, so they show, and play, wherever the page goes. So is a live photo’s motion ('photos/summit.mp4': 'data:video/mp4;base64,…'), a few seconds long. Videos stay out: they’re too big to carry as text, and their thumbnails stand in for them. So do an idea’s files: the page lists them, by name, kind and size, and says they stayed with the map.
script string Orbit’s web page script, the file @restless-dreams/orbit/web-page.js, as text. It goes inside the page, so the page needs nothing else.
strings? Partial<OrbitStrings> Single words to change: { present: 'Show' }.
theme? string | OrbitRendererTheme The map’s theme, instead of its frontmatter’s: a theme name or { preset, tokens }.
title? string The page’s title. Default: the map’s title, or its root’s text.
view? OrbitViewMode How the map opens: focus (default) or all, the overview.
viewMode? OrbitViewMode Deprecated Use view, as the renderer and a document name it: this name goes in Orbit 1.0.

OrbitZoomOptions

How the map responds to the wheel, trackpads and pinches.

Properties

Property Type Description
maximum? number Largest zoom, relative to the fitted view. Default 6.
minimum? number Smallest zoom in the overview, relative to the fitted view. Default 0.4. Focus mode stops at 0.6 whatever this says: zooming out there goes up a level, or from the root to the overview, before it gets that far.
wheel? false | "auto" | "always" | "modifier" auto (default): the wheel zooms freely when the map is the whole page and needs Ctrl or ⌘ when the page scrolls; always; modifier; or false to ignore the wheel.

Type Aliases

AutoRenderOptions

type AutoRenderOptions = OrbitAutoRenderOptions;

Deprecated

Use OrbitAutoRenderOptions: this name goes in Orbit 1.0.


CreateOrbitMapOptions

type CreateOrbitMapOptions = OrbitMapOptions;

Deprecated

Use OrbitMapOptions: this name goes in Orbit 1.0.


MapToolDefinition

type MapToolDefinition = OrbitMapToolDefinition;

Deprecated

Use OrbitMapToolDefinition: this name goes in Orbit 1.0.


MapToolFormats

type MapToolFormats = OrbitMapToolFormats;

Deprecated

Use OrbitMapToolFormats: this name goes in Orbit 1.0.


MapToolName

type MapToolName = OrbitMapToolName;

Deprecated

Use OrbitMapToolName: this name goes in Orbit 1.0.


MapToolProperty

type MapToolProperty = OrbitMapToolProperty;

Deprecated

Use OrbitMapToolProperty: this name goes in Orbit 1.0.


MapToolProvider

type MapToolProvider = OrbitMapToolProvider;

Deprecated

Use OrbitMapToolProvider: this name goes in Orbit 1.0.


MapToolResult

type MapToolResult = OrbitMapToolResult;

Deprecated

Use OrbitMapToolResult: this name goes in Orbit 1.0.


MapTools

type MapTools = OrbitMapTools;

Deprecated

Use OrbitMapTools: this name goes in Orbit 1.0.


MapToolSchema

type MapToolSchema = OrbitMapToolSchema;

Deprecated

Use OrbitMapToolSchema: this name goes in Orbit 1.0.


MapToolsOptions

type MapToolsOptions = OrbitMapToolsOptions;

Deprecated

Use OrbitMapToolsOptions: this name goes in Orbit 1.0.


MaterialThemeOptions

type MaterialThemeOptions = OrbitMaterialThemeOptions;

Deprecated

Use OrbitMaterialThemeOptions: this name goes in Orbit 1.0.


OrbitContentAction

type OrbitContentAction = 
  | "image"
  | "video"
  | "audio"
  | "embed"
  | "note"
  | "link"
  | "files"
  | "details";

Orbit’s own buttons for a node: its picture, video, sound, embed, note, link, files, and its type’s details.


OrbitDiagnosticCode

type OrbitDiagnosticCode = typeof DIAGNOSTIC_CODES[number];

OrbitDiagnosticSeverity

type OrbitDiagnosticSeverity = "error" | "warning";

OrbitDOMEventMap

type OrbitDOMEventMap = { [Name in keyof OrbitEventMap as `orbit-${Name}`]: CustomEvent<OrbitEventMap[Name]> } & object;

The orbit-* DOM events a map dispatches on its element, where they bubble from: one for each of its events (orbit-focus-change for focus-change, and so on), with the same detail, and orbit-error.

Type Declaration

Name Type
orbit-error CustomEvent<OrbitRenderErrorDetail>

OrbitEventName

type OrbitEventName = keyof OrbitEventMap;

OrbitImportErrorCode

type OrbitImportErrorCode = typeof IMPORT_ERROR_CODES[number];

OrbitImportFormat

type OrbitImportFormat = "opml" | "freemind" | "xmind";

The other apps’ formats Orbit reads.


OrbitImportWarningCode

type OrbitImportWarningCode = typeof IMPORT_WARNING_CODES[number];

OrbitMapToolDefinition

type OrbitMapToolDefinition = object;

A tool as OrbitMapTools.definitions lists it: the shape MCP uses, and the data to build any other.

Properties

annotations
annotations: object;

Hints for clients that ask before running some tools: whether it only reads, and whether it can remove or overwrite what’s there.

destructiveHint
destructiveHint: boolean;
readOnlyHint
readOnlyHint: boolean;
description
description: string;
inputSchema
inputSchema: OrbitMapToolSchema;

The tool’s input, as JSON Schema.

name
name: OrbitMapToolName;

OrbitMapToolFormats

type OrbitMapToolFormats = object;

The tools in the shape each provider’s API takes them.

Properties

anthropic
anthropic: object[];

Anthropic’s Messages API (tools).

description
description: string;
input_schema
input_schema: OrbitMapToolSchema;
name
name: string;
gemini
gemini: object[];

Google’s Gemini API (config.tools in @google/genai).

functionDeclarations
functionDeclarations: object[];
openai
openai: object[];

OpenAI’s Responses API (tools).

description
description: string;
name
name: string;
parameters
parameters: OrbitMapToolSchema;
strict
strict: false;
type
type: "function";
openai-chat
openai-chat: object[];

OpenAI’s Chat Completions API (tools), which most other providers and local servers take too.

function
function: object;
function.description
description: string;
function.name
name: string;
function.parameters
parameters: OrbitMapToolSchema;
type
type: "function";

OrbitMapToolName

type OrbitMapToolName = 
  | "read_map"
  | "find_nodes"
  | "read_node"
  | "add_nodes"
  | "update_node"
  | "move_node"
  | "reorder_children"
  | "remove_node"
  | "show_node";

OrbitMapToolProperty

type OrbitMapToolProperty = object;

A property of a tool’s input, as JSON Schema.

Properties

description
description: string;
items?
optional items?: object;
enum?
optional enum?: string[];
type
type: "string";
minimum?
optional minimum?: number;
properties?
optional properties?: Record<string, OrbitMapToolProperty>;
required?
optional required?: string[];
type
type: "string" | "integer" | "number" | "boolean" | "array" | "object";

OrbitMapToolProvider

type OrbitMapToolProvider = keyof OrbitMapToolFormats;

OrbitMapToolSchema

type OrbitMapToolSchema = object;

A tool’s input, as JSON Schema: an object with the tool’s fields.

Properties

properties
properties: Record<string, OrbitMapToolProperty>;
required?
optional required?: string[];
type
type: "object";

OrbitNewNode

type OrbitNewNode = OrbitNodeInput & object;

What addNode takes: a node’s text and attributes, and the nodes to add under it, as many levels down as you like.

Type Declaration

Name Type
children? OrbitNewNode[]
text string

OrbitNodeInput

type OrbitNodeInput = Partial<Pick<OrbitNode, 
  | "text"
  | "icon"
  | "color"
  | "paletteColor"
  | "status"
  | "priority"
  | "due"
  | "collapsed"
  | "link"
  | "note"
  | "noteFormat"
  | "type"
  | "typeVersion"
  | "attrs">> & object;

What addNode and updateNode take: a node’s text and attributes, read as a file’s are. The format’s shorthands work here too: a picture, video, sound or embed as its address ({ image: 'summit.jpg' }), a live photo’s motion as its own, tags as 'web, mobile', a type as 'task@2' and a date as '2026-11-20T09:30'. A value Orbit can’t read throws a TypeError that says what it takes, and the map stays as it was.

Type Declaration

Name Type
audio? string | OrbitNode["audio"]
embed? string | OrbitNode["embed"]
files? | string | OrbitFile | (string | OrbitFile)[]
image? | string | Omit<NonNullable<OrbitNode["image"]>, "motion"> & object
tags? string[] | string
video? string | OrbitNode["video"]

OrbitParsedDocument

type OrbitParsedDocument = OrbitDocument & object;

A document as the parsers return it, with its diagnostics always set.

Type Declaration

Name Type
diagnostics OrbitDiagnostic[]

OrbitStatusStyle

type OrbitStatusStyle = OrbitStatusTone | string & object;

How a status word looks: one of the dot tones, or any CSS color.


OrbitStatusTone

type OrbitStatusTone = "active" | "done" | "blocked" | "todo" | "neutral";

The colored dots statuses get.


OrbitThemeName

type OrbitThemeName = 
  | "paper"
  | "night"
  | "glass"
  | "glass-night"
  | "cosmos"
  | "blueprint"
  | "ink"
  | "contrast"
  | "flat"
  | "flat-night"
  | "material"
  | "material-night"
  | "liquid"
  | "liquid-night";

OrbitThemePreset

type OrbitThemePreset = OrbitThemeName | "auto";

A built-in theme, or auto for paper or night following the reader’s light or dark preference.


OrbitThemeToken

type OrbitThemeToken = typeof THEME_TOKENS[number];

OrbitThemeTokens

type OrbitThemeTokens = Record<OrbitThemeToken, string>;

OrbitViewMode

type OrbitViewMode = "focus" | "all";

focus: one node at the center with its children around it. all: the overview of the whole tree.


ParsedOrbitDocument

type ParsedOrbitDocument = OrbitParsedDocument;

Deprecated

Use OrbitParsedDocument: this name goes in Orbit 1.0.


ParseOptions

type ParseOptions = OrbitParseOptions;

Deprecated

Use OrbitParseOptions: this name goes in Orbit 1.0.


ParseYamlOptions

type ParseYamlOptions = OrbitParseOptions;

Deprecated

Use OrbitParseOptions, which parseOrbitYAML takes as the other parsers do: this name goes in Orbit 1.0.


RendererOptions

type RendererOptions = OrbitRendererOptions;

Deprecated

Use OrbitRendererOptions: this name goes in Orbit 1.0.


RenderToSVGOptions

type RenderToSVGOptions = OrbitSVGOptions;

Deprecated

Use OrbitSVGOptions: this name goes in Orbit 1.0.


SerializeOptions

type SerializeOptions = OrbitSerializeOptions;

Deprecated

Use OrbitSerializeOptions: this name goes in Orbit 1.0.


ViewMode

type ViewMode = OrbitViewMode;

Deprecated

Use OrbitViewMode: this name goes in Orbit 1.0.

Variables

DIAGNOSTIC_CODES

const DIAGNOSTIC_CODES: readonly ["empty-document", "no-structure", "synthetic-root", "invalid-frontmatter", "unknown-frontmatter-key", "unsupported-schema-version", "format-upgraded", "invalid-attributes", "unknown-attribute", "invalid-option-value", "media-missing-source", "unknown-content-type", "caption-without-media", "unknown-link-target", "invalid-yaml", "unknown-yaml-key", "ignored-node-entry", "misnamed-node-key", "comment-without-orbit", "attributes-after-list"];

Every kind of problem the parsers report.


IMPORT_ERROR_CODES

const IMPORT_ERROR_CODES: readonly ["unknown-format", "unreadable", "empty", "password-protected", "too-large"];

Every reason a file can’t be read as a map.


IMPORT_WARNING_CODES

const IMPORT_WARNING_CODES: readonly ["floating-ideas-moved", "summaries-moved", "callouts-moved", "boundaries-in-notes", "links-in-notes", "missing-link-targets", "icons-not-kept", "pictures-not-kept", "attachments-not-kept", "local-links-not-kept", "encrypted-branches-not-read", "formatting-not-kept"];

Every kind of warning reading another app’s map gives.


MATERIAL_SEED

const MATERIAL_SEED: "#6750A4" = '#6750A4';

Material’s baseline color: the material and material-night themes are built from it.


ORBIT_THEME_PRESETS

const ORBIT_THEME_PRESETS: Readonly<Record<OrbitThemeName, Readonly<OrbitThemeTokens>>>;

const PRINT_THEMES: Readonly<Partial<Record<OrbitThemePreset, OrbitThemeName>>>;

The light theme each dark built-in theme prints as. Light themes print as themselves.


SUPPORTED_SCHEMA_VERSION

const SUPPORTED_SCHEMA_VERSION: 1 = 1;

The newest schemaVersion this version of Orbit reads and writes.


THEME_TOKENS

const THEME_TOKENS: readonly ["sans-font", "serif-font", "mono-font", "font-family", "label-font", "display-font", "label-weight", "display-weight", "label-letter-spacing", "label-shadow", "surface", "surface-pattern", "text", "muted-text", "root-text", "node-text", "node-text-inverse", "color-root", "color-1", "color-2", "color-3", "color-4", "color-5", "color-6", "color-7", "shade-light", "shade-dark", "node-fill-opacity", "moon-opacity", "node-highlight", "node-terminator", "node-shading", "node-shade-circle", "node-stroke", "node-stroke-tint", "node-stroke-width", "badge-stroke", "node-shadow", "node-shadow-tint", "node-shadow-opacity", "node-shadow-offset", "node-shadow-size", "sun-shadow-opacity", "sun-shadow-size", "sun-halo", "sun-halo-tint", "sun-halo-opacity", "sun-halo-width", "sun-halo-dash", "sun-halo-size", "ring-stroke", "ring-tint", "ring-opacity", "ring-width", "ring-dash", "link-stroke", "link-tint", "link-opacity", "link-width", "link-dash", "focus-ring", "note-indicator", "control-background", "control-border", "control-text", "control-muted-text", "control-active-background", "control-active-text", "control-shadow", "control-blur", "tooltip-background", "tooltip-text", "action-background", "action-border", "action-text", "action-shadow", "sheet-background", "sheet-text", "sheet-muted-text", "sheet-border", "sheet-backdrop", "sheet-shadow", "sheet-blur", "chip-background", "chip-text", "link-text", "status-active", "status-done", "status-blocked", "status-todo", "status-neutral", "overdue", "error-background", "error-border", "error-text"];

Theme tokens. Each token is a CSS custom property: set --orbit-<token> on the map or any ancestor to override it. Presets only provide defaults: internally every token resolves as var(--orbit-<token>, <preset value>).

Functions

createMapTools()

function createMapTools(map, options?): OrbitMapTools;

Tools a language model calls to read and edit a map: on screen (an OrbitSVGRenderer, such as createOrbitMap returns or <orbit-map>’s renderer), where each change animates and fires edit, or a document (or its markdown or YAML), which they change in place.

Parameters

Parameter Type
map | string | OrbitDocument | OrbitNode | OrbitSVGRenderer
options OrbitMapToolsOptions

Returns

OrbitMapTools


createOrbitMap()

function createOrbitMap(
   target, 
   source, 
   options?
): OrbitSVGRenderer;

Draws a map into target in one call: markdown or YAML source, a parsed document or a node tree. Returns the renderer, to listen for events (renderer.on('focus-change', …)), draw new versions (renderer.render(source)) and clean up (renderer.destroy()).

The map fills target, so give it a height.

Parameters

Parameter Type
target HTMLElement
source string | OrbitDocument | OrbitNode
options OrbitMapOptions

Returns

OrbitSVGRenderer

Example

import { createOrbitMap } from '@restless-dreams/orbit';

const map = createOrbitMap(document.querySelector('#map')!, '# Launch\n## Research\n## Build', { theme: 'auto' });
map.on('focus-change', ({ node }) => console.log(node.text));

defineOrbitMapElement()

function defineOrbitMapElement(tagName?): void;

Registers the <orbit-map> element. Write the map as the element’s content (indent it however you like, <!-- orbit … --> comments included), inside a <script type="text/orbit"> child, or in a source attribute. The map renders in a shadow root, so the raw markdown is never displayed, and it redraws when the content or an attribute changes.

Parameters

Parameter Type Default value
tagName string 'orbit-map'

Returns

void

Example

<script type="module">
  import { defineOrbitMapElement } from '@restless-dreams/orbit';
  defineOrbitMapElement();
</script>

<orbit-map height="420" theme="night">
  # Launch
  ## Research <!-- orbit status: active -->
  ## Build
</orbit-map>

detectImportFormat()

function detectImportFormat(data, name?): OrbitImportFormat | null;

The format of another app’s map, from what the file holds, then from its name; null when it’s none Orbit reads. Orbit’s own markdown and YAML, and its zips, are null too: read those with parseOrbit.

Parameters

Parameter Type
data string | Uint8Array<ArrayBufferLike>
name? string

Returns

OrbitImportFormat | null


documentToRendererOptions()

function documentToRendererOptions(given): OrbitRendererOptions;

The renderer options a document asks for in its frontmatter (or YAML top-level keys). title becomes the map’s accessible label. Container concerns (height, className) are left to the caller.

Parameters

Parameter Type
given OrbitDocumentOptions

Returns

OrbitRendererOptions


exportOPML()

function exportOPML(input, options?): string;

A map as OPML: the root is the one top outline, each node an outline with its icon and text, its note in _note, its link as type="link" with a url, its status in _status (checked, unchecked and indeterminate for done, todo and active; any other word as it is) and _complete, and its tags as category. Pictures, videos, sounds, colors and priorities have no place in OPML: a zip or the map’s own file keeps them.

Parameters

Parameter Type
input string | OrbitDocument | OrbitNode
options OrbitOPMLOptions

Returns

string


exportWebPage()

function exportWebPage(input, given): string;

The map as one HTML page, with Orbit inside (options.script): open it in any browser, offline, to explore the map or present it.

import { readFileSync } from 'node:fs';
import { exportWebPage } from '@restless-dreams/orbit';

const script = readFileSync(new URL(import.meta.resolve('@restless-dreams/orbit/web-page.js')), 'utf8');
const html = exportWebPage(markdown, { script, theme: 'night' });

Parameters

Parameter Type
input string | OrbitDocument | OrbitNode
given OrbitWebPageOptions

Returns

string


findNodeById()

function findNodeById(root, id): OrbitNode | null;

Parameters

Parameter Type
root OrbitNode
id string

Returns

OrbitNode | null


formatDiagnostic()

function formatDiagnostic(diagnostic): string;

Parameters

Parameter Type
diagnostic OrbitDiagnostic

Returns

string


getNodePath()

function getNodePath(root, id): OrbitNode[];

Parameters

Parameter Type
root OrbitNode
id string

Returns

OrbitNode[]


hydrateOrbitBlocks()

function hydrateOrbitBlocks(root?, options?): OrbitSVGRenderer[];

Brings every orbit block under root (default: the whole document) to life as a map: the placeholders the marked extension writes, orbit code blocks in rendered markdown, and <orbit-map> elements (selector changes which). Call it after inserting rendered HTML. Each block is independent: one that fails shows its error card and the rest still render.

Parameters

Parameter Type
root? ParentNode
options? OrbitAutoRenderOptions

Returns

OrbitSVGRenderer[]


importFreeMind()

function importFreeMind(data, options?): OrbitImport;

A FreeMind or Freeplane map, from its file’s bytes or text.

Parameters

Parameter Type
data string | Uint8Array<ArrayBufferLike>
options OrbitImportOptions

Returns

OrbitImport


importMap()

function importMap(data, options?): OrbitImport;

Another app’s map as Orbit maps: OPML, FreeMind and Freeplane, or XMind. Pass the file’s bytes (its text works for OPML and .mm) and its name. Throws an OrbitImportError for a file it can’t read: one in no format it knows (unknown-format), a damaged one (unreadable), one with no ideas (empty), an XMind workbook with a password (password-protected), or one past its limits (too-large).

const { maps } = importMap(bytes, { name: 'Trip.xmind' });
const markdown = serializeOrbitMarkdown(maps[0].document);

Parameters

Parameter Type
data string | Uint8Array<ArrayBufferLike>
options OrbitImportOptions

Returns

OrbitImport


importOPML()

function importOPML(data, options?): OrbitImport;

An OPML file, from its bytes or text.

Parameters

Parameter Type
data string | Uint8Array<ArrayBufferLike>
options OrbitImportOptions

Returns

OrbitImport


importXMind()

function importXMind(data, options?): OrbitImport;

An XMind workbook, from its bytes; or its content.json or content.xml as text, which reads without pictures.

Parameters

Parameter Type
data string | Uint8Array<ArrayBufferLike>
options OrbitImportOptions

Returns

OrbitImport


isOrbitThemePreset()

function isOrbitThemePreset(value): value is OrbitThemePreset;

Parameters

Parameter Type
value unknown

Returns

value is OrbitThemePreset

Deprecated

Use isThemePreset, the same function, named as the other theme functions are: this name goes in Orbit 1.0.


isThemeName()

function isThemeName(value): value is string;

Whether value names a theme: a built-in one, auto, or a registered one.

Parameters

Parameter Type
value unknown

Returns

value is string


isThemePreset()

function isThemePreset(value): value is OrbitThemePreset;

Whether value names a built-in theme: one of the presets or auto.

Parameters

Parameter Type
value unknown

Returns

value is OrbitThemePreset


languageTags()

function languageTags(): string[];

The tags of the languages every map can speak: the built-in ones and the registered ones.

Returns

string[]


materialTheme()

function materialTheme(seed, options?): OrbitRendererTheme;

A Material 3 theme built from seed, any CSS color Orbit reads (hex, rgb(), oklch(), a name such as tomato…). Use it as the theme option, or name it for every map: registerTheme('brand', materialTheme('#0B57D0')).

Parameters

Parameter Type
seed string
options OrbitMaterialThemeOptions

Returns

OrbitRendererTheme


parseDue()

function parseDue(value): OrbitDue | null;

Reads a due value: 2026-11-20, or 2026-11-20 09:30 (or 2026-11-20T09:30, as programs write it; a single figure for the month, day or hour works too). Null for anything else, and for a day or a time that doesn’t exist, such as February 30th or 24:00.

Parameters

Parameter Type
value unknown

Returns

OrbitDue | null


parseOrbit()

function parseOrbit(input, options?): OrbitParsedDocument;

Parses an orbit document in either flavor. Markdown is the default; a document is read as YAML when its first line is a top-level YAML key (nodes:, title:, view:, …), it has a top-level nodes: list, or its frontmatter says flavor: yaml. A fenced “`orbit block is unwrapped first.

Problems the parser can work around are listed in diagnostics (each with a code, line, severity and a message that says how to fix it); pass { strict: true } to throw an OrbitParseError on the first one instead.

Parameters

Parameter Type
input string
options OrbitParseOptions

Returns

OrbitParsedDocument

Example

import { parseOrbit } from '@restless-dreams/orbit';

const { root, diagnostics } = parseOrbit('# Launch\n## Research <!-- orbit status: active -->');
for (const problem of diagnostics ?? []) console.warn(`line ${problem.line}: ${problem.message}`);

parseOrbitMarkdown()

function parseOrbitMarkdown(input, options?): OrbitParsedDocument;

Parameters

Parameter Type
input string
options OrbitParseOptions

Returns

OrbitParsedDocument


parseOrbitYAML()

function parseOrbitYAML(input, options?): OrbitParsedDocument;

Parameters

Parameter Type
input string
options OrbitParseOptions

Returns

OrbitParsedDocument


printTheme()

function printTheme(theme): OrbitRendererTheme;

The theme a map prints in: the map’s own when it’s light, otherwise its light counterpart (PRINT_THEMES), always without a background. A dark theme of your own keeps only its colors (color-root to color-7).

Parameters

Parameter Type
theme string | OrbitRendererTheme | undefined

Returns

OrbitRendererTheme


registerAction()

function registerAction(action): () => void;

Adds an action to every map. Returns a function that removes it again.

Parameters

Parameter Type
action OrbitAction

Returns

() => void


registerHyphenation()

function registerHyphenation(
   language, 
   patterns, 
   options?
): () => void;

Adds a language’s hyphenation patterns, and words its patterns would break wrongly with their hyphens where they go (exceptions), both separated by white space, as the hyph-utf8 package’s .pat.txt and .hyp.txt files have them, with the fewest letters a break leaves before and after its hyphen (left and right, 2 and 3 unless given). They replace the language’s own, built in or added before. Returns a function that takes them out again.

Parameters

Parameter Type
language string
patterns string
options { exceptions?: string; left?: number; right?: number; }
options.exceptions? string
options.left? number
options.right? number

Returns

() => void


registerLanguage()

function registerLanguage(language, strings): () => void;

Adds a language for every map, by its BCP 47 tag (fr, pt-BR), or changes some words of one Orbit has. Words it leaves out come from the language it narrows (pt for pt-BR), then English. Returns a function that puts the language back as it was.

Parameters

Parameter Type
language string
strings Partial<OrbitStrings>

Returns

() => void


registerNodeType()

function registerNodeType(name, definition): () => void;

Defines a node type for every map: nodes with type: name (any case) take it. Returns a function that removes it again.

Parameters

Parameter Type
name string
definition OrbitNodeType

Returns

() => void


registerStatus()

function registerStatus(word, style): () => void;

Gives a status word its look on every map: one of the tones (active, done, blocked, todo, neutral) or any CSS color. Returns a function that removes it again.

Parameters

Parameter Type
word string
style OrbitStatusStyle

Returns

() => void


registerTheme()

function registerTheme(name, theme): () => void;

Names a theme for every map, so theme: 'brand' works in options, in a document’s frontmatter and on <orbit-map theme="brand">. It starts from preset (a built-in theme or another registered one) and sets its own tokens. Returns a function that removes it again.

Parameters

Parameter Type
name string
theme OrbitRendererTheme

Returns

() => void


renderNoteMarkdown()

function renderNoteMarkdown(markdown, context?): DocumentFragment;

A note as DOM nodes, the way the detail sheet shows it: for pages that show notes in their own UI.

Parameters

Parameter Type
markdown string
context OrbitNoteOptions

Returns

DocumentFragment


renderOrbitElement()

function renderOrbitElement(element, options?): OrbitSVGRenderer | null;

Renders an orbit map into the given element. Problems in the document never throw: parse warnings go to the console, and a map that can’t be drawn is replaced by an error card and an orbit-error event on the element.

Callers who later detach the element should invoke OrbitSVGRenderer.unmount(element) to release RAF loops and the ResizeObserver. The <orbit-map> web component does this automatically.

Parameters

Parameter Type
element Element
options OrbitAutoRenderOptions

Returns

OrbitSVGRenderer | null


renderOrbitMarkdownBlocks()

function renderOrbitMarkdownBlocks(root?, options?): OrbitSVGRenderer[];

Parameters

Parameter Type
root? ParentNode
options? OrbitAutoRenderOptions

Returns

OrbitSVGRenderer[]

Deprecated

Use hydrateOrbitBlocks, the same function: this name goes in Orbit 1.0.


renderPrintLayout()

function renderPrintLayout(
   container, 
   input, 
   given?
): HTMLElement;

Lays a map out for print in container, replacing what it held, and returns the layout: the title, the map as a picture that fits the page, then every idea in reading order, nested by depth, with its icon, status, priority, tags, link (its address printed), note, picture, video and files (by name, kind and size). An idea stays whole across page breaks, and a heading stays with what follows it.

It’s laid out on screen like any element: hide it there and show it in print, as Orbit’s web pages do.

Parameters

Parameter Type
container HTMLElement
input string | OrbitDocument | OrbitNode
given OrbitPrintOptions

Returns

HTMLElement

Example

import { renderPrintLayout } from '@restless-dreams/orbit';

renderPrintLayout(document.querySelector('#print'), markdown, { view: 'all' });
// #print { display: none } @media print { #print { display: block } #app { display: none } }

renderToSVGString()

function renderToSVGString(input, given?): string;

Renders a map to a standalone SVG string, without a browser: for files, the command line, static sites and server rendering. It draws what the renderer shows at rest, with the theme’s colors resolved to plain values and the labels as SVG text. It draws the map itself, with none of a renderer’s view state, so every idea shows, ideas a renderer hides with hideChildren included; a renderer’s toSVGString() exports its view as it is.

Parameters

Parameter Type
input string | OrbitDocument | OrbitNode
given OrbitSVGOptions

Returns

string

Example

import { renderToSVGString } from '@restless-dreams/orbit';

const svg = renderToSVGString('# Launch\n## Research\n## Build', { width: 1200, height: 800, theme: 'cosmos' });

serializeOrbitMarkdown()

function serializeOrbitMarkdown(doc, options?): string;

A map as orbit-md. A document parsed from markdown comes back as it was written, with only what changed since rewritten, so maps written by hand or by other apps keep their formatting and everything Orbit doesn’t read. Other documents (built in code, or read from YAML) are written in Orbit’s own form: headings for the root and its children, lists below them.

Parameters

Parameter Type
doc OrbitDocument
options OrbitSerializeOptions

Returns

string


serializeOrbitYAML()

function serializeOrbitYAML(doc): string;

A map as Orbit’s YAML. One read from YAML written for a newer version of the format comes back as it was written, with only what edits changed written again, so everything this version can’t read of it is kept; a change that would replace some of that throws, and nothing is written. Other documents are written in Orbit’s own form.

Parameters

Parameter Type
doc OrbitDocument

Returns

string


setNoteCheckbox()

function setNoteCheckbox(
   note, 
   line, 
   checked
): string | null;

The note with the checkbox on line (counted from 0, as onCheck gives it) checked or unchecked, and every other character as it was; null when the note has no box on that line, as after it changed.

Parameters

Parameter Type
note string
line number
checked boolean

Returns

string | null


themeNames()

function themeNames(): string[];

Every theme name: the built-in ones, auto, then the registered ones.

Returns

string[]


themeTokens()

function themeTokens(name): OrbitThemeTokens;

Concrete token values for a theme name, built in or registered, e.g. for exports outside a page. auto resolves to paper.

Parameters

Parameter Type
name string | undefined

Returns

OrbitThemeTokens


upgradeNodeTypes()

function upgradeNodeTypes(root, nodeTypes?): number;

Brings nodes written for older versions of their types up to date (see OrbitNodeType.version), with the types nodeTypes defines or the registered ones. Maps do this when they’re drawn; this is for documents read without one, on a server or in a script. Returns how many nodes were upgraded.

Parameters

Parameter Type
root OrbitNode
nodeTypes? Record<string, OrbitNodeType>

Returns

number