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

Function spread

ui/src/lib/steps-model.ts:848–862  ·  view source on GitHub ↗
(list: string[], left: number)

Source from the content-addressed store, hash-verified

846 let line = 0;
847 let width = 0;
848 const spread = (list: string[], left: number): void => {
849 if (list.length === 0) return;
850 let lx = left;
851 for (const id of list) {
852 const bw = widthOf(id);
853 if (lx > left && lx + bw - left > lineMax) {
854 line += 1;
855 lx = left;
856 }
857 pos.set(id, { x: lx, line });
858 width = Math.max(width, lx + bw);
859 lx += bw + NODE_GAP;
860 }
861 line += 1;
862 };
863 const place = (id: string, depth: number): void => {
864 const x = Math.min(depth, CLUSTER_DEPTH_MAX) * CLUSTER_INDENT;
865 pos.set(id, { x, line });

Callers 1

placeFunction · 0.70

Calls 2

widthOfFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected