feat(FN-3082): restructure dependency graph plugin with modular architectur

Implements a modular dependency graph feature for the Fusion dashboard plugin, replacing the monolithic `DependencyGraphView` component with a factored architecture: graph types and filtering (Step 1), a data hook (Step 2), auto-layout engine (Step 3), SVG edge rendering (Step 4), an interaction hoo

Fusion-Task-Id: FN-3082
This commit is contained in:
Fusion
2026-05-07 01:34:57 -07:00
committed by gsxdsm
parent fa57034c05
commit 12326eeb00
28 changed files with 1021 additions and 928 deletions

View File

@@ -0,0 +1,17 @@
import { useMemo } from "react";
import type { Task } from "@fusion/core";
import type { GraphData, GraphNode } from "./types";
export function useGraphData(tasks: Task[]): GraphData {
return useMemo(() => {
const nodes: GraphNode[] = tasks.map((task) => ({ task }));
const taskIds = new Set(tasks.map((task) => task.id));
const edges = tasks.flatMap((task) =>
(task.dependencies ?? [])
.filter((dependencyId) => taskIds.has(dependencyId))
.map((dependencyId) => ({ source: task.id, target: dependencyId })),
);
return { nodes, edges };
}, [tasks]);
}