MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / insert

Function insert

graph-ui/src/galaxy/screen-node-spacing.ts:59–69  ·  view source on GitHub ↗
(disk: Disk, scale = disk.radius)

Source from the content-addressed store, hash-verified

57 };
58
59 const insert = (disk: Disk, scale = disk.radius) => {
60 left = Math.min(left, disk.x - disk.radius); right = Math.max(right, disk.x + disk.radius);
61 top = Math.min(top, disk.y - disk.radius); bottom = Math.max(bottom, disk.y + disk.radius);
62 if (disk.radius === 0) return; // Zero-area disks cannot obstruct later zero-area disks.
63 const width = 2 ** Math.ceil(Math.log2(scale * 2));
64 let level = levels.get(width);
65 if (!level) { level = { width, columns: new Map() }; levels.set(width, level); }
66 const x = Math.floor(disk.x / width), y = Math.floor(disk.y / width);
67 let column = level.columns.get(x); if (!column) { column = new Map(); level.columns.set(x, column); }
68 const bucket = column.get(y) ?? []; bucket.push(disk); column.set(y, bucket);
69 };
70
71 for (const { node, index, pinned: fixed } of order) {
72 const radius = node.radius + gap / 2;

Callers 1

separateScreenNodesFunction · 0.70

Calls 2

getMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected