/** * Lineage layout — the chronicle as a spine you read left to right. * * `applyWheelLayout` answers "what direction is this?" and answers it well. It * cannot answer "what came before this?", because a circle has no before. At 85 * episodes with 93 of them in one quadrant, the wheel is also simply full. * * So: **x is time, y is direction.** Each episode sits at its own date along a * horizontal spine, in the band of its direction, and a relation arcs from what * an episode continues from to the episode itself. * * ## This layout requires `metadata.occurred_at` * * `created_at` records when the wheel *learned* of a node, not when the thing * happened. Measured 2026-09-05 before the backfill: 0 of 84 episodes carried * an occurrence date, and twelve May episodes shared one September `created_at` * from a single import batch — so a timeline drawn on `created_at` would have * stacked four months of work on one pixel and looked correct while being * wrong. * * Migration 0002 backfilled `occurred_at` from each `episode.yaml`; 34 of 76 * episodes had a `created_at` that disagreed with when they happened, episode * 001 by four months. Nodes still lacking it fall back to `created_at` and are * reported in `undated`, so a caller can say so rather than implying a history * the data does not have. * * Ported from the mechanism in `/src/Miadi/app/chronicle/components/ * LineageWeb.tsx`, which solved this for the chronicle app first. */ import type { MWGraphData } from './types.js'; import type { DirectionName } from '@medicine-wheel/ontology-core'; export interface LineageLayoutConfig { /** Horizontal padding either side of the spine. */ marginX: number; /** Minimum pixels between adjacent nodes before the canvas widens. */ minStep: number; /** Vertical centre of each direction's band. */ bandY: Record; /** Band for a node carrying no direction. */ undirectedY: number; /** * Vertical stagger applied to consecutive nodes in the same band, so episodes * on the same day do not land on one another. Deterministic, not random — * the same graph must lay out identically twice or a saved disposition is * meaningless. */ stagger: number; } export declare const DEFAULT_LINEAGE_LAYOUT: LineageLayoutConfig; export interface LineageLayoutResult extends MWGraphData { /** Canvas width the spine needs — grows with the corpus. */ width: number; /** Earliest and latest date placed, or null when nothing was datable. */ span: { from: string; to: string; } | null; /** * Ids placed by `created_at` because they carry no `occurred_at`. Surfaced so * a caller can name them rather than presenting registration order as * history. */ undated: string[]; } /** * Lay a graph out as a chronological spine. * * Returns new node objects rather than mutating — `applyWheelLayout` mutates in * place, and a caller switching between the two needs the wheel's positions to * survive the round trip. */ export declare function applyLineageLayout(data: MWGraphData, config?: Partial): LineageLayoutResult; //# sourceMappingURL=lineage-layout.d.ts.map