0.18);
const rendersCompact = !rendersArticle && metrics.preview < 0.08;
const className = nodeArticleSurface
- ? ["epiphany-graph-node-surface", nodeArticleSurface.className].filter(Boolean).join(" ")
- : "epiphany-graph-node-surface";
+ ? ["norn-node-surface", nodeArticleSurface.className].filter(Boolean).join(" ")
+ : "norn-node-surface";
return (
;
- links: EpiphanyGraphLink[];
+ links: NornGraphLink[];
onJump: (graphKey: GraphKey, nodeId: string) => void;
onCodeRefSelect: (codeRef: EpiphanyCodeRef) => void;
}) {
@@ -1612,7 +1612,7 @@ function renderBackdropGrid(layout: GraphLayout, graphKey: GraphKey) {
function findLinkedNodes(
nodeId: string,
graphKey: GraphKey,
- state: EpiphanyGraphViewerProps["state"],
+ state: NornViewerProps["state"],
) {
if (graphKey === "architecture") {
return state.links
@@ -1698,7 +1698,7 @@ function nodeNearestViewportCenter(
return nearest;
}
-function layoutModeCacheKey(mode: EpiphanyGraphLayoutModeConfig) {
+function layoutModeCacheKey(mode: NornGraphLayoutModeConfig) {
if (typeof mode === "string") {
return mode;
}
@@ -1707,9 +1707,9 @@ function layoutModeCacheKey(mode: EpiphanyGraphLayoutModeConfig) {
}
function resolveMotionOptions(
- layoutMode: EpiphanyGraphLayoutModeConfig,
- motion: EpiphanyGraphMotionOptions | boolean | undefined,
-): EpiphanyGraphMotionOptions | null {
+ layoutMode: NornGraphLayoutModeConfig,
+ motion: NornGraphMotionOptions | boolean | undefined,
+): NornGraphMotionOptions | null {
if (motion === false) {
return null;
}
@@ -1730,7 +1730,7 @@ function resolveMotionOptions(
return motion.enabled === false ? null : motion;
}
-function motionOptionsCacheKey(options: EpiphanyGraphMotionOptions) {
+function motionOptionsCacheKey(options: NornGraphMotionOptions) {
return [
options.strength ?? "",
options.damping ?? "",
@@ -1743,8 +1743,8 @@ function motionOptionsCacheKey(options: EpiphanyGraphMotionOptions) {
}
function resolvePerformanceOptions(
- performance: EpiphanyGraphPerformancePreset | EpiphanyGraphPerformanceOptions | undefined,
-): Required {
+ performance: NornGraphPerformancePreset | NornGraphPerformanceOptions | undefined,
+): Required {
const base = performancePresetDefaults(
typeof performance === "string" ? performance : performance?.preset ?? "balanced",
);
@@ -1761,8 +1761,8 @@ function resolvePerformanceOptions(
}
function performancePresetDefaults(
- preset: EpiphanyGraphPerformancePreset,
-): Required {
+ preset: NornGraphPerformancePreset,
+): Required {
if (preset === "quality") {
return {
preset,
@@ -1783,7 +1783,7 @@ function performancePresetDefaults(
};
}
-function performanceOptionsCacheKey(options: Required) {
+function performanceOptionsCacheKey(options: Required) {
return [
options.preset,
options.simulationBudgetMs,
@@ -1812,7 +1812,7 @@ function clampFiniteNumber(value: number, min: number, max: number) {
function createAdaptiveSimulationBudget(
nodeCount: number,
- options: Required,
+ options: Required,
): AdaptiveSimulationBudget {
return {
nodeBudget: Math.min(nodeCount, options.maxAnimatedNodes),
@@ -1825,7 +1825,7 @@ function adjustAdaptiveSimulationBudget(
budget: AdaptiveSimulationBudget,
costMs: number,
nodeCount: number,
- options: Required,
+ options: Required,
) {
const target = options.simulationBudgetMs;
const profile = simulationProfilePresets[options.preset];
@@ -1937,7 +1937,7 @@ function stepDynamicLayouts({
states: React.MutableRefObject | null>;
activeGraphKey: GraphKey;
transforms: Record;
- motionOptions: EpiphanyGraphMotionOptions;
+ motionOptions: NornGraphMotionOptions;
viewportElement: HTMLElement | null;
viewportWidth: number;
viewportHeight: number;
@@ -2023,7 +2023,7 @@ function stepDynamicLayouts({
previousLayout,
);
if (motionOptions.emitNodeEnvelopes && viewportElement) {
- viewportElement.dispatchEvent(new CustomEvent("epiphanygraph-node-envelopes", {
+ viewportElement.dispatchEvent(new CustomEvent("norn-node-envelopes", {
bubbles: true,
detail: nextActiveLayout.nodes.map((node) => ({
id: node.id,
@@ -2851,7 +2851,7 @@ function isArticleContentTarget(target: EventTarget | null) {
return false;
}
- const surface = target.closest(".epiphany-graph-node-surface");
+ const surface = target.closest(".norn-node-surface");
if (!surface) {
return false;
}
diff --git a/web/epiphany-graph-viewer/src/lib/layout.ts b/web/norn-viewer/src/lib/layout.ts
similarity index 95%
rename from web/epiphany-graph-viewer/src/lib/layout.ts
rename to web/norn-viewer/src/lib/layout.ts
index 74a6807..857c802 100644
--- a/web/epiphany-graph-viewer/src/lib/layout.ts
+++ b/web/norn-viewer/src/lib/layout.ts
@@ -1,11 +1,11 @@
import { layoutWithRustSolver } from "./solver-wasm";
import type {
- EpiphanyGraph,
- EpiphanyGraphEdge,
- EpiphanyGraphLink,
- EpiphanyGraphsState,
- EpiphanyGraphLayoutMode,
- EpiphanyGraphLayoutModeConfig,
+ NornGraph,
+ NornGraphEdge,
+ NornGraphLink,
+ NornGraphsState,
+ NornGraphLayoutMode,
+ NornGraphLayoutModeConfig,
GraphKey,
GraphLayout,
PositionedEdge,
@@ -20,9 +20,9 @@ type LayoutViewport = {
height: number;
};
-export async function layoutEpiphanyGraphs(
- state: EpiphanyGraphsState,
- mode: EpiphanyGraphLayoutModeConfig = "layered",
+export async function layoutNornGraphs(
+ state: NornGraphsState,
+ mode: NornGraphLayoutModeConfig = "layered",
viewport?: LayoutViewport,
): Promise> {
const [architecture, dataflow] = await Promise.all([
@@ -35,9 +35,9 @@ export async function layoutEpiphanyGraphs(
async function layoutGraph(
graphKey: GraphKey,
- graph: EpiphanyGraph,
- links: EpiphanyGraphLink[],
- mode: EpiphanyGraphLayoutMode = "layered",
+ graph: NornGraph,
+ links: NornGraphLink[],
+ mode: NornGraphLayoutMode = "layered",
viewport?: LayoutViewport,
): Promise {
const sizingAlgorithm = sizingAlgorithmForMode(mode);
@@ -120,8 +120,8 @@ async function layoutGraph(
function layoutModeFor(
graphKey: GraphKey,
- mode: EpiphanyGraphLayoutModeConfig,
-): EpiphanyGraphLayoutMode {
+ mode: NornGraphLayoutModeConfig,
+): NornGraphLayoutMode {
if (typeof mode === "string") {
return mode;
}
@@ -129,11 +129,11 @@ function layoutModeFor(
return mode[graphKey] ?? "layered";
}
-function sizingAlgorithmForMode(mode: EpiphanyGraphLayoutMode): NodeSizingMode {
+function sizingAlgorithmForMode(mode: NornGraphLayoutMode): NodeSizingMode {
return mode === "layered" ? "layered" : "compact";
}
-function rustSolverConfigFor(graphKey: GraphKey, mode: EpiphanyGraphLayoutMode) {
+function rustSolverConfigFor(graphKey: GraphKey, mode: NornGraphLayoutMode) {
if (mode === "layered") {
return {
iterations: graphKey === "architecture" ? 320 : 300,
@@ -331,7 +331,7 @@ function nodeCenter(node: { x: number; y: number; width: number; height: number
};
}
-function buildNodeDegrees(graph: EpiphanyGraph) {
+function buildNodeDegrees(graph: NornGraph) {
const degrees = new Map();
for (const node of graph.nodes ?? []) {
degrees.set(node.id, 0);
@@ -343,7 +343,7 @@ function buildNodeDegrees(graph: EpiphanyGraph) {
return degrees;
}
-function buildLinkCounts(graphKey: GraphKey, links: EpiphanyGraphLink[]) {
+function buildLinkCounts(graphKey: GraphKey, links: NornGraphLink[]) {
const counts = new Map();
for (const link of links ?? []) {
const nodeId =
@@ -353,7 +353,7 @@ function buildLinkCounts(graphKey: GraphKey, links: EpiphanyGraphLink[]) {
return counts;
}
-function resolveEdgeId(edge: EpiphanyGraphEdge, index: number) {
+function resolveEdgeId(edge: NornGraphEdge, index: number) {
return edge.id?.trim() ? edge.id : `${edge.source_id}->${edge.target_id}:${edge.kind}:${index}`;
}
@@ -456,7 +456,7 @@ function estimateCharacterCapacity(pixelWidth: number, averageCharWidth: number)
}
function straightEdgePoints(
- edge: EpiphanyGraphEdge,
+ edge: NornGraphEdge,
nodes: Map,
) {
const source = nodes.get(edge.source_id);
diff --git a/web/epiphany-graph-viewer/src/lib/mock-state.json b/web/norn-viewer/src/lib/mock-state.json
similarity index 100%
rename from web/epiphany-graph-viewer/src/lib/mock-state.json
rename to web/norn-viewer/src/lib/mock-state.json
diff --git a/web/norn-viewer/src/lib/mock-state.ts b/web/norn-viewer/src/lib/mock-state.ts
new file mode 100644
index 0000000..3f251b8
--- /dev/null
+++ b/web/norn-viewer/src/lib/mock-state.ts
@@ -0,0 +1,4 @@
+import rawState from "./mock-state.json";
+import type { NornGraphsState } from "./types";
+
+export const mockNornGraphState = rawState as NornGraphsState;
diff --git a/web/epiphany-graph-viewer/src/lib/simulation-profile.ts b/web/norn-viewer/src/lib/simulation-profile.ts
similarity index 87%
rename from web/epiphany-graph-viewer/src/lib/simulation-profile.ts
rename to web/norn-viewer/src/lib/simulation-profile.ts
index 61793de..fc42646 100644
--- a/web/epiphany-graph-viewer/src/lib/simulation-profile.ts
+++ b/web/norn-viewer/src/lib/simulation-profile.ts
@@ -1,4 +1,4 @@
-import type { EpiphanyGraphPerformancePreset } from "./types";
+import type { NornGraphPerformancePreset } from "./types";
export type SimulationProfilePreset = {
simulationBudgetMs: number;
@@ -13,7 +13,7 @@ export type SimulationProfilePreset = {
nodeBudgetGrowthAdd: number;
};
-export const simulationProfilePresets: Record = {
+export const simulationProfilePresets: Record = {
quality: {
simulationBudgetMs: 8,
targetFps: 60,
diff --git a/web/epiphany-graph-viewer/src/lib/solver-wasm-bytes.ts b/web/norn-viewer/src/lib/solver-wasm-bytes.ts
similarity index 100%
rename from web/epiphany-graph-viewer/src/lib/solver-wasm-bytes.ts
rename to web/norn-viewer/src/lib/solver-wasm-bytes.ts
diff --git a/web/epiphany-graph-viewer/src/lib/solver-wasm.ts b/web/norn-viewer/src/lib/solver-wasm.ts
similarity index 100%
rename from web/epiphany-graph-viewer/src/lib/solver-wasm.ts
rename to web/norn-viewer/src/lib/solver-wasm.ts
diff --git a/web/epiphany-graph-viewer/src/lib/types.ts b/web/norn-viewer/src/lib/types.ts
similarity index 70%
rename from web/epiphany-graph-viewer/src/lib/types.ts
rename to web/norn-viewer/src/lib/types.ts
index 85f8845..d685562 100644
--- a/web/epiphany-graph-viewer/src/lib/types.ts
+++ b/web/norn-viewer/src/lib/types.ts
@@ -10,7 +10,7 @@ export interface EpiphanyCodeRef {
note?: string | null;
}
-export interface EpiphanyGraphNode {
+export interface NornGraphNode {
id: string;
title: string;
purpose: string;
@@ -20,7 +20,7 @@ export interface EpiphanyGraphNode {
code_refs?: EpiphanyCodeRef[];
}
-export interface EpiphanyGraphEdge {
+export interface NornGraphEdge {
source_id: string;
target_id: string;
kind: string;
@@ -30,34 +30,34 @@ export interface EpiphanyGraphEdge {
code_refs?: EpiphanyCodeRef[];
}
-export interface EpiphanyGraph {
- nodes: EpiphanyGraphNode[];
- edges: EpiphanyGraphEdge[];
+export interface NornGraph {
+ nodes: NornGraphNode[];
+ edges: NornGraphEdge[];
}
-export interface EpiphanyGraphLink {
+export interface NornGraphLink {
dataflow_node_id: string;
architecture_node_id: string;
relationship?: string | null;
code_refs?: EpiphanyCodeRef[];
}
-export interface EpiphanyGraphsState {
- architecture: EpiphanyGraph;
- dataflow: EpiphanyGraph;
- links: EpiphanyGraphLink[];
+export interface NornGraphsState {
+ architecture: NornGraph;
+ dataflow: NornGraph;
+ links: NornGraphLink[];
}
-export type EpiphanyGraphLabels = Partial>;
-export type EpiphanyGraphDescriptions = Partial>;
-export type EpiphanyGraphLayoutMode = "layered" | "stress" | "force" | "combined-force";
-export type EpiphanyGraphLayoutModeConfig =
- | EpiphanyGraphLayoutMode
- | Partial>;
-export type EpiphanyGraphPerformancePreset = "quality" | "balanced" | "fast";
+export type NornGraphLabels = Partial>;
+export type NornGraphDescriptions = Partial>;
+export type NornGraphLayoutMode = "layered" | "stress" | "force" | "combined-force";
+export type NornGraphLayoutModeConfig =
+ | NornGraphLayoutMode
+ | Partial>;
+export type NornGraphPerformancePreset = "quality" | "balanced" | "fast";
-export interface EpiphanyGraphPerformanceOptions {
- preset?: EpiphanyGraphPerformancePreset;
+export interface NornGraphPerformanceOptions {
+ preset?: NornGraphPerformancePreset;
simulationBudgetMs?: number;
targetFps?: number;
maxAnimatedNodes?: number;
@@ -65,7 +65,7 @@ export interface EpiphanyGraphPerformanceOptions {
maxTimeStepMs?: number;
}
-export interface EpiphanyGraphMotionOptions {
+export interface NornGraphMotionOptions {
enabled?: boolean;
strength?: number;
damping?: number;
@@ -116,18 +116,18 @@ export type ViewportTransformEnvelope = {
};
};
-export interface EpiphanyGraphViewerProps {
- state: EpiphanyGraphsState;
+export interface NornViewerProps {
+ state: NornGraphsState;
initialGraph?: GraphKey;
selection?: ViewerSelection | null;
style?: CSSProperties;
className?: string;
title?: string;
- graphLabels?: EpiphanyGraphLabels;
- graphDescriptions?: EpiphanyGraphDescriptions;
- layoutMode?: EpiphanyGraphLayoutModeConfig;
- motion?: EpiphanyGraphMotionOptions | boolean;
- performance?: EpiphanyGraphPerformancePreset | EpiphanyGraphPerformanceOptions;
+ graphLabels?: NornGraphLabels;
+ graphDescriptions?: NornGraphDescriptions;
+ layoutMode?: NornGraphLayoutModeConfig;
+ motion?: NornGraphMotionOptions | boolean;
+ performance?: NornGraphPerformancePreset | NornGraphPerformanceOptions;
sidebar?: ReactNode;
sidebarWidth?: CSSProperties["width"];
showSidebar?: boolean;
@@ -166,7 +166,7 @@ export interface PositionedPoint {
y: number;
}
-export interface PositionedNode extends EpiphanyGraphNode {
+export interface PositionedNode extends NornGraphNode {
graphKey: GraphKey;
x: number;
y: number;
@@ -179,7 +179,7 @@ export interface PositionedNode extends EpiphanyGraphNode {
stroke: string;
}
-export interface PositionedEdge extends EpiphanyGraphEdge {
+export interface PositionedEdge extends NornGraphEdge {
resolvedId: string;
graphKey: GraphKey;
points: PositionedPoint[];
diff --git a/web/epiphany-graph-viewer/src/lib/validation.ts b/web/norn-viewer/src/lib/validation.ts
similarity index 95%
rename from web/epiphany-graph-viewer/src/lib/validation.ts
rename to web/norn-viewer/src/lib/validation.ts
index a3b4c88..2396938 100644
--- a/web/epiphany-graph-viewer/src/lib/validation.ts
+++ b/web/norn-viewer/src/lib/validation.ts
@@ -1,11 +1,11 @@
import type {
- EpiphanyGraph,
- EpiphanyGraphsState,
+ NornGraph,
+ NornGraphsState,
EpiphanyValidationIssue,
GraphKey,
} from "./types";
-export function validateEpiphanyGraphsState(state: EpiphanyGraphsState): EpiphanyValidationIssue[] {
+export function validateNornGraphsState(state: NornGraphsState): EpiphanyValidationIssue[] {
const issues: EpiphanyValidationIssue[] = [];
const architectureIds = validateGraph("architecture", state.architecture, issues);
const dataflowIds = validateGraph("dataflow", state.dataflow, issues);
@@ -51,7 +51,7 @@ export function validateEpiphanyGraphsState(state: EpiphanyGraphsState): Epiphan
function validateGraph(
graphKey: GraphKey,
- graph: EpiphanyGraph,
+ graph: NornGraph,
issues: EpiphanyValidationIssue[],
): Set {
const nodeIds = new Set();
diff --git a/web/epiphany-graph-viewer/src/main.tsx b/web/norn-viewer/src/main.tsx
similarity index 100%
rename from web/epiphany-graph-viewer/src/main.tsx
rename to web/norn-viewer/src/main.tsx
diff --git a/web/epiphany-graph-viewer/tsconfig.json b/web/norn-viewer/tsconfig.json
similarity index 100%
rename from web/epiphany-graph-viewer/tsconfig.json
rename to web/norn-viewer/tsconfig.json
diff --git a/web/epiphany-graph-viewer/vite.config.ts b/web/norn-viewer/vite.config.ts
similarity index 100%
rename from web/epiphany-graph-viewer/vite.config.ts
rename to web/norn-viewer/vite.config.ts