{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "node-graph",
  "type": "registry:component",
  "title": "NodeGraph",
  "description": "A hub-and-spoke constellation: a labeled central hub with satellite nodes that fly in from off-frame, then settle into elliptical orbits at varying radii and speeds. Connection lines hub→satellite periodically light up. All motion is a deterministic, frame-driven, seeded function (§1).",
  "dependencies": [
    "remotion",
    "zod",
    "react"
  ],
  "registryDependencies": [
    "lib-canvas",
    "lib-primitives",
    "lib-random"
  ],
  "files": [
    {
      "path": "registry/components/node-graph/NodeGraph.tsx",
      "type": "registry:component",
      "target": "components/onda/node-graph/NodeGraph.tsx",
      "content": "import React from 'react';\nimport { AbsoluteFill, useCurrentFrame, useVideoConfig, spring, interpolate, Easing } from 'remotion';\nimport { PlacementBox, resolveSize } from '../../../lib/canvas';\nimport { Glow } from '../../../lib/primitives';\nimport { seededRandom } from '../../../lib/random';\nimport { nodeGraphSchema, type NodeGraphProps } from './schema';\n\nexport { nodeGraphSchema, type NodeGraphProps };\n\n// House motion constants (CLAUDE.md §3) — smooth, settled, no overshoot.\nconst HOUSE_SPRING = { damping: 200, stiffness: 100, mass: 1 } as const;\nconst HOUSE_EASE = Easing.bezier(0.16, 1, 0.3, 1);\n// Frames between sibling fly-ins (§3 stagger envelope, scaled to ~30fps feel).\nconst STAGGER = 4;\n// How far off-frame a satellite starts before it flies into orbit.\nconst FLY_IN_DISTANCE = 1400;\n\n/**\n * A hub-and-spoke constellation — a labeled central hub with satellite nodes\n * that fly in from off-frame, then settle into elliptical orbits at varying\n * radii and angular speeds. Connection lines hub→satellite periodically light\n * up. Everything is a pure function of `useCurrentFrame()` and a seed (§1), so\n * it renders deterministically and loops on the orbital periods.\n *\n * @example\n * <NodeGraph hubLabel=\"AI\" />\n */\nexport const NodeGraph: React.FC<NodeGraphProps> = ({\n  hubLabel,\n  satellites,\n  accent,\n  ellipse,\n  seed,\n  delay,\n  glow,\n  hubDiameter,\n  hubSize,\n  hubFontSize,\n  background,\n  fontFamily,\n  placement,\n}) => {\n  const frame = useCurrentFrame();\n  const { fps, width, height } = useVideoConfig();\n  const rand = seededRandom(seed);\n\n  const resolvedHubFontSize = hubSize ? resolveSize(hubSize, { width, height }) : hubFontSize;\n\n  // Hub entrance — a single calm scale-rise on the house spring.\n  const hubP = spring({\n    frame: Math.max(0, frame - delay),\n    fps,\n    config: HOUSE_SPRING,\n    durationInFrames: 24,\n  });\n  const hubScale = interpolate(hubP, [0, 1], [0.7, 1]);\n  const hubOpacity = interpolate(frame - delay, [0, 14], [0, 1], {\n    extrapolateLeft: 'clamp',\n    extrapolateRight: 'clamp',\n    easing: HOUSE_EASE,\n  });\n\n  // Per-satellite deterministic motion. The seeded `rand()` draws are pulled\n  // once per satellite in fixed order, so the sequence is stable every render.\n  const nodes = satellites.map((sat, i) => {\n    // Off-frame fly-in origin: a seeded direction, pushed out beyond the frame.\n    const flyAngle = rand() * Math.PI * 2;\n    const startX = Math.cos(flyAngle) * FLY_IN_DISTANCE;\n    const startY = Math.sin(flyAngle) * FLY_IN_DISTANCE;\n    // Connection-line pulse phase — seeded so siblings don't blink in unison.\n    const pulsePhase = rand() * Math.PI * 2;\n\n    const localDelay = delay + i * STAGGER;\n    const t = frame - localDelay;\n\n    // Settled orbital position (elliptical: y squashed by `ellipse`).\n    const angle = sat.startAngle + sat.speed * Math.max(0, t);\n    const orbitX = Math.cos(angle) * sat.radius;\n    const orbitY = Math.sin(angle) * sat.radius * ellipse;\n\n    // Fly-in blends start → orbit on the house spring (no overshoot).\n    const p = spring({\n      frame: Math.max(0, t),\n      fps,\n      config: HOUSE_SPRING,\n      durationInFrames: 30,\n    });\n    const x = interpolate(p, [0, 1], [startX, orbitX]);\n    const y = interpolate(p, [0, 1], [startY, orbitY]);\n\n    const opacity = interpolate(t, [0, 16], [0, 1], {\n      extrapolateLeft: 'clamp',\n      extrapolateRight: 'clamp',\n      easing: HOUSE_EASE,\n    });\n\n    // Deterministic line \"light-up\": a slow sine, raised to a power so the\n    // line sits dim most of the time and briefly flares. Gated by `p` so it\n    // stays dark until the satellite has arrived.\n    const wave = (Math.sin(t * 0.06 + pulsePhase) + 1) / 2; // 0..1\n    const flare = Math.pow(wave, 4); // mostly low, brief peaks\n    const lineLit = flare * p;\n\n    return { sat, x, y, opacity, lineLit };\n  });\n\n  return (\n    <AbsoluteFill style={{ background }}>\n      <PlacementBox placement={placement ?? 'center'}>\n        <div style={{ position: 'relative', width: 0, height: 0 }}>\n          {/* Connection lines — SVG layer behind the nodes, centered on the hub. */}\n          <svg\n            width={width}\n            height={height}\n            viewBox={`${-width / 2} ${-height / 2} ${width} ${height}`}\n            style={{\n              position: 'absolute',\n              left: -width / 2,\n              top: -height / 2,\n              pointerEvents: 'none',\n              overflow: 'visible',\n            }}\n          >\n            {nodes.map(({ x, y, opacity, lineLit }, i) => (\n              <line\n                key={i}\n                x1={0}\n                y1={0}\n                x2={x}\n                y2={y}\n                stroke={accent}\n                strokeWidth={interpolate(lineLit, [0, 1], [1, 2.4])}\n                opacity={opacity * interpolate(lineLit, [0, 1], [0.12, 0.85])}\n              />\n            ))}\n          </svg>\n\n          {glow && (\n            <div\n              style={{\n                position: 'absolute',\n                left: -width / 2,\n                top: -height / 2,\n                width,\n                height,\n              }}\n            >\n              <Glow color={accent} size={0.7} opacity={0.22 * hubOpacity} />\n            </div>\n          )}\n\n          {/* Satellite nodes. */}\n          {nodes.map(({ sat, x, y, opacity }, i) => (\n            <div\n              key={i}\n              style={{\n                position: 'absolute',\n                left: 0,\n                top: 0,\n                transform: `translate(-50%, -50%) translate(${x}px, ${y}px)`,\n                opacity,\n                display: 'flex',\n                alignItems: 'center',\n                justifyContent: 'center',\n                padding: '10px 18px',\n                borderRadius: 999,\n                background: 'var(--onda-surface, #0E0E12)',\n                border: '1px solid #1C1C22',\n                boxShadow: '0 20px 40px -28px rgba(0,0,0,0.9)',\n                color: 'var(--onda-text, #F2F2F4)',\n                fontFamily,\n                fontSize: 20,\n                fontWeight: 600,\n                letterSpacing: '-0.02em',\n                whiteSpace: 'nowrap',\n              }}\n            >\n              {sat.label}\n            </div>\n          ))}\n\n          {/* Central hub. */}\n          <div\n            style={{\n              position: 'absolute',\n              left: 0,\n              top: 0,\n              width: hubDiameter,\n              height: hubDiameter,\n              transform: `translate(-50%, -50%) scale(${hubScale})`,\n              opacity: hubOpacity,\n              display: 'flex',\n              alignItems: 'center',\n              justifyContent: 'center',\n              borderRadius: '50%',\n              background: `radial-gradient(circle at 50% 35%, ${accent}, #0E0E12 78%)`,\n              border: `1px solid ${accent}`,\n              boxShadow: `0 0 60px -10px ${accent}, 0 30px 60px -34px rgba(0,0,0,0.9)`,\n              color: 'var(--onda-text, #F2F2F4)',\n              fontFamily,\n              fontSize: resolvedHubFontSize,\n              fontWeight: 600,\n              letterSpacing: '-0.03em',\n            }}\n          >\n            {hubLabel}\n          </div>\n        </div>\n      </PlacementBox>\n    </AbsoluteFill>\n  );\n};\n\nexport default NodeGraph;\n"
    },
    {
      "path": "registry/components/node-graph/schema.ts",
      "type": "registry:component",
      "target": "components/onda/node-graph/schema.ts",
      "content": "import { z } from 'zod';\nimport { placementSchema, sizeRoleSchema } from '../../../lib/canvas-schemas';\n\n/** One orbiting satellite node in the constellation. */\nexport const satelliteSchema = z.object({\n  /** Short label inside the node — a word or single character reads best. */\n  label: z.string(),\n  /** Orbit radius in px (distance from the hub). Satellites at varying radii read as depth. */\n  radius: z.number().positive(),\n  /** Angular speed in radians per frame. Small values keep the drift calm; signed for either direction. */\n  speed: z.number(),\n  /** Starting angle in radians — where the satellite sits in its orbit at frame 0. */\n  startAngle: z.number(),\n});\n\n/** Inferred shape for a single {@link NodeGraph} satellite. */\nexport type Satellite = z.infer<typeof satelliteSchema>;\n\n/** Zod schema for {@link NodeGraph} props. */\nexport const nodeGraphSchema = z.object({\n  /** Discriminator literal — matches this entry's registry slug. Auto-populated when omitted (`schema.parse({})` works as before). Lets consumers build `z.discriminatedUnion('kind', [...])` directly over onda schemas. */\n  kind: z.literal('node-graph').default('node-graph'),\n  /** Label inside the central hub node — a single character or short word. */\n  hubLabel: z.string().default('AI'),\n  /** The orbiting satellites. Each flies in from off-frame, then settles into its elliptical orbit. ~5 reads as a believable constellation. */\n  satellites: z.array(satelliteSchema).default([\n    { label: 'data',   radius: 260, speed:  0.010, startAngle: 0.4 },\n    { label: 'model',  radius: 340, speed: -0.007, startAngle: 1.7 },\n    { label: 'render', radius: 210, speed:  0.013, startAngle: 2.9 },\n    { label: 'audio',  radius: 380, speed: -0.006, startAngle: 4.1 },\n    { label: 'scene',  radius: 300, speed:  0.009, startAngle: 5.3 },\n  ]),\n  /** The earned accent — hub fill tint, satellite ring, and the lighting-up connection lines. */\n  accent: z.string().default('var(--onda-accent, #D96B82)'),\n  /** Vertical squash of every orbit (1 = circular, <1 = elliptical) — a slight ellipse reads as perspective. */\n  ellipse: z.number().min(0.2).max(1).default(0.62),\n  /** Seed for the deterministic fly-in directions and the connection-pulse phases. */\n  seed: z.number().int().default(7),\n  /** Frames before the constellation begins assembling. */\n  delay: z.number().int().min(0).default(0),\n  /** Show the soft accent glow behind the hub. */\n  glow: z.boolean().default(true),\n  /** Hub node diameter in px. Wins over `hubSize` if both are passed. */\n  hubDiameter: z.number().positive().default(120),\n  /** Semantic role for the hub label — resolves to canvas-aware pixels. `hubFontSize` wins when both are passed. */\n  hubSize: sizeRoleSchema.optional(),\n  /** Hub label size in px. Wins over `hubSize` if both are passed. */\n  hubFontSize: z.number().positive().default(34),\n  /** Background canvas color behind the constellation. */\n  background: z.string().default('var(--onda-bg, #08080A)'),\n  /** Onda display font for every label. */\n  fontFamily: z.string().default('var(--onda-font-display, \"Clash Display\", sans-serif)'),\n  /** Where on the canvas the hub (and its orbits) is centered. Region (`'center'`, `'upper-third'`, ...) or `{ x, y, anchor }` in 0..1 canvas fractions. Defaults to centered. */\n  placement: placementSchema.optional(),\n});\n\n/** Inferred props for {@link NodeGraph}. */\nexport type NodeGraphProps = z.infer<typeof nodeGraphSchema>;\n"
    },
    {
      "path": "registry/components/node-graph/node-graph.meta.json",
      "type": "registry:file",
      "target": "components/onda/node-graph/node-graph.meta.json",
      "content": "{\n  \"name\": \"node-graph\",\n  \"title\": \"NodeGraph\",\n  \"description\": \"A hub-and-spoke constellation: a labeled central hub with satellite nodes that fly in from off-frame, then settle into elliptical orbits at varying radii and speeds. Connection lines hub→satellite periodically light up. All motion is a deterministic, frame-driven, seeded function (§1).\",\n  \"pickWhen\": \"showing a system of relationships around one center — integrations, ecosystem, \\\"X powers everything.\\\" Not a chart; it's a metaphor.\",\n  \"category\": \"graphics\",\n  \"tags\": [\n    \"graph\",\n    \"constellation\",\n    \"orbit\",\n    \"network\",\n    \"hub\"\n  ],\n  \"dependencies\": [\n    \"remotion\",\n    \"zod\",\n    \"react\"\n  ]\n}\n"
    },
    {
      "path": "registry/components/node-graph/README.md",
      "type": "registry:file",
      "target": "components/onda/node-graph/README.md",
      "content": "# NodeGraph\n\nA hub-and-spoke constellation, full-canvas. A labeled central hub rises in on the house spring, then `satellites` fly in from off-frame (seeded directions) and settle into **elliptical orbits** at varying radii and angular speeds — all a pure function of `useCurrentFrame()` and `seed`, so it renders deterministically and loops on the orbital periods (CLAUDE.md §1). Connection lines hub→satellite sit dim, then briefly **light up** in the accent on a deterministic, seeded-phase pulse. An optional soft `Glow` sits behind the hub. Looks complete with zero props (`<NodeGraph />`).\n\n## Props\n\n| Prop | Type | Default | Notes |\n| --- | --- | --- | --- |\n| `hubLabel` | `string` | `\"AI\"` | Label inside the central hub — a character or short word. |\n| `satellites` | `{ label, radius, speed, startAngle }[]` | 5 sample nodes | Each flies in, then orbits. `radius` px, `speed` rad/frame (signed), `startAngle` rad. |\n| `accent` | `string` | `#D96B82` | Earned accent — hub tint, ring, and the lighting-up lines. |\n| `ellipse` | `number` | `0.62` | Vertical squash of every orbit (1 = circular). |\n| `seed` | `number` | `7` | Drives fly-in directions and the connection-pulse phases. |\n| `delay` | `number` | `0` | Frames before the constellation assembles. |\n| `glow` | `boolean` | `true` | Soft accent glow behind the hub. |\n| `hubDiameter` | `number` | `120` | Hub node diameter in px. |\n| `hubFontSize` | `number` | `34` | Hub label size in px; wins over `hubSize`. |\n| `hubSize` | size role | — | Semantic role for the hub label → canvas-aware px. |\n| `background` | `string` | `#08080A` | Canvas color behind the constellation. |\n| `fontFamily` | `string` | Clash Display | Font for every label. |\n| `placement` | region or `{x,y,anchor}` | `center` | Where the hub (and its orbits) is centered. |\n\n## Usage\n\n```tsx\nimport { Sequence } from 'remotion';\nimport { NodeGraph } from './components/onda/node-graph/NodeGraph';\n\nexport const ConstellationScene = () => (\n  <Sequence durationInFrames={240}>\n    <NodeGraph\n      hubLabel=\"AI\"\n      satellites={[\n        { label: 'data',   radius: 260, speed: 0.010, startAngle: 0.4 },\n        { label: 'model',  radius: 340, speed: -0.007, startAngle: 1.7 },\n        { label: 'render', radius: 210, speed: 0.013, startAngle: 2.9 },\n        { label: 'audio',  radius: 380, speed: -0.006, startAngle: 4.1 },\n        { label: 'scene',  radius: 300, speed: 0.009, startAngle: 5.3 },\n      ]}\n    />\n  </Sequence>\n);\n```\n"
    }
  ]
}
