MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / widthOf

Function widthOf

ui/src/lib/steps-model.ts:727–738  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

725 degree.set(l.target, (degree.get(l.target) ?? 0) + 1);
726 }
727 const widthOf = (id: string): number => {
728 const info = infos.get(id);
729 // A cut step wears ` …` after its name and the anchor its ● mark before
730 // it; size for both, or the CSS ellipsis eats the name's tail instead
731 // (`/scan-to-verif…` for `/scan-to-verify …`).
732 const cut = info?.step.cut != null ? ' …' : '';
733 const mark = info?.step.anchor ? '● ' : '';
734 return Math.max(
735 nodeWidth(mark + (info?.label ?? id) + cut, info?.sub ?? ''),
736 ((degree.get(id) ?? 0) + 1) * PORT_PITCH
737 );
738 };
739
740 // Regions in the order the walk met them — the screen's own source order.
741 interface Region {

Callers 5

spreadFunction · 0.85
placeFunction · 0.85
flatFunction · 0.85
layoutAtFunction · 0.85
packRegionsFunction · 0.85

Calls 2

nodeWidthFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected