MCPcopy
hub / github.com/opentrace/opentrace / nodeSize

Function nodeSize

ui/src/components/graph/layoutHelpers.ts:31–47  ·  view source on GitHub ↗
(
  degree: number,
  nodeType: string,
  structuralTypes: Set<string>,
)

Source from the content-addressed store, hash-verified

29// ─── Node Sizing ─────────────────────────────────────────────────────────
30
31export function nodeSize(
32 degree: number,
33 nodeType: string,
34 structuralTypes: Set<string>,
35): number {
36 const base = Math.min(
37 NODE_SIZE_MAX,
38 Math.max(
39 NODE_SIZE_MIN,
40 NODE_SIZE_MIN + Math.sqrt(degree) * NODE_SIZE_DEGREE_SCALE,
41 ),
42 );
43 const multiplier =
44 NODE_SIZE_MULTIPLIERS[nodeType] ??
45 (structuralTypes.has(nodeType) ? NODE_SIZE_MULTIPLIERS._structural : 1);
46 return base * multiplier;
47}
48
49// ─── Endpoint ID Extraction ──────────────────────────────────────────────
50

Callers 2

usePixiLayoutFunction · 0.90
useGraphInstanceFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected