# tom-halland/vivid_visualization_matrix architecture

> Architecture diagram of the GitHub repository tom-halland/vivid_visualization_matrix, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tom-halland/vivid_visualization_matrix
- Repository: https://github.com/tom-halland/vivid_visualization_matrix

## Overview

#### Purpose and Runtime

This is a Vite-served React frontend that demonstrates observability views for multi-agent LLM and evaluative RAG workflows. It is a standalone visualization application, not an agent runtime: pipeline activity, failures, and routing states are simulated in the UI.

Primary browser entry and React mount:
- `index.html`
- `src/main.jsx`
- `src/App.jsx`

#### Application Composition

`App` is the dashboard shell and composes the two primary visualization widgets. It owns the page-level presentation and is the natural integration point for replacing demo controls/data with live observability events.

- `src/App.jsx`
- `src/App.css`
- `src/index.css`

#### Agentic Pipeline Sankey

`AgenticSankey` renders the pipeline-flow view: a Sankey topology representing prompt progression through router, retrieval, synthesis, evaluation, tool activity, and error/feedback paths. Its interactive controls vary simulated pipeline complexity and error injection, which in turn alter node/link weights and bottleneck visibility.

- `src/components/AgenticSankey.jsx`
- `src/components/visualizations.js`
- `src/styles/visualizations.css`

The key data boundary is from local UI state and generated graph data into D3/D3-Sankey layout/rendering. A production adapter would transform tracing spans, agent events, token/context metrics, and error events into the component’s node/link model.

#### Evaluative RAG State Machine

`RAGStateMachine` presents conditional RAG-loop control flow. User-selected query states activate paths for successful retrieval, irrelevant-context rewriting and retrieval retry, or hallucination recovery from generation back to rewriting.

- `src/components/RAGStateMachine.jsx`
- `src/components/visualizations.js`
- `src/styles/visualizations.css`

The component’s boundary is semantic routing state to graph highlighting/rendering. It models decisions made by retriever, grader/evaluator, generator, and query-rewriter stages rather than invoking those services.

#### Visualization and Interaction Flow

At runtime, the browser mounts React through `src/main.jsx`, renders the application shell in `src/App.jsx`, and loads widget-specific visualization logic. Each widget maintains local interaction state, derives the active graph representation, then delegates layout/drawing to its visualization engine.

The shared export surface is:
- `src/components/visualizations.js`
- `src/components/AgenticSankey.jsx`
- `src/components/RAGStateMachine.jsx`

This enables the widgets to be embedded independently in another React dashboard.

#### Rendering Dependencies and Infrastructure

The frontend uses React with Vite for development/build delivery, with D3 and D3-Sankey for flow visualization and Mermaid for directed graph/state-machine rendering, as declared by the project package manifest.

- `package.json`
- `vite.config.js`
- `package-lock.json`

There is no backend, persistence layer, authentication system, or live external observability/LLM API represented in the repository. CI includes GitHub Actions automation, but it is outside the browser architecture:
- `.github/workflows/repoowl-analyze.yml`

Main entry points: [`src/App.jsx`](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/App.jsx) (Dashboard shell), [`src/components/AgenticSankey.jsx`](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/components/AgenticSankey.jsx) (Agentic Sankey), [`src/components/RAGStateMachine.jsx`](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/components/RAGStateMachine.jsx) (RAG state machine), [`src/main.jsx`](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/main.jsx) (React mount)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Browser Runtime"]
  node_vite{{"Vite delivery<br/>build server<br/>[vite.config.js]"}}
  node_html["HTML entry<br/>browser entry<br/>[index.html]"]
  node_main["React mount<br/>React entry<br/>[main.jsx]"]
  node_app["Dashboard shell<br/>React component<br/>[App.jsx]"]
  node_app_styles["Shell styles<br/>CSS<br/>[App.css]"]
  node_global_styles["Global styles<br/>CSS<br/>[index.css]"]
end

subgraph group_widgets["Observability Widgets"]
  node_sankey["Agentic Sankey<br/>React widget<br/>[AgenticSankey.jsx]"]
  node_rag["RAG state machine<br/>React widget"]
  node_visualizations["Widget export surface<br/>component module<br/>[visualizations.js]"]
  node_sankey_data(("Local pipeline graph<br/>derived UI data<br/>[AgenticSankey.jsx]"))
  node_rag_state(("Semantic routing state<br/>derived UI state"))
end

subgraph group_rendering["Rendering Engines"]
  node_d3{{"D3 and D3-Sankey<br/>flow renderer<br/>[package.json]"}}
  node_mermaid{{"Mermaid<br/>graph renderer<br/>[package.json]"}}
  node_widget_styles["Visualization styles<br/>CSS<br/>[visualizations.css]"]
