Skip to main content
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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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