Norn/web/epiphany-graph-viewer
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-05-19 14:29:21 +01:00
..
src Add realtime viewer performance controls 2026-05-19 14:29:21 +01:00
index.html Add Epiphany typed graph web viewer 2026-04-29 21:28:47 +01:00
package-lock.json Add Epiphany typed graph web viewer 2026-04-29 21:28:47 +01:00
package.json Clarify React viewer public API 2026-05-19 13:49:57 +01:00
README.md Add realtime viewer performance controls 2026-05-19 14:29:21 +01:00
tsconfig.json Add Epiphany typed graph web viewer 2026-04-29 21:28:47 +01:00
vite.config.ts Add Epiphany typed graph web viewer 2026-04-29 21:28:47 +01:00

Epiphany Graph Viewer

React component package for browsing Epiphany's durable typed graph state.

This package is the live client surface. The viewer owns layout, motion, selection, inspection, and rendering policy; consuming apps provide typed graph state and coarse viewer intent. Nobody needs to learn which engine coughed up which coordinates. That was how we got the little public API landfill.

  • graphs.architecture and graphs.dataflow render as first-class views
  • graphs.links show cross-graph correspondences instead of vanishing into a sidecar file
  • zoom reveals more node detail instead of trying to print the whole phone book at once
  • selection opens purpose, mechanism, metaphor, status, and code references in a detail pane
  • layoutMode="combined-force" gives clients the compact ELK shape plus live force motion

Install

cd E:\Projects\EpiphanyGraph\web\epiphany-graph-viewer
npm install

Run The Demo

npm run dev

The demo uses mocked JSON shaped like the current Epiphany typed state contract.

Build

npm run build

This writes:

  • dist/index.js
  • dist/index.cjs
  • dist/index.d.ts
  • dist/demo/

Use In Another App

import { EpiphanyGraphViewer } from "@epiphanygraph/epiphany-graph-viewer";
import type { EpiphanyGraphsState } from "@epiphanygraph/epiphany-graph-viewer";

const state: EpiphanyGraphsState = {
  architecture: { nodes: [], edges: [] },
  dataflow: { nodes: [], edges: [] },
  links: [],
};

export function Screen() {
  return (
    <EpiphanyGraphViewer
      state={state}
      layoutMode="combined-force"
      motion={{ strength: 1.05, flow: 1.1, orbit: 0.85 }}
      performance="fast"
    />
  );
}

Public API

The package exports:

  • EpiphanyGraphViewer
  • state, selection, node, edge, layout mode, motion, performance, and event payload types

The package does not export demo data, validation helpers, ELK probes, SVG renderers, or engine controls. Those are implementation furniture. Consumers get the couch, not the warehouse inventory.

Layout Modes

  • layered: stable default for hierarchy-heavy graphs
  • stress: compact overview shape for dense graphs
  • force: ELK force layout without browser-side motion
  • combined-force: compact overview plus viewer-owned force motion

layoutMode accepts one mode for both graphs or per-graph modes:

<EpiphanyGraphViewer
  state={state}
  layoutMode={{ architecture: "layered", dataflow: "combined-force" }}
/>

Motion

combined-force enables motion automatically. Pass motion={false} to freeze it, or tune the viewer-owned model:

<EpiphanyGraphViewer
  state={state}
  layoutMode="combined-force"
  motion={{
    strength: 1.1,
    damping: 0.84,
    flow: 1.15,
    orbit: 0.8,
    lift: 0.9,
    pulse: 1,
    emitNodeEnvelopes: true,
  }}
/>

emitNodeEnvelopes dispatches epiphanygraph-node-envelopes from the viewport for backdrops that want node-aware effects without owning graph physics.

Performance

The viewer is tuned as a realtime machine. Clients choose a speed budget, and the viewer adjusts animation frequency, node motion budget, edge refresh rate, and time step stability.

<EpiphanyGraphViewer
  state={state}
  layoutMode="combined-force"
  performance="fast"
/>

Presets:

  • quality: 60 FPS target, all practical nodes animated, edges refreshed every frame
  • balanced: 40 FPS target, capped node motion, edges refreshed every other step
  • fast: 24 FPS target, smaller animated-node budget, edges refreshed every third step

Use explicit knobs when the host app knows its budget:

<EpiphanyGraphViewer
  state={state}
  layoutMode="combined-force"
  performance={{
    preset: "fast",
    targetFps: 30,
    maxAnimatedNodes: 120,
    edgeRefreshRate: 3,
    maxTimeStepMs: 24,
  }}
/>