end

node_vite -->|"serves"| node_html
node_html -->|"loads"| node_main
node_main -->|"mounts"| node_app
node_app -->|"composes"| node_sankey
node_app -->|"composes"| node_rag
node_app -.->|"uses"| node_app_styles
node_main -.->|"uses"| node_global_styles
node_sankey -->|"derives"| node_sankey_data
node_sankey_data -->|"node/link model"| node_d3
node_rag -->|"derives"| node_rag_state
node_rag_state -->|"active paths"| node_mermaid
node_sankey -.->|"exports through"| node_visualizations
node_rag -.->|"exports through"| node_visualizations
node_sankey -.->|"uses"| node_widget_styles
node_rag -.->|"uses"| node_widget_styles

click node_vite "https://github.com/tom-halland/vivid_visualization_matrix/blob/main/vite.config.js"
click node_html "https://github.com/tom-halland/vivid_visualization_matrix/blob/main/index.html"
click node_main "https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/main.jsx"
click node_app "https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/App.jsx"
click node_app_styles "https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/App.css"
click node_global_styles "https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/index.css"
click node_sankey "https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/components/AgenticSankey.jsx"
click node_rag "https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/components/RAGStateMachine.jsx"
click node_visualizations "https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/components/visualizations.js"
click node_sankey_data "https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/components/AgenticSankey.jsx"
click node_rag_state "https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/components/RAGStateMachine.jsx"
click node_d3 "https://github.com/tom-halland/vivid_visualization_matrix/blob/main/package.json"
click node_mermaid "https://github.com/tom-halland/vivid_visualization_matrix/blob/main/package.json"
click node_widget_styles "https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/styles/visualizations.css"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_vite,node_html,node_main,node_app,node_app_styles,node_global_styles toneBlue
class node_sankey,node_rag,node_visualizations,node_sankey_data,node_rag_state toneAmber
class node_d3,node_mermaid,node_widget_styles toneMint
```

## Components

### Browser Runtime

- [Vite delivery](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/vite.config.js): build server · Serves and builds the standalone frontend. · `vite.config.js`
- [HTML entry](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/index.html): browser entry · `index.html`
- [React mount](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/main.jsx): React entry · `src/main.jsx`
- [Dashboard shell](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/App.jsx): React component · Page-level integration point for both demo views. · `src/App.jsx`
- [Shell styles](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/App.css): CSS · `src/App.css`
- [Global styles](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/index.css): CSS · `src/index.css`

### Observability Widgets

- [Agentic Sankey](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/components/AgenticSankey.jsx): React widget · Simulates agent pipeline flow, complexity, and injected errors. · `src/components/AgenticSankey.jsx`
- [RAG state machine](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/components/RAGStateMachine.jsx): React widget · Simulates conditional retrieval, rewrite, and hallucination recovery paths. · `src/components/RAGStateMachine.jsx`
- [Widget export surface](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/components/visualizations.js): component module · Shared embedding surface for both visualization widgets. · `src/components/visualizations.js`
- [Local pipeline graph](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/components/AgenticSankey.jsx): derived UI data · Local interaction state derives node/link weights and active flow. · `src/components/AgenticSankey.jsx`
- [Semantic routing state](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/components/RAGStateMachine.jsx): derived UI state · Selected query outcome determines highlighted RAG paths. · `src/components/RAGStateMachine.jsx`

### Rendering Engines

- [D3 and D3-Sankey](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/package.json): flow renderer · Computes layout and draws the Sankey topology. · `package.json`
- [Mermaid](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/package.json): graph renderer · Renders the directed RAG state graph. · `package.json`
- [Visualization styles](https://github.com/tom-halland/vivid_visualization_matrix/blob/main/src/styles/visualizations.css): CSS · `src/styles/visualizations.css`

## Connections

- Vite delivery → HTML entry: serves
- HTML entry → React mount: loads
- React mount → Dashboard shell: mounts
- Dashboard shell → Agentic Sankey: composes
- Dashboard shell → RAG state machine: composes
- Dashboard shell → Shell styles: uses
- React mount → Global styles: uses
- Agentic Sankey → Local pipeline graph: derives
- Local pipeline graph → D3 and D3-Sankey: node/link model
- RAG state machine → Semantic routing state: derives
- Semantic routing state → Mermaid: active paths
- Agentic Sankey → Widget export surface: exports through
- RAG state machine → Widget export surface: exports through
- Agentic Sankey → Visualization styles: uses
- RAG state machine → Visualization styles: uses
