/** * Lays the Timeline list's cause chains out as rails, the way `git log * --graph` draws branches: rows stay in time order and a vertical line in a * lane column connects each update to the row that caused it, across * whatever happened in between. * * The graph's nodes are the list's top-level rows that take part in a chain: * an update tick (`performUpdate`) or a `@lit/task` run (`task`) with a * recorded cause whose parent row is on screen, or any row that is such a * parent (a tick, a task run, or a mouse, keyboard or custom-event row). So a * click reads click → tick → task run → tick: the run hangs from the update * that started it, and the update its settling asked for hangs from the run. * A row in no chain draws nothing, so timers and other lone updates stay * quiet. Phases folded under a tick draw only the lines passing through them. * * Lanes are allocated in one pass over the rows. A node holds its lane while * it still has children to come. Its last child continues in the same lane; * earlier children fork into a free lane, and a leaf's lane is free again * after its row. Fan-out therefore costs lanes only while the forked children * themselves have children pending, and a chain is one colour from root to * leaf. Past {@link MAX_LANES} a child draws in its parent's lane instead of * forking, which keeps the column bounded at the price of a straight line * where a fork belongs. * * Pure and linear in the rows; the list recomputes it with its rows. */ import type { TimelineSpan } from './derive.js'; import { type ListRow } from './tick-rows.js'; /** Lanes the column stops growing at. */ export declare const MAX_LANES = 8; /** What one row draws in the lane column. */ export interface RailRow { /** The lane of this row's node, when it is one. */ lane?: number; /** * The parent's lane this node forks from, when it did not continue the * parent's lane. A connector runs from that lane's top to the node. */ fork?: number; /** Lanes with a straight line through this row, the node's own excluded. */ through: number[]; /** The node continues its parent's lane: a line enters from above. */ above: boolean; /** The node has children to come: its lane continues below. */ below: boolean; /** The chain this node belongs to, numbered by root, for its colour. */ chain?: number; } /** * Each top-level row's cause parent among the top-level rows: the tick or task * run whose groupId the cause names, or the point span with the cause's layer * and time. * A parent that is not on screen, or not earlier, leaves the row a root. */ export declare const causeParents: (rows: readonly ListRow[]) => Map; /** The rail column for `rows`, one entry per row, in the same order. */ export declare const buildRails: (rows: readonly ListRow[]) => RailRow[]; //# sourceMappingURL=cause-rails.d.ts.map