# avans-atls/tapescope architecture

> Architecture diagram of the GitHub repository avans-atls/tapescope, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/avans-atls/tapescope
- Repository: https://github.com/avans-atls/tapescope

## Overview

TapeScope is a Dash dashboard for turning TapeStation-like CSV signal matrices into interactive visualizations. The principal workflow is: launch the dashboard, load a startup CSV or upload one in the UI, convert it to a numeric matrix, then view overlaid traces and a gel-like heatmap. Sample selection controls trace visibility; row order and gel contrast/color controls affect the heatmap. The app callbacks connect these stages. Source excerpts show the runtime calls; the README documents the user-facing capabilities.

Main entry points: [`src/tapescope/app.py`](https://github.com/avans-atls/tapescope/blob/main/src/tapescope/app.py) (Dash app), [`src/tapescope/data.py`](https://github.com/avans-atls/tapescope/blob/main/src/tapescope/data.py) (CSV loading), [`src/tapescope/cli.py`](https://github.com/avans-atls/tapescope/blob/main/src/tapescope/cli.py) (CLI launcher), [`src/tapescope/plots.py`](https://github.com/avans-atls/tapescope/blob/main/src/tapescope/plots.py) (Trace plot)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Dashboard entry"]
  node_cli["CLI launcher<br/>[cli.py]"]
  node_dashboard["Dash app<br/>[app.py]"]
end

subgraph group_data["Signal data"]
  node_csv_loading["CSV loading<br/>[data.py]"]
  node_matrix["Numeric matrix<br/>[data.py]"]
  node_client_state["Dataset and lane state<br/>[data.py]"]
end

subgraph group_viz["Visualization"]
  node_trace["Trace plot<br/>[plots.py]"]
  node_gel["Gel heatmap<br/>[plots.py]"]
end

node_user(("Dashboard user"))
node_csv["CSV input"]

node_user -->|"launches"| node_cli
node_cli -->|"creates app"| node_dashboard
node_user -->|"uploads and adjusts"| node_dashboard
node_csv -->|"provides input"| node_csv_loading
node_dashboard -->|"loads CSV"| node_csv_loading
node_csv_loading -->|"normalizes values"| node_matrix
node_dashboard -->|"serializes and orders"| node_client_state
node_dashboard -->|"loads uploads"| node_csv_loading
node_dashboard -->|"builds traces"| node_trace
node_dashboard -->|"builds heatmap"| node_gel
node_dashboard -->|"restores frame"| node_matrix

click node_cli "https://github.com/avans-atls/tapescope/blob/main/src/tapescope/cli.py"
click node_dashboard "https://github.com/avans-atls/tapescope/blob/main/src/tapescope/app.py"
click node_csv_loading "https://github.com/avans-atls/tapescope/blob/main/src/tapescope/data.py"
click node_matrix "https://github.com/avans-atls/tapescope/blob/main/src/tapescope/data.py"
click node_client_state "https://github.com/avans-atls/tapescope/blob/main/src/tapescope/data.py"
click node_trace "https://github.com/avans-atls/tapescope/blob/main/src/tapescope/plots.py"
click node_gel "https://github.com/avans-atls/tapescope/blob/main/src/tapescope/plots.py"

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_cli,node_dashboard,node_user toneBlue
class node_csv_loading,node_matrix,node_client_state toneAmber
class node_trace,node_gel toneMint
class node_csv toneIndigo
```

## Components

### Dashboard entry

- [CLI launcher](https://github.com/avans-atls/tapescope/blob/main/src/tapescope/cli.py): `src/tapescope/cli.py`
- [Dash app](https://github.com/avans-atls/tapescope/blob/main/src/tapescope/app.py): `src/tapescope/app.py`

### Signal data

- [CSV loading](https://github.com/avans-atls/tapescope/blob/main/src/tapescope/data.py): `src/tapescope/data.py`
- [Numeric matrix](https://github.com/avans-atls/tapescope/blob/main/src/tapescope/data.py): `src/tapescope/data.py`
- [Dataset and lane state](https://github.com/avans-atls/tapescope/blob/main/src/tapescope/data.py): `src/tapescope/data.py`

### Visualization

- [Trace plot](https://github.com/avans-atls/tapescope/blob/main/src/tapescope/plots.py): `src/tapescope/plots.py`
- [Gel heatmap](https://github.com/avans-atls/tapescope/blob/main/src/tapescope/plots.py): `src/tapescope/plots.py`

### Other components

- **Dashboard user**
- **CSV input**

## Connections

- Dashboard user → CLI launcher: launches (evidence: `README.md`)
- CLI launcher → Dash app: creates app (evidence: `src/tapescope/cli.py`)
- Dashboard user → Dash app: uploads and adjusts (evidence: `README.md`)
- CSV input → CSV loading: provides input (evidence: `src/tapescope/data.py`)
- Dash app → CSV loading: loads CSV (evidence: `src/tapescope/app.py`)
- CSV loading → Numeric matrix: normalizes values (evidence: `src/tapescope/data.py`)
- Dash app → Dataset and lane state: serializes and orders (evidence: `src/tapescope/app.py`)
- Dash app → CSV loading: loads uploads (evidence: `src/tapescope/app.py`)
- Dash app → Trace plot: builds traces (evidence: `src/tapescope/app.py`)
- Dash app → Gel heatmap: builds heatmap (evidence: `src/tapescope/app.py`)
- Dash app → Numeric matrix: restores frame (evidence: `src/tapescope/app.py`)
