Typed fences for arrays, matrices, tables, trees, linked lists, stacks, queues, hash maps, bit patterns, and memory diagrams.
These fences draw a data structure from YAML and step through changes to it. Use them to explain an algorithm, a database internal, or a runtime behavior, with each step’s reasoning in a note.Every fence here follows the shared rules for steps, meta strings, playback, and validation. Each key table lists the exact keys the linter accepts.
array
One or more arrays on a shared index axis, with pointers, dependency arrows, and span brackets. Use rows: to stack several arrays, such as nums over dp, on one index axis.A bare array fence renders when its body has values or rows. Also spelled kiwi-array, widget:array, arraystack, kiwi-arraystack.
```array id=two-sum caption="Two-pointer sweep on a sorted array"values: [2, 7, 11, 15, 19]pointers: - {index: 0, label: lo} - {index: 4, label: hi}steps: - note: "2 + 19 = 21 > 9 — move hi left" activeIndices: [0, 4] line: 3 - note: "2 + 15 = 17 > 9 — move hi left" pointers: [{index: 0, label: lo}, {index: 3, label: hi}] activeIndices: [0, 3] - note: "2 + 7 = 9 — found it" pointers: [{index: 0, label: lo}, {index: 1, label: hi}] activeIndices: [0, 1] breakpoint: truecode: | lo, hi = 0, len(a) - 1 while lo < hi: s = a[lo] + a[hi] if s == target: return lo, hi if s > target: hi -= 1 else: lo += 1lang: python```
All 30 keys
Key
Type
Description
activeColor
string
Primary highlight color. Fixed across steps.
activeIndex
array or number or string
The cell being written this step.
activeIndices
array or number or string
Cells being written this step.
ariaLabel
string
Accessible name. Defaults to a summary derived from the data. Fixed across steps.
arrows
array of object
Dependency arcs within the row: {from, to, label?, dashed?, side?}.
arrowsBetweenRows
array of object
With rows:: arrows between rows, {from: [row, index], to: [row, index], label?}.
cellColors
array
Base color per cell, matching the same items in a tree or graph.
cellSize
number
Cell size in px. Defaults to 48, shrinking for long arrays. Fixed across steps.
dimIndices
array or number or string
Done / greyed-out cells.
empty
array of string
Strings that render as unfilled slots, e.g. ["."].
flash
boolean
Pulse cells whose value changed since the previous step. Default true.
highlightColor
string
Secondary highlight color. Fixed across steps.
highlightIndices
array or number or string
Secondary highlight, e.g. the current window.
indexBase
number
First index number. Default 0. Fixed across steps.
indexLabels
array
Index captions instead of 0..n-1 — characters, amounts, ∅.
label
string
Row title in the left gutter, e.g. nums or dp.
labelWidth
number
Width of the row-label gutter in px. Fixed across steps.
offset
number
Blank cells before the first value, to line this row up under another.
pointers
array of object
Named pointers above or below cells: {index, label, color?, side?}.
props
any
Escape hatch for a widget prop whose name collides with a reserved key.
ranges
array of object
Brackets over spans: {start, end, label?, color?, side?}.
readColor
string
Color of cells read by the active cell. Fixed across steps.
readIndices
array or number or string
Cells the active cell reads from — dp[i-1], dp[c-w].
rowGap
number
Vertical gap between rows in px. Default 2, or 36 when arrows are drawn. Fixed across steps.
rows
array of object
Several rows sharing one index axis. Each entry takes the single-row keys above.
showIndices
boolean or string
Show the index row. With rows:: true, false, “last” (default) or “all”.
sublabels
array
Caption under each value — a choice arrow ↖ ↑ ←, a parent pointer.
tooltips
array
Hover text per cell.
values
array or string
Cell values. null is an unfilled slot; ±Infinity shows ∞; a string is split into characters.
wrap
boolean
Wrap long arrays onto more lines instead of scrolling. Fixed across steps.
matrix
An index-addressed grid: DP tables, game boards, adjacency and confusion matrices. Address cells as [r, c] or "r,c". Set heatmap: true to shade numeric cells, or layers: to show slices of a 3-D table as tabs.A bare matrix fence renders when its body has values or layers. Also spelled kiwi-matrix, widget:matrix, grid, kiwi-grid, dp.
```matrix id=lcs caption="Longest common subsequence of ABC and AC"rowHeaders: ["", A, B, C]colHeaders: ["", A, C]values: - [0, 0, 0] - [0, 1, 1] - [0, 1, 1] - [0, 1, 2]steps: - note: "Characters match: take the diagonal and add one" activeCells: [[1, 1]] readCells: [[0, 0]] line: 4 - note: "No match: carry the better of above and left" activeCells: [[2, 2]] readCells: [[1, 2], [2, 1]] line: 6 - note: "Match again — the answer is 2" activeCells: [[3, 2]] readCells: [[2, 1]] path: [[3, 2], [2, 1], [1, 1]]code: | for i in range(1, n + 1): for j in range(1, m + 1): if a[i-1] == b[j-1]: dp[i][j] = dp[i-1][j-1] + 1 else: dp[i][j] = max(dp[i-1][j], dp[i][j-1])lang: python```
All 31 keys
Key
Type
Description
activeCell
array or string or object
The cell being written this step.
activeCells
array or string or object
Cells being written this step.
activeColor
string
Primary highlight color. Fixed across steps.
ariaLabel
string
Accessible name. Defaults to a summary derived from the data. Fixed across steps.
arrows
array of object
Dependency arrows between cells: {from, to, label?, dashed?}.
cellColors
array of array
Base color per cell.
cellSize
number
Cell size in px. Defaults to 44, shrinking for wide tables. Fixed across steps.
centerRows
boolean or string
Ragged mode: "start" for a staircase, "center" for a pyramid. Fixed across steps.
colHeaders
array
Captions per column — the characters of a string, item weights, bit place values.
colPointers
array of object
Column labels above the table: {col, label, color?}.
dimCells
array or string or object
Dimmed cells.
empty
array of string
Strings that render as unfilled slots, e.g. ["."].
flash
boolean
Pulse cells whose value changed since the previous step. Default true.
heatmap
boolean or object
Shade numeric cells by value. true uses the table’s own min/max.
highlightCells
array or string or object
Secondary highlight.
highlightColor
string
Secondary highlight color. Fixed across steps.
layer
number
Index of the slice to show. Readers can still click the tabs.
layers
array of object
Slices of a 3-D table as tabs: {label, values}. The shown slice replaces values.
mask
string or array
"lower" or "upper" to grey out the unused triangle, or an explicit cell list.
path
array
A traceback path drawn as a line over the cells.
pathColor
string
Color of the traceback path. Fixed across steps.
props
any
Escape hatch for a widget prop whose name collides with a reserved key.
readCells
array or string or object
Cells the active cell reads from — diagonal, above, left.
readColor
string
Color of cells read by the active cell. Fixed across steps.
roundCells
boolean
Circular cells instead of squares, for coin and token grids. Fixed across steps.
rowHeaders
array
Captions per row.
rowPointers
array of object
Row labels right of the table: {row, label, color?}.
showIndices
boolean
Show row and column indices. Default true. Fixed across steps.
sublabels
array of array
Small caption under each value — a choice arrow, a parent pointer.
tooltips
array of array
Hover text per cell.
values
array of array
string
Rows of cell values. Rows may differ in length (ragged / triangular). null is unfilled, ±Infinity shows ∞, booleans show T/F.
table
A named-column table: relations, schemas, lock tables, MVCC row versions, decision tables. Address cells as "rowKey.colKey". Set fromData: <kind> to render the records of a kiwi-data block on the same page, so the dataset and the walkthrough that animates it share one source.The why map below lets a reader click a cell and read why it says what it says.A bare table fence renders when its body has columns or rows or fromData. Also spelled kiwi-table, widget:table, relation.
```table id=sev caption="Severity ladder"columns: - {key: sev, label: Sev, pk: true} - {key: response, label: Response} - {key: ack, label: Ack target, align: right}rows: - {sev: SEV1, response: Page IM + exec bridge, ack: 5m} - {sev: SEV2, response: Page on-call + team lead, ack: 15m} - {sev: SEV3, response: "Slack #platform-oncall", ack: 1h}why: SEV2.response: > Team lead, not the exec bridge: a SEV2 that pulls in leadership stops being a SEV2 and starts being a meeting.```
All 26 keys
Key
Type
Description
activeCells
array or number or string
Cells written this step, as "rowKey.colKey" or [rowKey, colKey].
activeColor
string
Primary highlight color. Fixed across steps.
activeRows
array or number or string
Row keys active this step.
ariaLabel
string
Accessible name. Defaults to a summary derived from the data. Fixed across steps.
arrows
array of object
Cell-to-cell references: {from: "r.c", to: "r.c", label?, color?}. Drawn as a ↳ glyph in the source cell, with the target in its tooltip — not a line.
caption
string
Caption under the table. Fixed across steps.
columns
array of object
string
{key, label?, pk?, fk?: {table, column} | "table.column", align?, width?, type?}, or a bare key string. Omit to infer one column per key seen in the rows, in first-seen order. Fixed across steps.
deletedRows
array or number or string
Rows removed this step, struck through.
dimCells
array or number or string
Dimmed cells.
dimRows
array or number or string
Dimmed row keys.
fromData
string
Render the records of a kiwi-data block on the same page, by its kind. The dataset and the walkthrough that animates it then share one source. Fixed across steps.
highlightCells
array or number or string
Secondary-highlighted cells.
highlightColor
string
Secondary highlight color. Fixed across steps.
highlightCols
array or number or string
Highlighted column keys — the join key, the column being scanned.
highlightRows
array or number or string
Secondary-highlighted row keys.
insertedRows
array or number or string
Rows added this step, drawn green with a + gutter.
maxHeight
number
Scroll past this height, px. Default 420. Fixed across steps.
maxRows
number
Render at most this many rows, then a “…n more” line. Ignored unless a non-negative number. Fixed across steps.
props
any
Escape hatch for a widget prop whose name collides with a reserved key.
rowKey
string
Column whose value identifies a row. Defaults to the pk column. Fixed across steps.
rows
array of object
One object per row, keyed by column key.
selected
array or number or string
Cells drawn as selected.
showIndices
boolean
Unused; accepted so table and matrix bodies are interchangeable. Fixed across steps.
sort
object or string
Sort indicator only: {key, dir} or a column key. Rows render in the order given.
why
any
Cell key → explanation, revealed when the reader selects it.
widgetId
string
Name for the inspect bus, for cross-widget linking. Fixed across steps.
tree
Binary, n-ary, and keyed trees. Nest nodes under root:, or use one of the shortcuts: fromArray builds a heap (and draws its backing array beside it), parents builds a union-find forest, and keys on a node turns it into a B-tree page.A bare tree fence renders when its body has root or roots or parents or fromArray. Also spelled kiwi-tree, widget:tree.
```tree id=heap caption="Sift-down after popping the root"fromArray: [1, 3, 2, 7, 5, 9]steps: - note: "Pop the root; move the last element up" activeNodes: [0] - note: "9 is bigger than both children — swap with the smaller, 2" activeNodes: [0, 2] highlightNodes: [1] - note: "Heap property restored" dimNodes: [0, 1, 2]```
All 29 keys
Key
Type
Description
activeColor
string
Primary highlight color. Fixed across steps.
activeKeys
object
Which key cells light inside a keyed page: {nodeId: [keyIndex, …]}.
activeNodes
array or number or string
Node keys active this step.
animate
boolean
Glide nodes to new positions when the tree changes. Default true. Fixed across steps.
ariaLabel
string
Accessible name. Defaults to a summary derived from the data. Fixed across steps.
arity
number
fromArray children per node. 2 (default) for a binary heap. Fixed across steps.
badges
object
Badge per node key — subtree size, the range a segment-tree node covers.
dimNodes
array or number or string
Dimmed (already processed) node keys.
edgeDirection
none | down | up
Arrowheads on edges. “up” for parent pointers and union-find. Fixed across steps.
fromArray
array
Build a complete heap from an array: ids are indices, children of i are 2i+1/2i+2. Pair with an array fence and link: for the two-representation view.
ghostEdges
array of object
Edges that no longer exist, drawn dashed: {from, to, label?} — the old link after a rotation.
hGap
number
Horizontal gap between sibling subtrees, px. Fixed across steps.
highlightColor
string
Secondary highlight color. Fixed across steps.
highlightEdges
array or number or string
Child keys, or "parent->child", whose edge lights up.
highlightNodes
array or number or string
Secondary-highlighted node keys.
keyCell
number
Width of one key cell in a keyed page, px. Default 30. Fixed across steps.
Several trees side by side — a disjoint-set forest, a trie split per letter.
showEdgeLabels
boolean
Show each node’s edgeLabel. Default true. Fixed across steps.
showNulls
boolean
Dashed empty slot on the missing side of a one-child binary node. Default true. Fixed across steps.
vGap
number
Vertical gap between levels, px. Fixed across steps.
withArray
boolean
With fromArray: also draw the backing array beside the tree, highlights kept in step. Default true. Fixed across steps.
list
A linked list. Each node’s next defaults to the following node. next: false ends the list, and a number points back to that index, which is how you draw a cycle.A bare list fence renders when its body has nodes. Also spelled kiwi-list, widget:list, linkedlist, linked-list, kiwi-linkedlist.
```list id=floyd caption="Floyd's cycle detection"nodes: - {value: 1} - {value: 2} - {value: 3} - {value: 4} - {value: 5, next: 2}steps: - note: "slow and fast both start at the head" pointers: [{index: 0, label: slow}, {index: 0, label: fast}] - note: "slow moves one, fast moves two" pointers: [{index: 1, label: slow}, {index: 2, label: fast}] - note: "fast has entered the cycle" pointers: [{index: 2, label: slow}, {index: 4, label: fast}] - note: "They meet inside the cycle — there is one" pointers: [{index: 3, label: "slow,fast"}] activeIndex: 3 breakpoint: true```
All 13 keys
Key
Type
Description
nodes
array of object
Required.{value, next?}. next omitted or true means the following node, false means null, a number means that index — a cycle.
activeColor
string
Primary highlight color. Fixed across steps.
activeIndex
number
Index of the active node.
ariaLabel
string
Accessible name. Defaults to a summary derived from the data. Fixed across steps.
dimIndices
array or number or string
Dimmed indices.
doubly
boolean
Draw a backward arrow beside each forward one. Fixed across steps.
edges
array of object
Arcs over the chain: {from, to, label?, side?: "above"|"below"} — random pointers, child links.
highlightColor
string
Secondary highlight color. Fixed across steps.
highlightIndices
array or number or string
Secondary-highlighted indices.
nodeWidth
number
Node width, px. Fixed across steps.
pointers
array of object
Named pointers: {index, label, color?} — slow, fast, prev, curr.
props
any
Escape hatch for a widget prop whose name collides with a reserved key.
showNull
boolean
Draw a null terminator. Default true. Fixed across steps.
stack
A LIFO stack, drawn bottom to top: monotonic stacks, bracket matching, call stacks, undo histories.A bare stack fence renders when its body has values. Also spelled kiwi-stack, widget:stack.
```stack id=monotonic title=stack caption="Next greater element"values: []steps: - note: "Push 2" values: [2] - note: "1 is smaller — push it too" values: [2, 1] - note: "5 pops everything smaller: 1 and 2 both get their answer" values: [2, 1] activeIndex: 1 - note: "Stack holds only 5" values: [5]```
All 17 keys
Key
Type
Description
values
array or string
Required. Items from the bottom of the stack to the top.
activeColor
string
Primary highlight color. Fixed across steps.
activeIndex
number
Index of the active item. Defaults to the top.
ariaLabel
string
Accessible name. Defaults to a summary derived from the data. Fixed across steps.
dimIndices
array or number or string
Dimmed indices.
empty
string
Text shown when there are no items. Default “(empty)”. Fixed across steps.
growth
top | bottom
Which end the top of the stack is drawn at. Default top. Fixed across steps.
highlightColor
string
Secondary highlight color. Fixed across steps.
highlightIndices
array or number or string
Secondary-highlighted indices.
itemHeight
number
Item height, px. Fixed across steps.
itemWidth
number
Item width, px. Fixed across steps.
maxHeight
number
Scroll past this height, px. Default 300. Fixed across steps.
pointers
array of object
Markers beside items: {index, label, color?}.
props
any
Escape hatch for a widget prop whose name collides with a reserved key.
showIndices
boolean
Show the index of each item. Default true. Fixed across steps.
title
string
Caption above the stack. Fixed across steps.
topLabel
string
Caption on the open end. Default “top”. Fixed across steps.
queue
A FIFO queue: BFS frontiers, work queues, sliding windows. Set layout: ring to draw a circular buffer, where front and back wrapping past the end is the point.A bare queue fence renders when its body has values. Also spelled kiwi-queue, widget:queue, ringbuffer, ring-buffer.
```queue id=ring caption="A ring buffer wrapping past the end"layout: ringcapacity: 6values: [null, null, null, null, null, null]front: 0back: 0steps: - note: "Empty: front and back coincide" size: 0 - note: "Enqueue three; back advances" values: [a, b, c, null, null, null] back: 3 size: 3 activeIndices: [2] - note: "Dequeue two; front advances, the slots are not cleared" values: [a, b, c, null, null, null] front: 2 back: 3 size: 1 dimIndices: [0, 1] - note: "Enqueue four more — back wraps past the end to slot 1" values: [g, h, c, d, e, f] front: 2 back: 2 size: 6 activeIndices: [0, 1]```
All 24 keys
Key
Type
Description
values
array
Required. Slot contents. In ring layout this is the whole buffer, with null for an empty slot.
activeColor
string
Primary highlight color. Fixed across steps.
activeIndices
array or number or string
Slots active this step.
ariaLabel
string
Accessible name. Defaults to a summary derived from the data. Fixed across steps.
back
number
Index one past the tail — where the next enqueue lands.
backLabel
string
Label on the tail end. Default “back”. Fixed across steps.
capacity
number
Buffer size, at most 1024. Defaults to values.length. Fixed across steps.
dimIndices
array or number or string
Dimmed slots.
empty
string
Text shown when every slot is empty. Fixed across steps.
front
number
Index of the head, wrapped into the buffer. Defaults to 0, where the front marker is drawn.
frontLabel
string
Label on the head end. Default “front”. Fixed across steps.
highlightColor
string
Secondary highlight color. Fixed across steps.
highlightIndices
array or number or string
Secondary-highlighted slots.
layout
horizontal | ring
Default horizontal. Fixed across steps.
pointers
array of object
Extra markers beside slots: {index, label, color?}. In a ring the index wraps.
props
any
Escape hatch for a widget prop whose name collides with a reserved key.
radius
number
Ring radius, px. Defaults to whatever fits the slots, at least 86. Fixed across steps.
selected
array or number or string
Slot indices drawn as selected.
showIndices
boolean
Show slot indices. Default true. Fixed across steps.
size
number
How many slots hold data, counted from front. Tells a full ring from an empty one when front and back coincide; slots outside the window draw as stale.
slotSize
number
Slot size, px. Default 44. Fixed across steps.
title
string
Caption above the queue. Fixed across steps.
why
any
Slot index → explanation, revealed on select.
widgetId
string
Name for the inspect bus. Fixed across steps.
map
Hash slots, chains, and probe paths. Without a mode, slots draw as chained buckets and entries as a plain dictionary. Set mode: open for open addressing with tombstones.A bare map fence renders when its body has slots or entries. Also spelled kiwi-map, widget:map, hashmap, hashtable, kiwi-hashmap.
Accessible name. Defaults to a summary derived from the data. Fixed across steps.
capacity
number
Slot count, 0–1024. Defaults to slots.length.
dimSlots
array or number or string
Dimmed slots.
entries
array or object
[{key, value?}] for mode: "map" — a frequency map, a seen-set. A plain {key: value} object works too.
hashOf
object
Key → slot, shown as an h(k)=i badge beside the key in every mode.
highlightColor
string
Secondary highlight color. Fixed across steps.
highlightSlots
array or number or string
Secondary-highlighted slots.
mode
chain | open | map
How to draw it: “chain” for buckets, “open” for open addressing with tombstones, “map” for an unordered dictionary. Inferred from slots / entries. Fixed across steps.
probePath
array of number
Slots visited in order, numbered above the row and joined by arrows.
props
any
Escape hatch for a widget prop whose name collides with a reserved key.
selected
array or number or string
Slot indices drawn as selected; keys in mode: "map".
showIndices
boolean
Index captions under the slots. Default true. Fixed across steps.
showLoadFactor
boolean
Show α = n/m: entries per slot for chaining, occupied slots for open addressing. Default true. Fixed across steps.
slots
array
One entry per slot: null empty, "DEL" a tombstone, {key, value?} or a bare key, or a list of those for a chain.
slotWidth
number
Slot width, px. Default 54. Fixed across steps.
tombstones
array or number or string
Slots holding a tombstone, if not already "DEL".
why
any
Slot index (key in mode: "map") → explanation, revealed on select.
widgetId
string
Name for the inspect bus, for cross-widget linking. Fixed across steps.
bits
A value as labelled bits: bitmask DP, flag registers, permission sets, two’s complement, IEEE-754 layouts. fields brackets named bit ranges, and decode chooses how the summary row reads the pattern.A bare bits fence renders when its body has value. Also spelled kiwi-bits, widget:bits, bitmask.
```bits id=subsets caption="Bitmask DP: visiting city 2"bits: 4labels: [A, B, C, D]steps: - note: "Start at A only" value: 1 activeBits: [0] - note: "Add C to the visited set" value: 5 activeBits: [2] readBits: [0] - note: "All four visited — the subproblem is complete" value: 15 activeBits: [1, 3]```
All 18 keys
Key
Type
Description
value
number or string
Required. The value to show. A number, or a "0x…" / "0b…" string for 64-bit patterns a JS number cannot hold exactly.
activeBits
array or number or string
Bit positions being set or tested this step.
activeColor
string
Primary highlight color. Fixed across steps.
ariaLabel
string
Accessible name. Defaults to a summary derived from the data. Fixed across steps.
arrows
array of object
Arcs between bit positions: {from, to, label?, dashed?}.
bits
number
How many bits to draw. Defaults to the value’s bit length. Fixed across steps.
cellSize
number
Cell size, px. Fixed across steps.
decode
uint | int | twos | ieee32 | ieee64 | hex | oct | raw
How to read the pattern in the summary row. A list shows several readings at once. Default uint.
fields
array of object
Named bit ranges drawn as brackets under the row: {from, to, label, color?} — a float’s sign, exponent and mantissa; a flags register; a packed struct. Each bracket shows the field’s value.
highlightBits
array or number or string
Secondary-highlighted bit positions.
highlightColor
string
Secondary highlight color. Fixed across steps.
label
string
Row title, e.g. mask.
labels
array
What each bit stands for, indexed by bit position (bit 0 = least significant).
lsbFirst
boolean
Draw bit 0 on the left. Default false (most significant first). Fixed across steps.
pointers
array of object
Pointers by bit position: {bit, label, color?, side?}.
props
any
Escape hatch for a widget prop whose name collides with a reserved key.
readBits
array or number or string
Bit positions read by this step.
showSummary
boolean
Show the decimal value and popcount beside the bits. Default true. Fixed across steps.
memory
Frames on the left, heap objects on the right, pointers between them: aliasing, mutation, closures, recursion. The props follow the Python Tutor trace format, so a recorded trace drops straight in. A frame variable written as [REF, id] points into the heap.A bare memory fence renders when its body has frames or heap. Also spelled kiwi-memory, widget:memory, heap, stack-heap.
```memory id=alias caption="Why mutating b changed a"frames: - name: "<module>" vars: {a: [REF, 1], b: [REF, 1]}heap: 1: [LIST, 1, 2, 3]steps: - note: "a = [1, 2, 3] allocates one list" frames: - {name: "<module>", vars: {a: [REF, 1]}} activeIds: [1] - note: "b = a copies the pointer, not the list — both names are the one object" frames: - {name: "<module>", vars: {a: [REF, 1], b: [REF, 1]}} activeIds: [1] - note: "b.append(4) mutates that object, so a sees it too" heap: 1: [LIST, 1, 2, 3, 4] activeIds: [1] breakpoint: true```
All 15 keys
Key
Type
Description
activeColor
string
Primary highlight color. Fixed across steps.
activeFrame
string or number
Which frame is executing: a frame id, or a number for its index in frames. Defaults to the innermost.
activeIds
array or number or string
Heap ids to emphasise this step.
ariaLabel
string
Accessible name. Defaults to a summary derived from the data. Fixed across steps.
dimIds
array or number or string
Dimmed heap ids — garbage, or a frame about to return.
frames
array of object
Call stack, outermost first: {name, id?, vars: {k: value}, order?, returned?, active?}. A value of [REF, id] points into the heap.
framesLabel
string
Caption above the frames column. Default “Frames”. Fixed across steps.
heap
object
Objects by id, tagged: ["LIST", 1, 2], ["DICT", ["k", 1]], ["INSTANCE", "Node", ["val", 1]], ["TUPLE", …], ["SET", …]. An untagged {field: value} draws as an object’s fields.
heapLabel
string
Caption above the heap column. Default “Objects”. Fixed across steps.
highlightColor
string
Secondary highlight color. Fixed across steps.
highlightIds
array or number or string
Secondary-highlighted heap ids.
inlinePrimitives
boolean
Draw a frame variable’s primitive inside its slot. Default true; false boxes each one on the heap with an arrow, Python Tutor’s “render all objects on the heap”. Fixed across steps.
props
any
Escape hatch for a widget prop whose name collides with a reserved key.
why
any
Heap id → explanation, revealed on select.
widgetId
string
Name for the inspect bus. Fixed across steps.
Related
Widgets overview
Fence names, steps, playback, and validation.
Charts and plots
plot, bars, numberline, plane, timeline, and more.
Diagrams
graph, sequence, steps, Mermaid, and D2.
Data and queries
kiwi-data records that a table can animate.
Last modified on October 19, 2026
⌘I
{"docsConfig":{"theme":"maple","$schema":"https://mintlify.com/docs.json","name":"KiwiFS — Markdown filesystem for agents and teams","colors":{"primary":"#6cbe45","light":"#7dd356","dark":"#4a8a2a"},"logo":{"light":"https://mintcdn.com/kiwifs/71yiWv72s5YuFel2/logo/light.svg?fit=max\u0026auto=format\u0026n=71yiWv72s5YuFel2\u0026q=85\u0026s=14b8be7497781b1b39436e90a18dea8d","dark":"https://mintcdn.com/kiwifs/71yiWv72s5YuFel2/logo/dark.svg?fit=max\u0026auto=format\u0026n=71yiWv72s5YuFel2\u0026q=85\u0026s=ecac9439f62749b63e73584de9b85c22","href":"https://github.com/kiwifs/kiwifs"},"favicon":"https://mintcdn.com/kiwifs/71yiWv72s5YuFel2/logo/kiwifs.png?fit=max\u0026auto=format\u0026n=71yiWv72s5YuFel2\u0026q=85\u0026s=b9cd7235191a881cb17e4eecd25cd2e6","appearance":{"default":"system"},"background":{"decoration":"gradient"},"navbar":{"links":[{"href":"https://github.com/kiwifs/kiwifs","label":"GitHub","type":"github"}]},"footer":{"socials":{"github":"https://github.com/kiwifs"}},"search":{"prompt":"Search KiwiFS docs..."},"seo":{"metatags":{"canonical":"https://docs.kiwifs.com"},"indexing":"navigable"},"fonts":{"heading":{"family":"Space Grotesk","weight":700},"body":{"family":"Inter","weight":400}},"contextual":{"options":["copy","view","claude","chatgpt","cursor","mcp"],"display":"header"},"metadata":{"timestamp":true},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/kiwifs/kiwifs"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"kiwifs","hasAudioNarration":false,"actualSubdomain":"kiwifs","customDomains":["docs.kiwifs.com"],"gitSource":{"type":"github","owner":"kiwifs","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ad68890a9de37fe101e4ab2","clientVersion":"0.0.4160","searchFilterCounts":[{"language":"default","tag":"Documentation","count":55},{"language":"default","tag":"Core Concepts","count":23},{"language":"default","tag":"API Reference","count":20},{"language":"default","tag":"REST API","count":19},{"language":"default","tag":"Guides","count":8},{"language":"default","tag":"Widgets","count":7},{"language":"default","tag":"Data Import","count":7},{"language":"default","tag":"Deployment","count":5},{"language":"default","tag":"Getting Started","count":3},{"language":"default","tag":"Data Export","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"widgets/data-structures","slug":"/widgets/data-structures","pageMetadata":{"title":"Data structure widgets","sidebarTitle":"Data structures","description":"Typed fences for arrays, matrices, tables, trees, linked lists, stacks, queues, hash maps, bit patterns, and memory diagrams.","icon":"cubes","href":"/widgets/data-structures"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Typed fences for arrays, matrices, tables, trees, linked lists, stacks, queues, hash maps, bit patterns, and memory diagrams.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{Accordion,Card,CardGroup,CodeBlock,Heading,Table}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`These fences draw a data structure from YAML and step through changes to it. Use them to explain an algorithm, a database internal, or a runtime behavior, with each step’s reasoning in a `,_jsx(_components.code,{children:`note`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Every fence here follows the shared rules for `,_jsx(_components.a,{href:`/concepts/widgets#writing-a-typed-fence`,children:`steps, meta strings, playback, and validation`}),`. Each key table lists the exact keys the linter accepts.`]}),`\n`,_jsx(Heading,{level:`2`,id:`array`,children:`array`}),`\n`,_jsxs(_components.p,{children:[`One or more arrays on a shared index axis, with pointers, dependency arrows, and span brackets. Use `,_jsx(_components.code,{children:`rows:`}),` to stack several arrays, such as `,_jsx(_components.code,{children:`nums`}),` over `,_jsx(_components.code,{children:`dp`}),`, on one index axis.`]}),`\n`,_jsxs(_components.p,{children:[`A bare `,_jsx(_components.code,{children:`array`}),` fence renders when its body has `,_jsx(_components.code,{children:`values`}),` or `,_jsx(_components.code,{children:`rows`}),`. Also spelled `,_jsx(_components.code,{children:`kiwi-array`}),`, `,_jsx(_components.code,{children:`widget:array`}),`, `,_jsx(_components.code,{children:`arraystack`}),`, `,_jsx(_components.code,{children:`kiwi-arraystack`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`25`,language:`markdown`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`markdown`,children:_jsxs(_components.code,{language:`markdown`,numberOfLines:`25`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:'```array id=two-sum caption=\"Two-pointer sweep on a sorted array\"'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`values: [2, 7, 11, 15, 19]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`pointers:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {index: 0, label: lo}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {index: 4, label: hi}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`steps:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"2 + 19 = 21 > 9 — move hi left\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeIndices: [0, 4]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` line: 3`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"2 + 15 = 17 > 9 — move hi left\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` pointers: [{index: 0, label: lo}, {index: 3, label: hi}]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeIndices: [0, 3]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"2 + 7 = 9 — found it\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` pointers: [{index: 0, label: lo}, {index: 1, label: hi}]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeIndices: [0, 1]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` breakpoint: true`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`code: |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` lo, hi = 0, len(a) - 1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` while lo \u003c hi:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` s = a[lo] + a[hi]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` if s == target: return lo, hi`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` if s > target: hi -= 1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` else: lo += 1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`lang: python`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:\"```\"})}),`\n`]})})}),`\n`,_jsx(Accordion,{title:`All 30 keys`,id:`all-30-keys`,children:_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Key`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Primary highlight color. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeIndex`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`The cell being written this step.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeIndices`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Cells being written this step.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ariaLabel`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Accessible name. Defaults to a summary derived from the data. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`arrows`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Dependency arcs within the row: `,_jsx(_components.code,{children:`{from, to, label?, dashed?, side?}`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`arrowsBetweenRows`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`With `,_jsx(_components.code,{children:`rows:`}),`: arrows between rows, `,_jsx(_components.code,{children:`{from: [row, index], to: [row, index], label?}`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`cellColors`})}),_jsx(_components.td,{children:`array`}),_jsx(_components.td,{children:`Base color per cell, matching the same items in a tree or graph.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`cellSize`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Cell size in px. Defaults to 48, shrinking for long arrays. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`dimIndices`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Done / greyed-out cells.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`empty`})}),_jsx(_components.td,{children:`array of string`}),_jsxs(_components.td,{children:[`Strings that render as unfilled slots, e.g. `,_jsx(_components.code,{children:`[\".\"]`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`flash`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Pulse cells whose value changed since the previous step. Default true.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Secondary highlight color. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightIndices`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Secondary highlight, e.g. the current window.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`indexBase`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`First index number. Default 0. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`indexLabels`})}),_jsx(_components.td,{children:`array`}),_jsxs(_components.td,{children:[`Index captions instead of 0..n-1 — characters, amounts, `,_jsx(_components.code,{children:`∅`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`label`})}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[`Row title in the left gutter, e.g. `,_jsx(_components.code,{children:`nums`}),` or `,_jsx(_components.code,{children:`dp`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`labelWidth`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Width of the row-label gutter in px. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`offset`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Blank cells before the first value, to line this row up under another.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`pointers`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Named pointers above or below cells: `,_jsx(_components.code,{children:`{index, label, color?, side?}`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`props`})}),_jsx(_components.td,{children:`any`}),_jsx(_components.td,{children:`Escape hatch for a widget prop whose name collides with a reserved key.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ranges`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Brackets over spans: `,_jsx(_components.code,{children:`{start, end, label?, color?, side?}`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`readColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Color of cells read by the active cell. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`readIndices`})}),_jsx(_components.td,{children:`array or number or string`}),_jsxs(_components.td,{children:[`Cells the active cell reads from — `,_jsx(_components.code,{children:`dp[i-1]`}),`, `,_jsx(_components.code,{children:`dp[c-w]`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`rowGap`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Vertical gap between rows in px. Default 2, or 36 when arrows are drawn. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`rows`})}),_jsx(_components.td,{children:`array of object`}),_jsx(_components.td,{children:`Several rows sharing one index axis. Each entry takes the single-row keys above.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`showIndices`})}),_jsx(_components.td,{children:`boolean or string`}),_jsxs(_components.td,{children:[`Show the index row. With `,_jsx(_components.code,{children:`rows:`}),`: true, false, “last” (default) or “all”.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`sublabels`})}),_jsx(_components.td,{children:`array`}),_jsx(_components.td,{children:`Caption under each value — a choice arrow ↖ ↑ ←, a parent pointer.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`tooltips`})}),_jsx(_components.td,{children:`array`}),_jsx(_components.td,{children:`Hover text per cell.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`values`})}),_jsx(_components.td,{children:`array or string`}),_jsxs(_components.td,{children:[`Cell values. `,_jsx(_components.code,{children:`null`}),` is an unfilled slot; ±Infinity shows ∞; a string is split into characters.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`wrap`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Wrap long arrays onto more lines instead of scrolling. Fixed across steps.`})]})]})]})}),`\n`,_jsx(Heading,{level:`2`,id:`matrix`,children:`matrix`}),`\n`,_jsxs(_components.p,{children:[`An index-addressed grid: DP tables, game boards, adjacency and confusion matrices. Address cells as `,_jsx(_components.code,{children:`[r, c]`}),` or `,_jsx(_components.code,{children:`\"r,c\"`}),`. Set `,_jsx(_components.code,{children:`heatmap: true`}),` to shade numeric cells, or `,_jsx(_components.code,{children:`layers:`}),` to show slices of a 3-D table as tabs.`]}),`\n`,_jsxs(_components.p,{children:[`A bare `,_jsx(_components.code,{children:`matrix`}),` fence renders when its body has `,_jsx(_components.code,{children:`values`}),` or `,_jsx(_components.code,{children:`layers`}),`. Also spelled `,_jsx(_components.code,{children:`kiwi-matrix`}),`, `,_jsx(_components.code,{children:`widget:matrix`}),`, `,_jsx(_components.code,{children:`grid`}),`, `,_jsx(_components.code,{children:`kiwi-grid`}),`, `,_jsx(_components.code,{children:`dp`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`30`,language:`markdown`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`markdown`,children:_jsxs(_components.code,{language:`markdown`,numberOfLines:`30`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:'```matrix id=lcs caption=\"Longest common subsequence of ABC and AC\"'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`rowHeaders: [\"\", A, B, C]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`colHeaders: [\"\", A, C]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`values:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - [0, 0, 0]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - [0, 1, 1]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - [0, 1, 1]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - [0, 1, 2]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`steps:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"Characters match: take the diagonal and add one\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeCells: [[1, 1]]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` readCells: [[0, 0]]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` line: 4`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"No match: carry the better of above and left\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeCells: [[2, 2]]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` readCells: [[1, 2], [2, 1]]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` line: 6`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"Match again — the answer is 2\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeCells: [[3, 2]]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` readCells: [[2, 1]]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` path: [[3, 2], [2, 1], [1, 1]]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`code: |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` for i in range(1, n + 1):`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` for j in range(1, m + 1):`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` if a[i-1] == b[j-1]:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` dp[i][j] = dp[i-1][j-1] + 1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` else:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` dp[i][j] = max(dp[i-1][j], dp[i][j-1])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`lang: python`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:\"```\"})}),`\n`]})})}),`\n`,_jsx(Accordion,{title:`All 31 keys`,id:`all-31-keys`,children:_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Key`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`}),_jsx(_components.th,{})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeCell`})}),_jsx(_components.td,{children:`array or string or object`}),_jsx(_components.td,{children:`The cell being written this step.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeCells`})}),_jsx(_components.td,{children:`array or string or object`}),_jsx(_components.td,{children:`Cells being written this step.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Primary highlight color. Fixed across steps.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ariaLabel`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Accessible name. Defaults to a summary derived from the data. Fixed across steps.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`arrows`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Dependency arrows between cells: `,_jsx(_components.code,{children:`{from, to, label?, dashed?}`}),`.`]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`cellColors`})}),_jsx(_components.td,{children:`array of array`}),_jsx(_components.td,{children:`Base color per cell.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`cellSize`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Cell size in px. Defaults to 44, shrinking for wide tables. Fixed across steps.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`centerRows`})}),_jsx(_components.td,{children:`boolean or string`}),_jsxs(_components.td,{children:[`Ragged mode: `,_jsx(_components.code,{children:`\"start\"`}),` for a staircase, `,_jsx(_components.code,{children:`\"center\"`}),` for a pyramid. Fixed across steps.`]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`colHeaders`})}),_jsx(_components.td,{children:`array`}),_jsx(_components.td,{children:`Captions per column — the characters of a string, item weights, bit place values.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`colPointers`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Column labels above the table: `,_jsx(_components.code,{children:`{col, label, color?}`}),`.`]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`dimCells`})}),_jsx(_components.td,{children:`array or string or object`}),_jsx(_components.td,{children:`Dimmed cells.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`empty`})}),_jsx(_components.td,{children:`array of string`}),_jsxs(_components.td,{children:[`Strings that render as unfilled slots, e.g. `,_jsx(_components.code,{children:`[\".\"]`}),`.`]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`flash`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Pulse cells whose value changed since the previous step. Default true.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`heatmap`})}),_jsx(_components.td,{children:`boolean or object`}),_jsxs(_components.td,{children:[`Shade numeric cells by value. `,_jsx(_components.code,{children:`true`}),` uses the table’s own min/max.`]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightCells`})}),_jsx(_components.td,{children:`array or string or object`}),_jsx(_components.td,{children:`Secondary highlight.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Secondary highlight color. Fixed across steps.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`layer`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Index of the slice to show. Readers can still click the tabs.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`layers`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Slices of a 3-D table as tabs: `,_jsx(_components.code,{children:`{label, values}`}),`. The shown slice replaces `,_jsx(_components.code,{children:`values`}),`.`]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`mask`})}),_jsx(_components.td,{children:`string or array`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`\"lower\"`}),` or `,_jsx(_components.code,{children:`\"upper\"`}),` to grey out the unused triangle, or an explicit cell list.`]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`path`})}),_jsx(_components.td,{children:`array`}),_jsx(_components.td,{children:`A traceback path drawn as a line over the cells.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`pathColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Color of the traceback path. Fixed across steps.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`props`})}),_jsx(_components.td,{children:`any`}),_jsx(_components.td,{children:`Escape hatch for a widget prop whose name collides with a reserved key.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`readCells`})}),_jsx(_components.td,{children:`array or string or object`}),_jsx(_components.td,{children:`Cells the active cell reads from — diagonal, above, left.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`readColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Color of cells read by the active cell. Fixed across steps.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`roundCells`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Circular cells instead of squares, for coin and token grids. Fixed across steps.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`rowHeaders`})}),_jsx(_components.td,{children:`array`}),_jsx(_components.td,{children:`Captions per row.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`rowPointers`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Row labels right of the table: `,_jsx(_components.code,{children:`{row, label, color?}`}),`.`]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`showIndices`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Show row and column indices. Default true. Fixed across steps.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`sublabels`})}),_jsx(_components.td,{children:`array of array`}),_jsx(_components.td,{children:`Small caption under each value — a choice arrow, a parent pointer.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`tooltips`})}),_jsx(_components.td,{children:`array of array`}),_jsx(_components.td,{children:`Hover text per cell.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`values`})}),_jsx(_components.td,{children:`array of array`}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[`Rows of cell values. Rows may differ in length (ragged / triangular). `,_jsx(_components.code,{children:`null`}),` is unfilled, ±Infinity shows ∞, booleans show T/F.`]})]})]})]})}),`\n`,_jsx(Heading,{level:`2`,id:`table`,children:`table`}),`\n`,_jsxs(_components.p,{children:[`A named-column table: relations, schemas, lock tables, MVCC row versions, decision tables. Address cells as `,_jsx(_components.code,{children:`\"rowKey.colKey\"`}),`. Set `,_jsx(_components.code,{children:`fromData: \u003ckind>`}),` to render the records of a `,_jsx(_components.a,{href:`/widgets/data-and-queries#kiwi-data`,children:_jsx(_components.code,{children:`kiwi-data`})}),` block on the same page, so the dataset and the walkthrough that animates it share one source.`]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`why`}),` map below lets a reader click a cell and read why it says what it says.`]}),`\n`,_jsxs(_components.p,{children:[`A bare `,_jsx(_components.code,{children:`table`}),` fence renders when its body has `,_jsx(_components.code,{children:`columns`}),` or `,_jsx(_components.code,{children:`rows`}),` or `,_jsx(_components.code,{children:`fromData`}),`. Also spelled `,_jsx(_components.code,{children:`kiwi-table`}),`, `,_jsx(_components.code,{children:`widget:table`}),`, `,_jsx(_components.code,{children:`relation`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`markdown`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`markdown`,children:_jsxs(_components.code,{language:`markdown`,numberOfLines:`14`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:'```table id=sev caption=\"Severity ladder\"'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`columns:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {key: sev, label: Sev, pk: true}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {key: response, label: Response}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {key: ack, label: Ack target, align: right}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`rows:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {sev: SEV1, response: Page IM + exec bridge, ack: 5m}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {sev: SEV2, response: Page on-call + team lead, ack: 15m}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {sev: SEV3, response: \"Slack #platform-oncall\", ack: 1h}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`why:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` SEV2.response: >`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Team lead, not the exec bridge: a SEV2 that pulls in leadership stops`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` being a SEV2 and starts being a meeting.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:\"```\"})}),`\n`]})})}),`\n`,_jsx(Accordion,{title:`All 26 keys`,id:`all-26-keys`,children:_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Key`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`}),_jsx(_components.th,{})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeCells`})}),_jsx(_components.td,{children:`array or number or string`}),_jsxs(_components.td,{children:[`Cells written this step, as `,_jsx(_components.code,{children:`\"rowKey.colKey\"`}),` or `,_jsx(_components.code,{children:`[rowKey, colKey]`}),`.`]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Primary highlight color. Fixed across steps.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeRows`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Row keys active this step.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ariaLabel`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Accessible name. Defaults to a summary derived from the data. Fixed across steps.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`arrows`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Cell-to-cell references: `,_jsx(_components.code,{children:`{from: \"r.c\", to: \"r.c\", label?, color?}`}),`. Drawn as a ↳ glyph in the source cell, with the target in its tooltip — not a line.`]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`caption`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Caption under the table. Fixed across steps.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`columns`})}),_jsx(_components.td,{children:`array of object`}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`{key, label?, pk?, fk?: {table, column} | \"table.column\", align?, width?, type?}`}),`, or a bare key string. Omit to infer one column per key seen in the rows, in first-seen order. Fixed across steps.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`deletedRows`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Rows removed this step, struck through.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`dimCells`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Dimmed cells.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`dimRows`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Dimmed row keys.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`fromData`})}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[`Render the records of a `,_jsx(_components.code,{children:`kiwi-data`}),` block on the same page, by its kind. The dataset and the walkthrough that animates it then share one source. Fixed across steps.`]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightCells`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Secondary-highlighted cells.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Secondary highlight color. Fixed across steps.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightCols`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Highlighted column keys — the join key, the column being scanned.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightRows`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Secondary-highlighted row keys.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`insertedRows`})}),_jsx(_components.td,{children:`array or number or string`}),_jsxs(_components.td,{children:[`Rows added this step, drawn green with a `,_jsx(_components.code,{children:`+`}),` gutter.`]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`maxHeight`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Scroll past this height, px. Default 420. Fixed across steps.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`maxRows`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Render at most this many rows, then a “…n more” line. Ignored unless a non-negative number. Fixed across steps.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`props`})}),_jsx(_components.td,{children:`any`}),_jsx(_components.td,{children:`Escape hatch for a widget prop whose name collides with a reserved key.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`rowKey`})}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[`Column whose value identifies a row. Defaults to the `,_jsx(_components.code,{children:`pk`}),` column. Fixed across steps.`]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`rows`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`One object per row, keyed by column `,_jsx(_components.code,{children:`key`}),`.`]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`selected`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Cells drawn as selected.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`showIndices`})}),_jsx(_components.td,{children:`boolean`}),_jsxs(_components.td,{children:[`Unused; accepted so `,_jsx(_components.code,{children:`table`}),` and `,_jsx(_components.code,{children:`matrix`}),` bodies are interchangeable. Fixed across steps.`]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`sort`})}),_jsx(_components.td,{children:`object or string`}),_jsxs(_components.td,{children:[`Sort indicator only: `,_jsx(_components.code,{children:`{key, dir}`}),` or a column key. Rows render in the order given.`]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`why`})}),_jsx(_components.td,{children:`any`}),_jsx(_components.td,{children:`Cell key → explanation, revealed when the reader selects it.`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`widgetId`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Name for the inspect bus, for cross-widget linking. Fixed across steps.`}),_jsx(_components.td,{})]})]})]})}),`\n`,_jsx(Heading,{level:`2`,id:`tree`,children:`tree`}),`\n`,_jsxs(_components.p,{children:[`Binary, n-ary, and keyed trees. Nest nodes under `,_jsx(_components.code,{children:`root:`}),`, or use one of the shortcuts: `,_jsx(_components.code,{children:`fromArray`}),` builds a heap (and draws its backing array beside it), `,_jsx(_components.code,{children:`parents`}),` builds a union-find forest, and `,_jsx(_components.code,{children:`keys`}),` on a node turns it into a B-tree page.`]}),`\n`,_jsxs(_components.p,{children:[`A bare `,_jsx(_components.code,{children:`tree`}),` fence renders when its body has `,_jsx(_components.code,{children:`root`}),` or `,_jsx(_components.code,{children:`roots`}),` or `,_jsx(_components.code,{children:`parents`}),` or `,_jsx(_components.code,{children:`fromArray`}),`. Also spelled `,_jsx(_components.code,{children:`kiwi-tree`}),`, `,_jsx(_components.code,{children:`widget:tree`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`markdown`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`markdown`,children:_jsxs(_components.code,{language:`markdown`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:'```tree id=heap caption=\"Sift-down after popping the root\"'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`fromArray: [1, 3, 2, 7, 5, 9]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`steps:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"Pop the root; move the last element up\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeNodes: [0]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"9 is bigger than both children — swap with the smaller, 2\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeNodes: [0, 2]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` highlightNodes: [1]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"Heap property restored\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` dimNodes: [0, 1, 2]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:\"```\"})}),`\n`]})})}),`\n`,_jsx(Accordion,{title:`All 29 keys`,id:`all-29-keys`,children:_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Key`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Primary highlight color. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeKeys`})}),_jsx(_components.td,{children:`object`}),_jsxs(_components.td,{children:[`Which key cells light inside a keyed page: `,_jsx(_components.code,{children:`{nodeId: [keyIndex, …]}`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeNodes`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Node keys active this step.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`animate`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Glide nodes to new positions when the tree changes. Default true. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ariaLabel`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Accessible name. Defaults to a summary derived from the data. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`arity`})}),_jsx(_components.td,{children:`number`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`fromArray`}),` children per node. 2 (default) for a binary heap. Fixed across steps.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`badges`})}),_jsx(_components.td,{children:`object`}),_jsx(_components.td,{children:`Badge per node key — subtree size, the range a segment-tree node covers.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`dimNodes`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Dimmed (already processed) node keys.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`edgeDirection`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`none`}),` | `,_jsx(_components.code,{children:`down`}),` | `,_jsx(_components.code,{children:`up`})]}),_jsx(_components.td,{children:`Arrowheads on edges. “up” for parent pointers and union-find. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`fromArray`})}),_jsx(_components.td,{children:`array`}),_jsxs(_components.td,{children:[`Build a complete heap from an array: ids are indices, children of `,_jsx(_components.code,{children:`i`}),` are `,_jsx(_components.code,{children:`2i+1`}),`/`,_jsx(_components.code,{children:`2i+2`}),`. Pair with an `,_jsx(_components.code,{children:`array`}),` fence and `,_jsx(_components.code,{children:`link:`}),` for the two-representation view.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ghostEdges`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Edges that no longer exist, drawn dashed: `,_jsx(_components.code,{children:`{from, to, label?}`}),` — the old link after a rotation.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`hGap`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Horizontal gap between sibling subtrees, px. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Secondary highlight color. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightEdges`})}),_jsx(_components.td,{children:`array or number or string`}),_jsxs(_components.td,{children:[`Child keys, or `,_jsx(_components.code,{children:`\"parent->child\"`}),`, whose edge lights up.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightNodes`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Secondary-highlighted node keys.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`keyCell`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Width of one key cell in a keyed page, px. Default 30. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`nextLinks`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Same-level arrows: `,_jsx(_components.code,{children:`{from, to}`}),` — next-right pointers, the B+-tree leaf chain.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`nodeColors`})}),_jsx(_components.td,{children:`object`}),_jsx(_components.td,{children:`Base color per node key, e.g. one per connected component.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`nodeSize`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Node diameter, px. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`parents`})}),_jsx(_components.td,{children:`array or object`}),_jsxs(_components.td,{children:[`Parent pointers instead of nesting: `,_jsx(_components.code,{children:`parents[i]`}),` is the parent of `,_jsx(_components.code,{children:`i`}),`. Self, `,_jsx(_components.code,{children:`null`}),` or `,_jsx(_components.code,{children:`-1`}),` marks a root. Node keys are the indices or object keys.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`pointers`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Labels next to nodes: `,_jsx(_components.code,{children:`{value?|id?, label, color?}`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`props`})}),_jsx(_components.td,{children:`any`}),_jsx(_components.td,{children:`Escape hatch for a widget prop whose name collides with a reserved key.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`prunedNodes`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Node keys the search abandoned — drawn dashed and struck through.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`root`})}),_jsx(_components.td,{children:`object`}),_jsxs(_components.td,{children:[`Nested node: `,_jsx(_components.code,{children:`{value, id?, badge?, edgeLabel?, keys?, leaf?, left?, right?, children?}`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`roots`})}),_jsx(_components.td,{children:`array of object`}),_jsx(_components.td,{children:`Several trees side by side — a disjoint-set forest, a trie split per letter.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`showEdgeLabels`})}),_jsx(_components.td,{children:`boolean`}),_jsxs(_components.td,{children:[`Show each node’s `,_jsx(_components.code,{children:`edgeLabel`}),`. Default true. Fixed across steps.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`showNulls`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Dashed empty slot on the missing side of a one-child binary node. Default true. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`vGap`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Vertical gap between levels, px. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`withArray`})}),_jsx(_components.td,{children:`boolean`}),_jsxs(_components.td,{children:[`With `,_jsx(_components.code,{children:`fromArray`}),`: also draw the backing array beside the tree, highlights kept in step. Default true. Fixed across steps.`]})]})]})]})}),`\n`,_jsx(Heading,{level:`2`,id:`list`,children:`list`}),`\n`,_jsxs(_components.p,{children:[`A linked list. Each node’s `,_jsx(_components.code,{children:`next`}),` defaults to the following node. `,_jsx(_components.code,{children:`next: false`}),` ends the list, and a number points back to that index, which is how you draw a cycle.`]}),`\n`,_jsxs(_components.p,{children:[`A bare `,_jsx(_components.code,{children:`list`}),` fence renders when its body has `,_jsx(_components.code,{children:`nodes`}),`. Also spelled `,_jsx(_components.code,{children:`kiwi-list`}),`, `,_jsx(_components.code,{children:`widget:list`}),`, `,_jsx(_components.code,{children:`linkedlist`}),`, `,_jsx(_components.code,{children:`linked-list`}),`, `,_jsx(_components.code,{children:`kiwi-linkedlist`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`19`,language:`markdown`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`markdown`,children:_jsxs(_components.code,{language:`markdown`,numberOfLines:`19`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:'```list id=floyd caption=\"Floyd\\'s cycle detection\"'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`nodes:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {value: 1}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {value: 2}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {value: 3}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {value: 4}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {value: 5, next: 2}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`steps:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"slow and fast both start at the head\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` pointers: [{index: 0, label: slow}, {index: 0, label: fast}]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"slow moves one, fast moves two\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` pointers: [{index: 1, label: slow}, {index: 2, label: fast}]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"fast has entered the cycle\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` pointers: [{index: 2, label: slow}, {index: 4, label: fast}]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"They meet inside the cycle — there is one\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` pointers: [{index: 3, label: \"slow,fast\"}]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeIndex: 3`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` breakpoint: true`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:\"```\"})}),`\n`]})})}),`\n`,_jsx(Accordion,{title:`All 13 keys`,id:`all-13-keys`,children:_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Key`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`nodes`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`Required.`}),` `,_jsx(_components.code,{children:`{value, next?}`}),`. `,_jsx(_components.code,{children:`next`}),` omitted or `,_jsx(_components.code,{children:`true`}),` means the following node, `,_jsx(_components.code,{children:`false`}),` means null, a number means that index — a cycle.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Primary highlight color. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeIndex`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Index of the active node.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ariaLabel`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Accessible name. Defaults to a summary derived from the data. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`dimIndices`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Dimmed indices.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`doubly`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Draw a backward arrow beside each forward one. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`edges`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Arcs over the chain: `,_jsx(_components.code,{children:`{from, to, label?, side?: \"above\"|\"below\"}`}),` — random pointers, child links.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Secondary highlight color. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightIndices`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Secondary-highlighted indices.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`nodeWidth`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Node width, px. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`pointers`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Named pointers: `,_jsx(_components.code,{children:`{index, label, color?}`}),` — `,_jsx(_components.code,{children:`slow`}),`, `,_jsx(_components.code,{children:`fast`}),`, `,_jsx(_components.code,{children:`prev`}),`, `,_jsx(_components.code,{children:`curr`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`props`})}),_jsx(_components.td,{children:`any`}),_jsx(_components.td,{children:`Escape hatch for a widget prop whose name collides with a reserved key.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`showNull`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Draw a null terminator. Default true. Fixed across steps.`})]})]})]})}),`\n`,_jsx(Heading,{level:`2`,id:`stack`,children:`stack`}),`\n`,_jsx(_components.p,{children:`A LIFO stack, drawn bottom to top: monotonic stacks, bracket matching, call stacks, undo histories.`}),`\n`,_jsxs(_components.p,{children:[`A bare `,_jsx(_components.code,{children:`stack`}),` fence renders when its body has `,_jsx(_components.code,{children:`values`}),`. Also spelled `,_jsx(_components.code,{children:`kiwi-stack`}),`, `,_jsx(_components.code,{children:`widget:stack`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`markdown`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`markdown`,children:_jsxs(_components.code,{language:`markdown`,numberOfLines:`13`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:'```stack id=monotonic title=stack caption=\"Next greater element\"'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`values: []`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`steps:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"Push 2\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` values: [2]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"1 is smaller — push it too\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` values: [2, 1]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"5 pops everything smaller: 1 and 2 both get their answer\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` values: [2, 1]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeIndex: 1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"Stack holds only 5\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` values: [5]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:\"```\"})}),`\n`]})})}),`\n`,_jsx(Accordion,{title:`All 17 keys`,id:`all-17-keys`,children:_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Key`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`values`})}),_jsx(_components.td,{children:`array or string`}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`Required.`}),` Items from the bottom of the stack to the top.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Primary highlight color. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeIndex`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Index of the active item. Defaults to the top.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ariaLabel`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Accessible name. Defaults to a summary derived from the data. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`dimIndices`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Dimmed indices.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`empty`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Text shown when there are no items. Default “(empty)”. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`growth`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`top`}),` | `,_jsx(_components.code,{children:`bottom`})]}),_jsx(_components.td,{children:`Which end the top of the stack is drawn at. Default top. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Secondary highlight color. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightIndices`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Secondary-highlighted indices.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`itemHeight`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Item height, px. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`itemWidth`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Item width, px. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`maxHeight`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Scroll past this height, px. Default 300. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`pointers`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Markers beside items: `,_jsx(_components.code,{children:`{index, label, color?}`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`props`})}),_jsx(_components.td,{children:`any`}),_jsx(_components.td,{children:`Escape hatch for a widget prop whose name collides with a reserved key.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`showIndices`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Show the index of each item. Default true. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`title`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Caption above the stack. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`topLabel`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Caption on the open end. Default “top”. Fixed across steps.`})]})]})]})}),`\n`,_jsx(Heading,{level:`2`,id:`queue`,children:`queue`}),`\n`,_jsxs(_components.p,{children:[`A FIFO queue: BFS frontiers, work queues, sliding windows. Set `,_jsx(_components.code,{children:`layout: ring`}),` to draw a circular buffer, where `,_jsx(_components.code,{children:`front`}),` and `,_jsx(_components.code,{children:`back`}),` wrapping past the end is the point.`]}),`\n`,_jsxs(_components.p,{children:[`A bare `,_jsx(_components.code,{children:`queue`}),` fence renders when its body has `,_jsx(_components.code,{children:`values`}),`. Also spelled `,_jsx(_components.code,{children:`kiwi-queue`}),`, `,_jsx(_components.code,{children:`widget:queue`}),`, `,_jsx(_components.code,{children:`ringbuffer`}),`, `,_jsx(_components.code,{children:`ring-buffer`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`27`,language:`markdown`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`markdown`,children:_jsxs(_components.code,{language:`markdown`,numberOfLines:`27`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:'```queue id=ring caption=\"A ring buffer wrapping past the end\"'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`layout: ring`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`capacity: 6`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`values: [null, null, null, null, null, null]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`front: 0`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`back: 0`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`steps:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"Empty: front and back coincide\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` size: 0`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"Enqueue three; back advances\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` values: [a, b, c, null, null, null]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` back: 3`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` size: 3`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeIndices: [2]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"Dequeue two; front advances, the slots are not cleared\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` values: [a, b, c, null, null, null]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` front: 2`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` back: 3`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` size: 1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` dimIndices: [0, 1]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"Enqueue four more — back wraps past the end to slot 1\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` values: [g, h, c, d, e, f]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` front: 2`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` back: 2`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` size: 6`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeIndices: [0, 1]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:\"```\"})}),`\n`]})})}),`\n`,_jsx(Accordion,{title:`All 24 keys`,id:`all-24-keys`,children:_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Key`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`values`})}),_jsx(_components.td,{children:`array`}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`Required.`}),` Slot contents. In `,_jsx(_components.code,{children:`ring`}),` layout this is the whole buffer, with `,_jsx(_components.code,{children:`null`}),` for an empty slot.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Primary highlight color. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeIndices`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Slots active this step.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ariaLabel`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Accessible name. Defaults to a summary derived from the data. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`back`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Index one past the tail — where the next enqueue lands.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`backLabel`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Label on the tail end. Default “back”. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`capacity`})}),_jsx(_components.td,{children:`number`}),_jsxs(_components.td,{children:[`Buffer size, at most 1024. Defaults to `,_jsx(_components.code,{children:`values.length`}),`. Fixed across steps.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`dimIndices`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Dimmed slots.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`empty`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Text shown when every slot is empty. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`front`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Index of the head, wrapped into the buffer. Defaults to 0, where the front marker is drawn.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`frontLabel`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Label on the head end. Default “front”. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Secondary highlight color. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightIndices`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Secondary-highlighted slots.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`layout`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`horizontal`}),` | `,_jsx(_components.code,{children:`ring`})]}),_jsx(_components.td,{children:`Default horizontal. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`pointers`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Extra markers beside slots: `,_jsx(_components.code,{children:`{index, label, color?}`}),`. In a ring the index wraps.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`props`})}),_jsx(_components.td,{children:`any`}),_jsx(_components.td,{children:`Escape hatch for a widget prop whose name collides with a reserved key.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`radius`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Ring radius, px. Defaults to whatever fits the slots, at least 86. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`selected`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Slot indices drawn as selected.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`showIndices`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Show slot indices. Default true. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`size`})}),_jsx(_components.td,{children:`number`}),_jsxs(_components.td,{children:[`How many slots hold data, counted from `,_jsx(_components.code,{children:`front`}),`. Tells a full ring from an empty one when front and back coincide; slots outside the window draw as stale.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`slotSize`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Slot size, px. Default 44. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`title`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Caption above the queue. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`why`})}),_jsx(_components.td,{children:`any`}),_jsx(_components.td,{children:`Slot index → explanation, revealed on select.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`widgetId`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Name for the inspect bus. Fixed across steps.`})]})]})]})}),`\n`,_jsx(Heading,{level:`2`,id:`map`,children:`map`}),`\n`,_jsxs(_components.p,{children:[`Hash slots, chains, and probe paths. Without a `,_jsx(_components.code,{children:`mode`}),`, `,_jsx(_components.code,{children:`slots`}),` draw as chained buckets and `,_jsx(_components.code,{children:`entries`}),` as a plain dictionary. Set `,_jsx(_components.code,{children:`mode: open`}),` for open addressing with tombstones.`]}),`\n`,_jsxs(_components.p,{children:[`A bare `,_jsx(_components.code,{children:`map`}),` fence renders when its body has `,_jsx(_components.code,{children:`slots`}),` or `,_jsx(_components.code,{children:`entries`}),`. Also spelled `,_jsx(_components.code,{children:`kiwi-map`}),`, `,_jsx(_components.code,{children:`widget:map`}),`, `,_jsx(_components.code,{children:`hashmap`}),`, `,_jsx(_components.code,{children:`hashtable`}),`, `,_jsx(_components.code,{children:`kiwi-hashmap`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`33`,language:`markdown`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`markdown`,children:_jsxs(_components.code,{language:`markdown`,numberOfLines:`33`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:'```map id=probe caption=\"Linear probing into a full-ish table\"'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`mode: open`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`capacity: 8`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`hashOf: {apple: 3, mango: 3}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`slots:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - null`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - null`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - null`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {key: apple, value: 1}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - null`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - null`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - null`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - null`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`steps:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"h(mango) = 3, but slot 3 is taken by apple\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeKey: mango`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeSlots: [3]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` probePath: [3]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"Probe forward: slot 4 is free\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeKey: mango`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeSlots: [4]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` probePath: [3, 4]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"Inserted. α = 2/8 — plenty of headroom\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` slots:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - null`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - null`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - null`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {key: apple, value: 1}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {key: mango, value: 2}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - null`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - null`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - null`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:\"```\"})}),`\n`]})})}),`\n`,_jsx(Accordion,{title:`All 21 keys`,id:`all-21-keys`,children:_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Key`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Primary highlight color. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeKey`})}),_jsx(_components.td,{children:`string or number`}),_jsx(_components.td,{children:`The key being inserted or looked up this step.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeSlots`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Slots being written this step.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ariaLabel`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Accessible name. Defaults to a summary derived from the data. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`capacity`})}),_jsx(_components.td,{children:`number`}),_jsxs(_components.td,{children:[`Slot count, 0–1024. Defaults to `,_jsx(_components.code,{children:`slots.length`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`dimSlots`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Dimmed slots.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`entries`})}),_jsx(_components.td,{children:`array or object`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`[{key, value?}]`}),` for `,_jsx(_components.code,{children:`mode: \"map\"`}),` — a frequency map, a seen-set. A plain `,_jsx(_components.code,{children:`{key: value}`}),` object works too.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`hashOf`})}),_jsx(_components.td,{children:`object`}),_jsxs(_components.td,{children:[`Key → slot, shown as an `,_jsx(_components.code,{children:`h(k)=i`}),` badge beside the key in every mode.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Secondary highlight color. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightSlots`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Secondary-highlighted slots.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`mode`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`chain`}),` | `,_jsx(_components.code,{children:`open`}),` | `,_jsx(_components.code,{children:`map`})]}),_jsxs(_components.td,{children:[`How to draw it: “chain” for buckets, “open” for open addressing with tombstones, “map” for an unordered dictionary. Inferred from `,_jsx(_components.code,{children:`slots`}),` / `,_jsx(_components.code,{children:`entries`}),`. Fixed across steps.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`probePath`})}),_jsx(_components.td,{children:`array of number`}),_jsx(_components.td,{children:`Slots visited in order, numbered above the row and joined by arrows.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`props`})}),_jsx(_components.td,{children:`any`}),_jsx(_components.td,{children:`Escape hatch for a widget prop whose name collides with a reserved key.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`selected`})}),_jsx(_components.td,{children:`array or number or string`}),_jsxs(_components.td,{children:[`Slot indices drawn as selected; keys in `,_jsx(_components.code,{children:`mode: \"map\"`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`showIndices`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Index captions under the slots. Default true. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`showLoadFactor`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Show α = n/m: entries per slot for chaining, occupied slots for open addressing. Default true. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`slots`})}),_jsx(_components.td,{children:`array`}),_jsxs(_components.td,{children:[`One entry per slot: `,_jsx(_components.code,{children:`null`}),` empty, `,_jsx(_components.code,{children:`\"DEL\"`}),` a tombstone, `,_jsx(_components.code,{children:`{key, value?}`}),` or a bare key, or a list of those for a chain.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`slotWidth`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Slot width, px. Default 54. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`tombstones`})}),_jsx(_components.td,{children:`array or number or string`}),_jsxs(_components.td,{children:[`Slots holding a tombstone, if not already `,_jsx(_components.code,{children:`\"DEL\"`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`why`})}),_jsx(_components.td,{children:`any`}),_jsxs(_components.td,{children:[`Slot index (key in `,_jsx(_components.code,{children:`mode: \"map\"`}),`) → explanation, revealed on select.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`widgetId`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Name for the inspect bus, for cross-widget linking. Fixed across steps.`})]})]})]})}),`\n`,_jsx(Heading,{level:`2`,id:`bits`,children:`bits`}),`\n`,_jsxs(_components.p,{children:[`A value as labelled bits: bitmask DP, flag registers, permission sets, two’s complement, IEEE-754 layouts. `,_jsx(_components.code,{children:`fields`}),` brackets named bit ranges, and `,_jsx(_components.code,{children:`decode`}),` chooses how the summary row reads the pattern.`]}),`\n`,_jsxs(_components.p,{children:[`A bare `,_jsx(_components.code,{children:`bits`}),` fence renders when its body has `,_jsx(_components.code,{children:`value`}),`. Also spelled `,_jsx(_components.code,{children:`kiwi-bits`}),`, `,_jsx(_components.code,{children:`widget:bits`}),`, `,_jsx(_components.code,{children:`bitmask`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`markdown`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`markdown`,children:_jsxs(_components.code,{language:`markdown`,numberOfLines:`15`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:'```bits id=subsets caption=\"Bitmask DP: visiting city 2\"'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`bits: 4`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`labels: [A, B, C, D]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`steps:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"Start at A only\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` value: 1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeBits: [0]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"Add C to the visited set\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` value: 5`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeBits: [2]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` readBits: [0]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"All four visited — the subproblem is complete\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` value: 15`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeBits: [1, 3]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:\"```\"})}),`\n`]})})}),`\n`,_jsx(Accordion,{title:`All 18 keys`,id:`all-18-keys`,children:_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Key`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`value`})}),_jsx(_components.td,{children:`number or string`}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`Required.`}),` The value to show. A number, or a `,_jsx(_components.code,{children:`\"0x…\"`}),` / `,_jsx(_components.code,{children:`\"0b…\"`}),` string for 64-bit patterns a JS number cannot hold exactly.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeBits`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Bit positions being set or tested this step.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Primary highlight color. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ariaLabel`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Accessible name. Defaults to a summary derived from the data. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`arrows`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Arcs between bit positions: `,_jsx(_components.code,{children:`{from, to, label?, dashed?}`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`bits`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`How many bits to draw. Defaults to the value’s bit length. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`cellSize`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Cell size, px. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`decode`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`uint`}),` | `,_jsx(_components.code,{children:`int`}),` | `,_jsx(_components.code,{children:`twos`}),` | `,_jsx(_components.code,{children:`ieee32`}),` | `,_jsx(_components.code,{children:`ieee64`}),` | `,_jsx(_components.code,{children:`hex`}),` | `,_jsx(_components.code,{children:`oct`}),` | `,_jsx(_components.code,{children:`raw`})]}),_jsx(_components.td,{children:`How to read the pattern in the summary row. A list shows several readings at once. Default uint.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`fields`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Named bit ranges drawn as brackets under the row: `,_jsx(_components.code,{children:`{from, to, label, color?}`}),` — a float’s sign, exponent and mantissa; a flags register; a packed struct. Each bracket shows the field’s value.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightBits`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Secondary-highlighted bit positions.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Secondary highlight color. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`label`})}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[`Row title, e.g. `,_jsx(_components.code,{children:`mask`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`labels`})}),_jsx(_components.td,{children:`array`}),_jsx(_components.td,{children:`What each bit stands for, indexed by bit position (bit 0 = least significant).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`lsbFirst`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Draw bit 0 on the left. Default false (most significant first). Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`pointers`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Pointers by bit position: `,_jsx(_components.code,{children:`{bit, label, color?, side?}`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`props`})}),_jsx(_components.td,{children:`any`}),_jsx(_components.td,{children:`Escape hatch for a widget prop whose name collides with a reserved key.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`readBits`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Bit positions read by this step.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`showSummary`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Show the decimal value and popcount beside the bits. Default true. Fixed across steps.`})]})]})]})}),`\n`,_jsx(Heading,{level:`2`,id:`memory`,children:`memory`}),`\n`,_jsxs(_components.p,{children:[`Frames on the left, heap objects on the right, pointers between them: aliasing, mutation, closures, recursion. The props follow the Python Tutor trace format, so a recorded trace drops straight in. A frame variable written as `,_jsx(_components.code,{children:`[REF, id]`}),` points into the heap.`]}),`\n`,_jsxs(_components.p,{children:[`A bare `,_jsx(_components.code,{children:`memory`}),` fence renders when its body has `,_jsx(_components.code,{children:`frames`}),` or `,_jsx(_components.code,{children:`heap`}),`. Also spelled `,_jsx(_components.code,{children:`kiwi-memory`}),`, `,_jsx(_components.code,{children:`widget:memory`}),`, `,_jsx(_components.code,{children:`heap`}),`, `,_jsx(_components.code,{children:`stack-heap`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`markdown`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`markdown`,children:_jsxs(_components.code,{language:`markdown`,numberOfLines:`21`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:'```memory id=alias caption=\"Why mutating b changed a\"'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`frames:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - name: \"\u003cmodule>\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` vars: {a: [REF, 1], b: [REF, 1]}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`heap:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` 1: [LIST, 1, 2, 3]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`steps:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"a = [1, 2, 3] allocates one list\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` frames:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {name: \"\u003cmodule>\", vars: {a: [REF, 1]}}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeIds: [1]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"b = a copies the pointer, not the list — both names are the one object\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` frames:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - {name: \"\u003cmodule>\", vars: {a: [REF, 1], b: [REF, 1]}}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeIds: [1]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - note: \"b.append(4) mutates that object, so a sees it too\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` heap:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` 1: [LIST, 1, 2, 3, 4]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` activeIds: [1]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` breakpoint: true`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:\"```\"})}),`\n`]})})}),`\n`,_jsx(Accordion,{title:`All 15 keys`,id:`all-15-keys`,children:_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Key`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Primary highlight color. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeFrame`})}),_jsx(_components.td,{children:`string or number`}),_jsxs(_components.td,{children:[`Which frame is executing: a frame `,_jsx(_components.code,{children:`id`}),`, or a number for its index in `,_jsx(_components.code,{children:`frames`}),`. Defaults to the innermost.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activeIds`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Heap ids to emphasise this step.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ariaLabel`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Accessible name. Defaults to a summary derived from the data. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`dimIds`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Dimmed heap ids — garbage, or a frame about to return.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`frames`})}),_jsx(_components.td,{children:`array of object`}),_jsxs(_components.td,{children:[`Call stack, outermost first: `,_jsx(_components.code,{children:`{name, id?, vars: {k: value}, order?, returned?, active?}`}),`. A value of `,_jsx(_components.code,{children:`[REF, id]`}),` points into the heap.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`framesLabel`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Caption above the frames column. Default “Frames”. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`heap`})}),_jsx(_components.td,{children:`object`}),_jsxs(_components.td,{children:[`Objects by id, tagged: `,_jsx(_components.code,{children:`[\"LIST\", 1, 2]`}),`, `,_jsx(_components.code,{children:`[\"DICT\", [\"k\", 1]]`}),`, `,_jsx(_components.code,{children:`[\"INSTANCE\", \"Node\", [\"val\", 1]]`}),`, `,_jsx(_components.code,{children:`[\"TUPLE\", …]`}),`, `,_jsx(_components.code,{children:`[\"SET\", …]`}),`. An untagged `,_jsx(_components.code,{children:`{field: value}`}),` draws as an object’s fields.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`heapLabel`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Caption above the heap column. Default “Objects”. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightColor`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Secondary highlight color. Fixed across steps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`highlightIds`})}),_jsx(_components.td,{children:`array or number or string`}),_jsx(_components.td,{children:`Secondary-highlighted heap ids.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`inlinePrimitives`})}),_jsx(_components.td,{children:`boolean`}),_jsxs(_components.td,{children:[`Draw a frame variable’s primitive inside its slot. Default true; `,_jsx(_components.code,{children:`false`}),` boxes each one on the heap with an arrow, Python Tutor’s “render all objects on the heap”. Fixed across steps.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`props`})}),_jsx(_components.td,{children:`any`}),_jsx(_components.td,{children:`Escape hatch for a widget prop whose name collides with a reserved key.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`why`})}),_jsx(_components.td,{children:`any`}),_jsx(_components.td,{children:`Heap id → explanation, revealed on select.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`widgetId`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Name for the inspect bus. Fixed across steps.`})]})]})]})}),`\n`,_jsx(Heading,{level:`2`,id:`related`,children:`Related`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Widgets overview`,icon:`puzzle-piece`,href:`/concepts/widgets`,children:_jsx(_components.p,{children:`Fence names, steps, playback, and validation.`})}),_jsx(Card,{title:`Charts and plots`,icon:`chart-line`,href:`/widgets/charts`,children:_jsx(_components.p,{children:`plot, bars, numberline, plane, timeline, and more.`})}),_jsx(Card,{title:`Diagrams`,icon:`diagram-project`,href:`/widgets/diagrams`,children:_jsx(_components.p,{children:`graph, sequence, steps, Mermaid, and D2.`})}),_jsx(Card,{title:`Data and queries`,icon:`database`,href:`/widgets/data-and-queries`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`kiwi-data`}),` records that a `,_jsx(_components.code,{children:`table`}),` can animate.`]})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Data structure widgets","sidebarTitle":"Data structures","description":"Typed fences for arrays, matrices, tables, trees, linked lists, stacks, queues, hash maps, bit patterns, and memory diagrams.","icon":"cubes","href":"/widgets/data-structures"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"array","slug":"array","depth":2,"children":[]},{"title":"matrix","slug":"matrix","depth":2,"children":[]},{"title":"table","slug":"table","depth":2,"children":[]},{"title":"tree","slug":"tree","depth":2,"children":[]},{"title":"list","slug":"list","depth":2,"children":[]},{"title":"stack","slug":"stack","depth":2,"children":[]},{"title":"queue","slug":"queue","depth":2,"children":[]},{"title":"map","slug":"map","depth":2,"children":[]},{"title":"bits","slug":"bits","depth":2,"children":[]},{"title":"memory","slug":"memory","depth":2,"children":[]},{"title":"Related","slug":"related","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"kiwifs","siteName":"KiwiFS — Markdown filesystem for agents and teams","title":"Data structure widgets - KiwiFS — Markdown filesystem for agents and teams","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-19T21:16:53.216Z","gitLastModified":"2026-10-19T21:15:57.000Z","originalFileLocation":"widgets/data-structures.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Typed fences for arrays, matrices, tables, trees, linked lists, stacks, queues, hash maps, bit patterns, and memory diagrams.\">\u003cmeta data-mint-head name=\"application-name\" content=\"KiwiFS — Markdown filesystem for agents and teams\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/kiwifs/r4NQjkI4lMflJ8-L/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/kiwifs/r4NQjkI4lMflJ8-L/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/kiwifs/r4NQjkI4lMflJ8-L/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/kiwifs/r4NQjkI4lMflJ8-L/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/kiwifs/r4NQjkI4lMflJ8-L/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/kiwifs/r4NQjkI4lMflJ8-L/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/kiwifs/r4NQjkI4lMflJ8-L/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/kiwifs/r4NQjkI4lMflJ8-L/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/kiwifs/r4NQjkI4lMflJ8-L/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Data structure widgets - KiwiFS — Markdown filesystem for agents and teams\">\u003cmeta data-mint-head property=\"og:description\" content=\"Typed fences for arrays, matrices, tables, trees, linked lists, stacks, queues, hash maps, bit patterns, and memory diagrams.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"KiwiFS — Markdown filesystem for agents and teams\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.kiwifs.com/widgets/data-structures\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://kiwifs.mintlify.site/_mintlify/api/og/v2?division=Widgets\u0026amp;title=Data+structure+widgets\u0026amp;description=Typed+fences+for+arrays%2C+matrices%2C+tables%2C+trees%2C+linked+lists%2C+stacks%2C+queues%2C+hash+maps%2C+bit+patterns%2C+and+memory+diagrams.\u0026amp;theme=505e64d4c95a3a18e5bddaf7\u0026amp;signature=d9efc7a370acf92f1210adf1dccfa03c275e2d3a6f202801d5f3d7cf44daa392\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Data structure widgets - KiwiFS — Markdown filesystem for agents and teams\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Typed fences for arrays, matrices, tables, trees, linked lists, stacks, queues, hash maps, bit patterns, and memory diagrams.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://kiwifs.mintlify.site/_mintlify/api/og/v2?division=Widgets\u0026amp;title=Data+structure+widgets\u0026amp;description=Typed+fences+for+arrays%2C+matrices%2C+tables%2C+trees%2C+linked+lists%2C+stacks%2C+queues%2C+hash+maps%2C+bit+patterns%2C+and+memory+diagrams.\u0026amp;theme=505e64d4c95a3a18e5bddaf7\u0026amp;signature=d9efc7a370acf92f1210adf1dccfa03c275e2d3a6f202801d5f3d7cf44daa392\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/kiwifs/r4NQjkI4lMflJ8-L/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"KiwiFS — Markdown filesystem for agents and teams\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6cbe45\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.kiwifs.com/widgets/data-structures\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/widgets/data-structures.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.kiwifs.com/#organization\",\"name\":\"KiwiFS — Markdown filesystem for agents and teams\",\"url\":\"https://docs.kiwifs.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/kiwifs/71yiWv72s5YuFel2/logo/light.svg?fit=max\u0026auto=format\u0026n=71yiWv72s5YuFel2\u0026q=85\u0026s=14b8be7497781b1b39436e90a18dea8d\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.kiwifs.com#website\",\"name\":\"KiwiFS — Markdown filesystem for agents and teams\",\"url\":\"https://docs.kiwifs.com\",\"publisher\":{\"@id\":\"https://docs.kiwifs.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.kiwifs.com/widgets/data-structures#webpage\",\"url\":\"https://docs.kiwifs.com/widgets/data-structures\",\"name\":\"Data structure widgets\",\"description\":\"Typed fences for arrays, matrices, tables, trees, linked lists, stacks, queues, hash maps, bit patterns, and memory diagrams.\",\"dateModified\":\"2026-10-19T21:15:57.000Z\",\"isPartOf\":{\"@id\":\"https://docs.kiwifs.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.kiwifs.com/widgets/data-structures#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.kiwifs.com/widgets/data-structures#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Widgets\",\"item\":\"https://docs.kiwifs.com/concepts/widgets\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Data structure widgets\",\"item\":\"https://docs.kiwifs.com/widgets/data-structures\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.kiwifs.com/widgets/data-structures#article\",\"headline\":\"Data structure widgets\",\"name\":\"Data structure widgets\",\"description\":\"Typed fences for arrays, matrices, tables, trees, linked lists, stacks, queues, hash maps, bit patterns, and memory diagrams.\",\"url\":\"https://docs.kiwifs.com/widgets/data-structures\",\"mainEntityOfPage\":{\"@id\":\"https://docs.kiwifs.com/widgets/data-structures#webpage\"},\"dateModified\":\"2026-10-19T21:15:57.000Z\",\"publisher\":{\"@id\":\"https://docs.kiwifs.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.kiwifs.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"KiwiFS — Markdown filesystem for agents and teams\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"KiwiFS — Markdown filesystem for agents and teams\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/widgets/data-structures.md","siteName":"KiwiFS — Markdown filesystem for agents and teams","nav":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/kiwifs/kiwifs"}]},"tabs":[{"tab":"Documentation","groups":[{"group":"Getting Started","pages":[{"title":"Introduction","icon":"house","href":""},{"title":"Quickstart","icon":"rocket","href":"/quickstart"},{"title":"Configuration","icon":"gear","href":"/configuration"}]},{"group":"Core Concepts","pages":[{"title":"Files as truth","icon":"file-lines","href":"/concepts/files-as-truth"},{"title":"Agent interface","icon":"robot","href":"/concepts/agent-interface"},{"title":"Agent playbook","icon":"book-open","href":"/concepts/agent-playbook"},{"title":"Search","icon":"magnifying-glass","href":"/concepts/search"},{"title":"Versioning","icon":"code-branch","href":"/concepts/versioning"},{"title":"DQL","icon":"database","href":"/concepts/dql"},{"title":"Wiki links","icon":"diagram-project","href":"/concepts/wiki-links"},{"title":"Restructuring","icon":"shuffle","href":"/concepts/refactor"},{"title":"MCP (Model Context Protocol)","sidebarTitle":"MCP","icon":"plug","href":"/concepts/mcp"},{"title":"Episodic memory","icon":"brain","href":"/concepts/episodic-memory"},{"title":"Draft spaces","icon":"code-branch","href":"/concepts/draft-spaces"},{"title":"Bases and saved views","sidebarTitle":"Bases","icon":"table","href":"/concepts/bases-views"},{"title":"Canvas files","sidebarTitle":"Canvas","icon":"diagram-project","href":"/concepts/canvas"},{"title":"Whiteboard","icon":"pen","href":"/concepts/whiteboard"},{"title":"Workflows","icon":"bars-progress","href":"/concepts/workflows"},{"title":"Task claims","icon":"lock","href":"/concepts/claims"},{"title":"Webhooks","icon":"webhook","href":"/concepts/webhooks"},{"title":"Schema validation","icon":"shield-check","href":"/concepts/schemas"},{"title":"Multi-space","icon":"layer-group","href":"/concepts/multi-space"},{"title":"Publishing and sharing","icon":"globe","href":"/concepts/publishing"},{"title":"Audit log","icon":"scroll","href":"/concepts/audit-log"},{"title":"Real-time events","icon":"bolt","href":"/concepts/real-time-events"},{"title":"Optional features","icon":"toggle-on","href":"/concepts/optional-features"}]},{"group":"Widgets","pages":[{"title":"Widgets","description":"Fenced blocks that render as interactive diagrams, data structures, charts, quizzes, and queries in the web UI, and stay readable as plain markdown.","icon":"puzzle-piece","href":"/concepts/widgets"},{"title":"Data structure widgets","sidebarTitle":"Data structures","icon":"cubes","href":"/widgets/data-structures"},{"title":"Chart and plot widgets","sidebarTitle":"Charts and plots","description":"Typed fences for x-y plots, bar columns, number lines, coordinate planes, and timelines, plus kiwi-chart and kiwi-progress for dashboards.","icon":"chart-line","href":"/widgets/charts"},{"title":"Diagram widgets","sidebarTitle":"Diagrams","icon":"diagram-project","href":"/widgets/diagrams"},{"title":"Interactive and learning widgets","sidebarTitle":"Interactive and learning","icon":"hand-pointer","href":"/widgets/interactive"},{"title":"Data and query widgets","sidebarTitle":"Data and queries","icon":"database","href":"/widgets/data-and-queries"},{"title":"Page structure blocks","sidebarTitle":"Page structure","icon":"table-columns","href":"/widgets/page-structure"}]},{"group":"Guides","pages":[{"title":"KiwiFS Cloud","icon":"cloud","href":"/guides/cloud"},{"title":"Init templates","icon":"folder-open","href":"/guides/templates"},{"title":"Web UI","icon":"window","href":"/guides/web-ui"},{"title":"Alternate protocols","icon":"network-wired","href":"/guides/alternate-protocols"},{"title":"POSIX and filesystem semantics","sidebarTitle":"POSIX semantics","icon":"file-code","href":"/guides/posix"},{"title":"Authentication and tokens","sidebarTitle":"Auth and tokens","icon":"key","href":"/guides/auth-tokens"},{"title":"Examples","icon":"lightbulb","href":"/guides/examples"},{"title":"FAQ","icon":"circle-question","href":"/guides/faq"}]},{"group":"Data Import","pages":[{"title":"Data import","icon":"download","href":"/import/overview"},{"title":"Database imports","icon":"database","href":"/import/databases"},{"title":"File imports","icon":"file-csv","href":"/import/files"},{"title":"App and wiki imports","sidebarTitle":"Apps and wikis","icon":"cloud-arrow-down","href":"/import/saas"},{"title":"Browse, preview, and sync imports","sidebarTitle":"Preview and sync","icon":"link","href":"/import/connections"},{"title":"Airbyte import","icon":"rotate","href":"/import/airbyte"},{"title":"Croissant","icon":"table-list","href":"/import/croissant"}]},{"group":"Data Export","pages":[{"title":"Data export","icon":"upload","href":"/export/overview"},{"title":"Document export","icon":"file-pdf","href":"/export/documents"}]},{"group":"Deployment","pages":[{"title":"Docker","icon":"docker","href":"/deploy/docker"},{"title":"Ollama vector search on a small VPS","sidebarTitle":"Ollama vector search","icon":"server","href":"/deploy/ollama-vector-search"},{"title":"Kubernetes","icon":"dharmachakra","href":"/deploy/kubernetes"},{"title":"Go embed","icon":"code","href":"/deploy/go-embed"},{"title":"Backup sync","icon":"code-branch","href":"/deploy/backup-sync"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api/overview"}]}]},"basePath":"","title":"Data structure widgets - KiwiFS — Markdown filesystem for agents and teams","buildId":"dpl_GRSyrvXT6FFTpZZTGz5iZPp3D2zE","deploymentId":"dpl_GRSyrvXT6FFTpZZTGz5iZPp3D2zE","dynamics":[],"chunks":[]}