Skip to content

entity-viz-kit/graph

Generated from actual exported declarations. These signatures and comments are not a second specification. See the integration guide and documented verification limits.

See the declaration and integration guide.

export interface Camera {
readonly x: number;
readonly y: number /** CSS pixels per world unit. */;
readonly ratio: number;
}

See the declaration and integration guide.

DEFAULT_GRAPH_STRINGS: Readonly<GraphStrings>

See the declaration and integration guide.

export interface GraphDiagnostics {
readonly renderer: RendererStatus;
readonly layout: LayoutStatus;
readonly message: string;
readonly nodes: number;
readonly edges: number;
readonly visibleNodes: number;
readonly visibleEdges: number;
readonly pins: number;
readonly layoutRevision: number;
readonly epoch: number;
readonly acceptedFrames: number;
readonly rejectedFrames: number;
readonly renders: number;
readonly lastRenderMs: number;
readonly lastPhysicsMs: number;
readonly framebuffer: {
readonly width: number;
readonly height: number;
readonly pixelRatio: number;
};
readonly labelScale: number;
}

See the declaration and integration guide.

export interface GraphHandle {
update(update: GraphUpdate): void;
dispose(): void;
pause(): void;
resume(): void;
fit(): void;
focus(id: EntityId): void;
zoom(factor: number): void;
setCamera(camera: Camera): void;
pin(id: EntityId, point?: Point): void;
unpin(id: EntityId): void;
resetPins(): void;
setVisibleEntities(ids: readonly EntityId[] | null): void;
inspectEntity(id: EntityId): void;
inspectPair(id: PairId): void;
getView(): GraphView;
getDiagnostics(): GraphDiagnostics;
restore(view: GraphView): void;
/** Screen coordinates relative to the graph stage, useful for overlays and integration tests. */
project(id: EntityId): Point | null;
pick(point: Point): {
readonly node: EntityId | null;
readonly pairs: readonly PairId[];
};
setExpanded(expanded: boolean): void;
}

See the declaration and integration guide.

export interface GraphOptions {
readonly snapshot: GraphSnapshot;
readonly contextKey: string;
readonly registry: EntityRegistry;
readonly view?: GraphView | null;
readonly queryEntityIds?: readonly EntityId[];
readonly selection?: Inspection;
readonly theme?: 'light' | 'dark';
readonly seed?: number;
readonly paused?: boolean;
readonly maxPixelRatio?: number;
readonly maxFramebufferPixels?: number;
readonly labelBudget?: number;
readonly strings?: Partial<GraphStrings>;
/** Canvas label size multiplier (0.75–3, default 1), e.g. an audience display's presentation scale. */
readonly labelScale?: number;
/** Host-owned asset URL. Defaults to evk-layout.worker.js alongside the HTML page. */
readonly workerUrl?: string | URL;
/** Local factory (e.g. a bundler new Worker(new URL(...))). Not serializable backend data. */
readonly workerFactory?: () => Worker;
readonly worker?: boolean;
readonly onInspectEntity?: (id: EntityId) => void;
readonly onInspectPair?: (id: PairId) => void;
readonly onAddEntity?: (id: EntityId) => void;
/** Debounced presentation checkpoint; never fires for every simulation tick. No default storage. */
readonly onViewChange?: (view: GraphView) => void;
readonly onStatus?: (diagnostics: GraphDiagnostics) => void;
}

See the declaration and integration guide.

export interface GraphSelection {
readonly entityId: EntityId | null;
readonly pairId: PairId | null;
}

See the declaration and integration guide.

export interface GraphStrings {
title: string;
fit: string;
focus: string;
zoomIn: string;
zoomOut: string;
pause: string;
resume: string;
pin: string;
unpin: string;
resetPins: string;
add: string;
inspect: string;
expand: string;
collapse: string;
explore: string;
finish: string;
navigator: string;
entities: string;
relations: string;
previous: string;
next: string;
search: string;
clearFilter: string;
selected: string;
legend: string;
recover: string;
instructions: string;
choosePair: string;
unavailable: string;
noWorker: string;
empty: string;
/** Announced role of the canvas stage. */
roleDescription: string;
alreadyAdded: string;
selectionHint: string;
placePinByCoordinates: string;
placePin: string;
invalidCoordinates: string;
/** Suffix drawn after a pinned node's canvas label. */
pinnedLabel: string;
worldAxis: (axis: 'X' | 'Y') => string;
pairSummary: (assertions: number) => string;
page: (page: number, pages: number) => string;
/** The live status line; `layout` is the raw LayoutStatus. */
status: (diagnostics: GraphDiagnostics) => string;
}

See the declaration and integration guide.

export interface GraphUpdate {
readonly snapshot?: GraphSnapshot;
readonly contextKey?: string;
readonly queryEntityIds?: readonly EntityId[];
readonly selection?: Inspection;
readonly theme?: 'light' | 'dark';
readonly view?: GraphView | null;
}

See the declaration and integration guide.

export type LayoutStatus = 'running' | 'paused' | 'settled' | 'unavailable' | 'failed' | 'disposed';

Mount a real graph; only this call touches the DOM. Imports remain SSR-safe. REQ: graph-r-0047 REQ: graph-r-0048 REQ: graph-r-0050 REQ: graph-r-0051 REQ: graph-r-0052 REQ: graph-r-0053 REQ: graph-r-0054 REQ: graph-r-0055 REQ: graph-r-0056 REQ: graph-r-0057 REQ: graph-r-0058 REQ: graph-r-0059 REQ: graph-r-0060 REQ: system-r-0091 REQ: system-r-0092

export declare function mountGraph(container: HTMLElement, options: GraphOptions): GraphHandle;

See the declaration and integration guide.

export interface Point {
readonly x: number;
readonly y: number;
}

See the declaration and integration guide.

export type RendererStatus = 'ready' | 'unavailable' | 'lost' | 'disposed';