stack_layout.ts

Pure, deterministic layout for the public @fuzdev stack dependency graph.

compute_stack_layout takes raw nodes (name/category/language/description) plus the full edge list and bakes in layer, fan_in, and world-space x/y coordinates. No randomness — running it twice on the same input yields byte-identical output, which keeps the generated stack_graph.ts stable across gro gen runs.

view source

Declarations
#

4 declarations

COL_GAP
#

stack_layout.ts view source

150 import {COL_GAP} from '@fuzdev/fuz_docs/stack_layout.js';

Horizontal spacing between adjacent nodes within a layer.

compute_stack_layout
#

stack_layout.ts view source

(nodes: readonly StackNodeInput[], edges: readonly StackEdge[]): StackNode[] import {compute_stack_layout} from '@fuzdev/fuz_docs/stack_layout.js';

Computes baked layout positions for the stack graph.

The full edges list is used only to derive the layering; the emitted edge list is owned by the caller (the generator emits every edge, including the dev ones this layout cuts).

nodes

raw nodes keyed by name

type readonly StackNodeInput[]

edges

every dependency edge (prod, peer, and dev)

type readonly StackEdge[]

returns

StackNode[]

positioned nodes sorted by name, with layer, fan_in, x, y filled in

ROW_GAP
#

stack_layout.ts view source

120 import {ROW_GAP} from '@fuzdev/fuz_docs/stack_layout.js';

Vertical spacing between adjacent layers.

StackNodeInput
#

stack_layout.ts view source

StackNodeInput import type {StackNodeInput} from '@fuzdev/fuz_docs/stack_layout.js';

Raw node input to compute_stack_layout — the positioned fields are filled in by the layout.

name

Short repo/display name, e.g. fuz_util, fuz.dev.

type string

category

type StackCategory

language

type StackLanguage

description

From the manifest description field; empty string if none.

type string

Depends on
#