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

Function rootAt

graph-ui/src/galaxy/organic-clusters.test.ts:103–106  ·  view source on GitHub ↗
(layout: { data: GraphData }, id: number)

Source from the content-addressed store, hash-verified

101 it('keeps the root at the origin across expansions, for a fresh trace and for a previous picture without it', () => {
102 const origin = { x: 0, y: 0, z: 0 };
103 const rootAt = (layout: { data: GraphData }, id: number) => {
104 const found = layout.data.nodes.find(candidate => candidate.id === id)!;
105 return { x: found.x + 0, y: found.y + 0, z: found.z + 0 };
106 };
107 const first = layoutOrganicClusters({ nodes: [node(0), node(1), node(2)], edges: [edge(0, 1), edge(2, 0)], total_nodes: 3 },
108 { rootIds: new Set([0]) });
109 expect(rootAt(first, 0)).toEqual(origin);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected