Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hindsight-control-plane/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"react-dom": "^19.2.0",
"react-markdown": "^10.1.0",
"react18-json-view": "^0.2.9",
"react-force-graph-3d": "^1.25.4",
"recharts": "^3.5.1",
"tailwind-merge": "^3.4.0",
"tailwindcss": "^4.1.17",
Expand Down
47 changes: 35 additions & 12 deletions hindsight-control-plane/src/components/data-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ import { Slider } from "@/components/ui/slider";
import { Switch } from "@/components/ui/switch";
import { MemoryDetailPanel } from "./memory-detail-panel";
import { Graph2D, convertHindsightGraphData, GraphNode } from "./graph-2d";
import { Graph3D } from "./graph-3d";

type FactType = "world" | "experience";
type ViewMode = "graph" | "table" | "timeline";
type ViewMode = "graph" | "graph3d" | "table" | "timeline";

interface DataViewProps {
factType: FactType;
Expand Down Expand Up @@ -297,7 +298,17 @@ export function DataView({ factType }: DataViewProps) {
: "text-muted-foreground hover:text-foreground"
}`}
>
Graph View
2D Graph
</button>
<button
onClick={() => setViewMode("graph3d")}
className={`px-4 py-2 rounded-md text-sm font-medium transition-all ${
viewMode === "graph3d"
? "bg-background text-foreground shadow-sm"
: "text-muted-foreground hover:text-foreground"
}`}
>
3D Graph
</button>
<button
onClick={() => setViewMode("table")}
Expand All @@ -322,19 +333,31 @@ export function DataView({ factType }: DataViewProps) {
</div>
</div>

{viewMode === "graph" && (
{(viewMode === "graph" || viewMode === "graph3d") && (
<div className="flex gap-0">
{/* Graph */}
<div className="flex-1 min-w-0">
<Graph2D
data={graph2DData}
height={700}
showLabels={showLabels}
onNodeClick={handleGraphNodeClick}
maxNodes={maxNodes}
nodeColorFn={nodeColorFn}
linkColorFn={linkColorFn}
/>
{viewMode === "graph" ? (
<Graph2D
data={graph2DData}
height={700}
showLabels={showLabels}
onNodeClick={handleGraphNodeClick}
maxNodes={maxNodes}
nodeColorFn={nodeColorFn}
linkColorFn={linkColorFn}
/>
) : (
<Graph3D
data={graph2DData}
height={700}
showLabels={showLabels}
onNodeClick={handleGraphNodeClick}
maxNodes={maxNodes}
nodeColorFn={nodeColorFn}
linkColorFn={linkColorFn}
/>
)}
</div>

{/* Right Toggle Button */}
Expand Down
Loading