Learn
Function Reference
This page is a list of every function you can use to build components.
- The value of the cell at the given absolute path.
- The expression defined in the cell at the given absolute path.
- Returns a map of metadata (title, type, is starred, sync peers, error) for a datum.
- An array of accessible datum ids, filtered by an optional map of filters (CreatedByFilter, TypeFilter, FuzzyText, RootOnly, ValidOnly).
- Create an anchor to a specific node using a path.
- AnchoredScrollStep::anchor_block Number->anchor_offset Number->delta Number->heights Array->window Map->MapNormalize an anchored scroll step against the materialized window's real row heights, advancing or retreating the anchor and clamping at the real document edges.
- Logical AND.
- Reference a global application cell by name.
- The running sum of all of the numbers in an array.
- Returns true if the array contains the given element.
- Drop the last n elements from an array and return the remaining elements.
- Join two arrays together into a single array.
- The length of the array in elements.
- The maximum number in an array of numbers.
- The minimum number in an array of numbers.
- Insert an element at the end of an array.
- Remove an element at a given index from the array.
- Reverses the elements in the array.
- Set the value at the given index of an array.
- Returns the input array with the first n elements dropped.
- Sum of all numbers in an arrray.
- Take the first n elements from the array.
- Convert true to 1 and false to 0.
- Reference a cell by name.
- The absolute path of a cell in the evaluating component.
- Returns the value of a cell in a subcomponent.
- Get the absolute path of a cell in a subcomponent.
- Returns an array of the values of the cell defined by all current subcomponents.
- Brighten a color by some amount between 1 and -1.
- Saturate a color by some amount between -1 and 1.
- Compute a text layout with optional parameters {TextSize, LineHeight, MaxWidth}.
- Return an Array of {Start, End} Maps marking misspelled grapheme ranges in the given text.
- Tree-ordered cross-block range Map{StartBlock,StartOffset,EndBlock,EndOffset} for a Note, projected from cursor anchor/focus.
- The component editor's test frame size for a datum, as a map of the axes that have been set.
- Gets the current value of a datum.
- Returns true when both argument expressions match. Does not evaluate the arguments.
- Evaluate an expression using the context of the evaluating node.
- Evaluate an expression using in context of its source.
- Evaluates each expression in the container, then evaluates views.
- Evaluate each expression in a container. Returns the same container, but each value is the result from evaluating.
- The number of matcher pairs in the given event handler.
- Get the type of some expression.
- Extend a node path to a child node.
- Get the path of a child node of the given node path.
- Fill the height offered by the enclosing container. The offer is the container's own Height; with no container (mounted standalone) it is the screen height.
- Fill the width offered by the enclosing container. The offer is the container's own Width; with no container (mounted standalone) it is the screen width.
- Use some filter text to search for matches in an Array of Text.
- Index of the first {BlockIndex, Start, End} match at or after the (block_idx, offset) document position; 0 when none follow or the position is invalid.
- Return an Array of {BlockIndex, Start, End} Maps marking all matches of query across a Note's text blocks.
- Return the first {Start, End} range containing the integer index.
- Return an Array of {Start, End} Maps marking case-insensitive matches of query in text (grapheme indices).
- Iterate the blocks of a Note into a Map of displays keyed by block id.
- Iterate only the blocks of a Note inside a window (from App::note_window) into a Map of displays, bracketed by spacers covering the estimated extent of the blocks outside it.
- Iterate the columns of a Table into a Map of displays keyed by column id.
- Iterate the rows of a Table into a Map of displays keyed by row id.
- Fuzzy filter an Array of Text by a search pattern. Results sorted by match quality.
- Read the anchor cursor position for a value expression.
- Read the focus cursor position for a value expression.
- Convert a text character into a shape.
- If the condition is true then return the second argument; otherwise, return the third argument.
- Get the value at the given index from the array.
- True when the cursor anchor and focus point at different Sources (cross-block selection).
- Returns true when a > b.
- True when the cursor is hovered over the node.
- Returns true if the view is mutable.
- Returns true when the number is an integer (not a fraction).
- Returns true when a < b.
- True when the node is the deepest selected node or one of its ancestors within the same event boundary.
- Returns true if the given expression can be evaluated successfully.
- Get the character index at a relative (x, y) point in a text layout.
- Get the maximum row width across all rows in a text layout.
- Get the position and width of a character at a given index in a text layout.
- Get the number of visual rows in a text layout (including soft-wrapped lines).
- Find the Link mark active for the cursor focus on a value's source, including when the focus lives in a descendant `Text(MarkData{..})` path (e.g. the popup URL field).
- Create a new map using the provided key and value.
- Apply a one-argument function to an array of values.
- Apply a two-argument function to an array of values using the supplied value as the first argument.
- Create a map by zipping a list of keys with list of values.
- Insert the value into the map at the given key.
- Return the key associated to a given index of a map.
- An array of all of the keys in the a map.
- List the keys and values of a map.
- Get the styling marks which apply to a given character in some text.
- Evaluate and return the expression at a given key in a map.
- The data associated with the currently matched event.
- Returns the larger value of a or b.
- Card counts for the given block (positional index) of the note, as a {Count, Active} map: Count includes suspended cards, Active excludes them.
- Whether any Card's context links to the given block (positional index) of the note. Suspended cards count: the marker is the trace back to the card.
- Every card in the repo, due-ordered, fuzzy-filtered on front and back text, as {CardId, Front, Back, Suspended, DueUnixMs} maps.
- Build a card modification for a MemorizeEditOp code: suspend/unsuspend, unlink, reset progress, or replace a side's text (arg).
- Read a named field off a Card content value: Front or Back (the side's Note), FrontText/BackText (the side flattened to plain text), or ContextNote (the linked note's DatumId; errors when unlinked).
- A fresh Card (content only) from front text, back text, and an optional {Note, Block} context map (empty map = no context).
- The cards anchored to one block of a note (suspended included), as {CardId, Front, Suspended} maps.
- The unsuspended Card datums whose context links to the note, as an Array of {CardId, Block} maps.
- One completed review of the card at the current wall-clock time: writes the complete post-review state atomically and appends the log entry. Rating codes: 1 Again, 2 Hard, 3 Good, 4 Easy.
- Card counts for every block of the note in one walk, as a Map keyed by block id of {Count, Active} maps (Count includes suspended cards, Active excludes them).
- The interval previews (formatted time to next review for Again/Hard/Good/Easy, e.g. "10m" or "15d") a grade on the study state would produce, as a four-element Text Array.
- The undo-latest modification: removes the study record's last review log entry; the schedule follows because the state is a fold of the log. A no-op on an empty log.
- Read a named field off a CardStudy value: Suspended, Phase, DueUnixMs, Reps, or Lapses.
- The study datum id for the card, an evaluation error when the card was never studied.
- A fresh CardStudy for the card: rating 0 seeds never-reviewed state, 1-4 seed the first completed review. Materializes the study datum on a card's first grade or suspend.
- Returns the smaller value of a or b.
- Produce a modification that sets a ComponentAction cell.
- Produce a modification that inserts a value into an Array cell at an index.
- Produce a modification that pushes a value onto an Array cell.
- Produce a modification that removes an element from an Array cell by index.
- Produce a modification that sets an element in an Array cell at an index.
- Produce a modification that sets a Bool cell.
- Produce a modification that sets a MatchableButtonStateChange cell.
- Produce a modification that removes a key from a CellMap cell.
- Produce a modification that sets a definition in a CellMap cell.
- Produce a modification that replaces a cell with a Color value.
- Produce a modification that sets a DatumId cell.
- Produce a modification that inserts a MatchOn pair into an EventHandler cell.
- Produce a modification that removes a pair from an EventHandler cell by index.
- Produce a modification that sets a FixPoint cell.
- Replace a function while preserving type-compatible arguments from the current expression.
- Produce a modification that replaces a cell with a function value.
- Produce a modification that sets a MatchableKeyboardKey cell.
- Produce a modification that removes a key from a Map cell.
- Produce a modification that sets a key in a Map cell.
- Produce a modification that sets a MatchOn cell.
- Produce a modification that sets a MatchableMouseButton cell.
- Produce a modification that appends a paragraph block to a Note.
- ModifyNoteRangeToggleMark::start_block Number->start_offset Number->end_block Number->end_offset Number->mark_type Any->ExprModificationBuild a Note modification that toggles a mark on a half-open cross-block range. Same-block selection is the degenerate one-block case.
- ModifyNoteReplace::start_block Number->start_offset Number->end_block Number->end_offset Number->text Text->ExprModificationBuild a Note modification that replaces a half-open cross-block range with `text`, parsed as markdown. Empty `text` is a pure range-delete.
- Build a structural Note(SplitBlock) modification.
- Produce a modification that sets a Number cell.
- Produce a modification that replaces a cell with an arbitrary value.
- Produce a modification that inserts an action into a RespondWith cell at an index.
- Produce a modification that removes an action from a RespondWith cell by index.
- Produce a modification that inserts an inline component into a Text cell.
- Produce a modification that splices a Text cell.
- Produce a modification that toggles a mark on a range of a Text cell.
- Produce a modification that sets the DatumId of a View cell.
- Produce a modification that appends a view block to a Workspace cell.
- Produce a modification that removes a view block from a Workspace cell by index.
- Negate a number.
- Create a sub-index literal using a type and and the expected arguments.
- The CellMap which defines the node.
- Information about the cells defined on a node.
- Get information about the subcomponents of a node.
- The view generating a node in the UI.
- The length (depth) of the node path.
- The number of blocks in a Note.
- Resolve a positional block index to the Note block path keyed by its BlockId.
- The plain text content of a note's block at a positional index; empty for out-of-range indices and non-text blocks.
- Grapheme count of the text content of the block at `block_idx`.
- Build a structural Note modification for BlockTransformKind (encoded as kind_code) at block_idx.
- Estimated total rendered extent of a Note in pixels, from the per-variant block estimates the virtualization window uses.
- Build a Note modification inserting BlockTemplate (encoded as template_code) below block_idx.
- Build a Note modification inserting a custom block (View) at block_idx.
- Count-bound visible block window of a Note around an anchor block, with estimated spacer extents and cursor-bearing blocks pinned into the materialized set. Non-positive viewport disables windowing (full range).
- Logical OR.
- List the cells in the component which are marked as overrideable.
- Reference a cell in a parent component by name.
- Get the absolute path of a cell in a parent component.
- Get the parent path of a given node path.
- Get the size of the angle in radians.
- True when the integer index lies in [range.Start, range.End).
- Repeats some value some number of times. Does not evaluate to_repeat.
- Repeats the given text a number of times.
- The height of the screen.
- The width of the screen.
- Highlighted Map{Start,End} range over a value, projected from anchor/focus cursors.
- Curated and user slash-menu items for a context code, fuzzy-filtered by `filter`.
- The stable block id of the deepest note-block step in the value's Source path, an evaluation error when the source has no block step.
- The datum id at the root of the value's Source, an evaluation error for values without a persisted source.
- Return up to 3 spelling suggestions for the word in text at the given {Start, End} grapheme range.
- The values of the named column across a Table's rows, in row order. Sparse cells read the column type's default.
- A read-only Table of accessible datums (Title, Type, Starred columns), filtered by a created-by filter ("User", "Common", "All") and an optional fuzzy title filter. Only user datums appear as rows; builtin components are never included. "Common" always yields an empty table; "All" is equivalent to "User".
- Build a structural Table modification for TableStructureOp (encoded as op_code): insert/remove rows and columns, or set a column's type.
- Join two texts together into a single text.
- The length of the text in characters.
- Convert text into a displayable shape.
- Returns the input text with the first n characters dropped.
- Split the text using the specified pattern.
- Take the first n characters from some text.
- Get the absolute path of the evaluating node.
- Convert a fractional number into an integer.
- Convert an expression into a short readable display.
- Performs a matrix transpose operation on an array of arrays.
- The text with leading and trailing whitespace removed.
- Try returning the result from the expression. If that fails then return the default value.
- Creates a view from a component doc and a set of overrides.
- The id of the component datum being referenced.
- The overrides set in the view.
- Sets cells on a component or overrides on a View, keeping any already present.
- Sets cells on a component. Sets overrides on a View.
- Get the start and end grapheme indices of the word at the given index.
- The number of blocks in the workspace.
- An array of Views pointing to the Workspaces blocks.
- Combine two arrays elementwise with a two-argument function, truncating to the shorter array.