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

Function clampNodeBudget

graph-ui/src/hooks/useGraphData.ts:26–33  ·  view source on GitHub ↗
(value: number)

Source from the content-addressed store, hash-verified

24export const GRAPH_NODE_BUDGET_MAX = 10_000_000;
25
26export function clampNodeBudget(value: number): number {
27 if (!Number.isFinite(value)) return GRAPH_RENDER_NODE_LIMIT;
28 const stepped =
29 Math.round(value / GRAPH_NODE_BUDGET_STEP) * GRAPH_NODE_BUDGET_STEP;
30 if (stepped < GRAPH_NODE_BUDGET_STEP) return GRAPH_NODE_BUDGET_STEP;
31 if (stepped > GRAPH_NODE_BUDGET_MAX) return GRAPH_NODE_BUDGET_MAX;
32 return stepped;
33}
34
35export async function fetchLayout(
36 project: string,

Callers 3

loadNodeBudgetFunction · 0.90
GraphTabFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected