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

Function moduleMetaLabel

ui/src/lib/map-model.ts:121–135  ·  view source on GitHub ↗
(module: WireMapModule, island = false)

Source from the content-addressed store, hash-verified

119 * text will not fit the box that was sized for it.
120 */
121export function moduleMetaLabel(module: WireMapModule, island = false): string {
122 if (island) return 'nothing depends on this';
123 const symbols = `${module.symbols} symbol${module.symbols === 1 ? '' : 's'}`;
124 const files = `${module.files} file${module.files === 1 ? '' : 's'}`;
125 // How big a change here is, said in the same breath as how big the module is.
126 // Two boxes of 20 files are not the same box when one of them is imported by
127 // ninety files and the other by two, and until this line the picture had no
128 // channel that said so — width tracked the length of the PATH.
129 // `?.` because `GraphAdapter` is a public seam: a host that assembles this
130 // payload itself and has not caught up to the field must lose the bar, not
131 // the screen. Every other read of `dependents` goes through this one.
132 const reach = module.dependents?.files ?? 0;
133 const depend = reach > 0 ? ` · ${reach} depend on it` : '';
134 return `${symbols} · ${files}${depend}`;
135}
136
137/** One port on a box's edge: the link it belongs to, and which end of it this is. */
138export interface PortRef {

Callers 3

mapNodeSvgFunction · 0.90
buildMapLayoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected