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

Function layout_radius

src/ui/http_server.c:1421–1436  ·  view source on GitHub ↗

Bounding-radius of a layout result: max distance from origin across all * nodes. Used to size galaxy spacing so satellites don't overlap the primary * cluster. Layouts with a 1000-node cluster have radius ~1500; the previous * fixed 600 spacing buried satellites inside the primary mass. */

Source from the content-addressed store, hash-verified

1419 * cluster. Layouts with a 1000-node cluster have radius ~1500; the previous
1420 * fixed 600 spacing buried satellites inside the primary mass. */
1421static double layout_radius(const cbm_layout_result_t *r) {
1422 if (!r || r->node_count == 0)
1423 return 0.0;
1424 double max_r2 = 0.0;
1425 for (int i = 0; i < r->node_count; i++) {
1426 double x = (double)r->nodes[i].x;
1427 double y = (double)r->nodes[i].y;
1428 double z = (double)r->nodes[i].z;
1429 if (!isfinite(x) || !isfinite(y) || !isfinite(z))
1430 continue;
1431 double r2 = x * x + y * y + z * z;
1432 if (r2 > max_r2)
1433 max_r2 = r2;
1434 }
1435 return sqrt(max_r2);
1436}
1437
1438/* Attach the missed-graph skeleton (#963) to the primary layout doc as
1439 * "missed_graph": {"nodes":[...], "edges":[...], "offset":{x,y,z}}

Callers 2

attach_missed_graphFunction · 0.85
handle_layoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected