# diegolobao/valvereport-p58 architecture

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

- Interactive diagram: https://gitdiagram.com/diegolobao/valvereport-p58
- Repository: https://github.com/diegolobao/valvereport-p58

## Overview

ValveReport is a browser application for analyzing on/off valve actuations from an uploaded CSV and exporting a report. Users select a valve tag, date range, and status, then search; the app parses event records, evaluates opening/closing cycles against tag limits, and presents results for PDF export. The main workflow is implemented largely in App.tsx, with charting and PDF helpers split into separate modules. The README names public/limites.csv, while the sampled app code fetches limites.json; that data-path discrepancy is unresolved.

Main entry points: [`src/ui/App.tsx`](https://github.com/diegolobao/valvereport-p58/blob/main/src/ui/App.tsx) (Report interface), [`src/main.tsx`](https://github.com/diegolobao/valvereport-p58/blob/main/src/main.tsx) (React entry point), [`public/limites.csv`](https://github.com/diegolobao/valvereport-p58/blob/main/public/limites.csv) (Tag limits), [`src/ui/components/SummaryBar.tsx`](https://github.com/diegolobao/valvereport-p58/blob/main/src/ui/components/SummaryBar.tsx) (Summary chart)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Report workflow"]
  node_app["Report interface<br/>[App.tsx]"]
  node_tagdata["Tag limits<br/>[limites.csv]"]
  node_eventinput["CSV event analysis<br/>[App.tsx]"]
  node_cycleanalysis["Cycle results<br/>[App.tsx]"]
  node_entry["React entry point<br/>[main.tsx]"]
end

subgraph group_visuals["Charts"]
  node_summary["Summary chart<br/>[SummaryBar.tsx]"]
  node_openclose["Timing charts<br/>[OpenCloseBars.tsx]"]
end

subgraph group_export["PDF export"]
  node_svgpng["Chart image conversion<br/>[svgToPng.ts]"]
  node_pdf["PDF generation<br/>[exportPdf.ts]"]
end

node_user(("Report user"))

node_user -->|"selects and searches"| node_app
node_entry -->|"renders"| node_app
node_app -->|"loads tag list"| node_tagdata
node_user -->|"uploads CSV"| node_app
node_app -->|"parses events"| node_eventinput
node_app -->|"builds and filters cycles"| node_cycleanalysis
node_app -->|"renders"| node_summary
node_app -->|"renders"| node_openclose
node_app -->|"converts chart"| node_svgpng
node_app -->|"exports report"| node_pdf

click node_app "https://github.com/diegolobao/valvereport-p58/blob/main/src/ui/App.tsx"
click node_tagdata "https://github.com/diegolobao/valvereport-p58/blob/main/public/limites.csv"
click node_eventinput "https://github.com/diegolobao/valvereport-p58/blob/main/src/ui/App.tsx"
click node_cycleanalysis "https://github.com/diegolobao/valvereport-p58/blob/main/src/ui/App.tsx"
click node_summary "https://github.com/diegolobao/valvereport-p58/blob/main/src/ui/components/SummaryBar.tsx"
click node_openclose "https://github.com/diegolobao/valvereport-p58/blob/main/src/ui/components/OpenCloseBars.tsx"
click node_svgpng "https://github.com/diegolobao/valvereport-p58/blob/main/src/utils/svgToPng.ts"
click node_pdf "https://github.com/diegolobao/valvereport-p58/blob/main/src/utils/exportPdf.ts"
click node_entry "https://github.com/diegolobao/valvereport-p58/blob/main/src/main.tsx"

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_app,node_tagdata,node_eventinput,node_cycleanalysis,node_entry,node_user toneBlue
class node_summary,node_openclose toneAmber
class node_svgpng,node_pdf toneMint
```

## Components

### Report workflow

- [Report interface](https://github.com/diegolobao/valvereport-p58/blob/main/src/ui/App.tsx): `src/ui/App.tsx`
- [Tag limits](https://github.com/diegolobao/valvereport-p58/blob/main/public/limites.csv): `public/limites.csv`
- [CSV event analysis](https://github.com/diegolobao/valvereport-p58/blob/main/src/ui/App.tsx): `src/ui/App.tsx`
- [Cycle results](https://github.com/diegolobao/valvereport-p58/blob/main/src/ui/App.tsx): `src/ui/App.tsx`
- [React entry point](https://github.com/diegolobao/valvereport-p58/blob/main/src/main.tsx): `src/main.tsx`

### Charts

- [Summary chart](https://github.com/diegolobao/valvereport-p58/blob/main/src/ui/components/SummaryBar.tsx): `src/ui/components/SummaryBar.tsx`
- [Timing charts](https://github.com/diegolobao/valvereport-p58/blob/main/src/ui/components/OpenCloseBars.tsx): `src/ui/components/OpenCloseBars.tsx`

### PDF export

- [Chart image conversion](https://github.com/diegolobao/valvereport-p58/blob/main/src/utils/svgToPng.ts): `src/utils/svgToPng.ts`
- [PDF generation](https://github.com/diegolobao/valvereport-p58/blob/main/src/utils/exportPdf.ts): `src/utils/exportPdf.ts`

### Other components

- **Report user**

## Connections

- Report user → Report interface: selects and searches (evidence: `README.md`)
- React entry point → Report interface: renders (evidence: `src/main.tsx`)
- Report interface → Tag limits: loads tag list (evidence: `src/ui/App.tsx`)
- Report user → Report interface: uploads CSV (evidence: `README.md`)
- Report interface → CSV event analysis: parses events (evidence: `src/ui/App.tsx`)
- Report interface → Cycle results: builds and filters cycles (evidence: `src/ui/App.tsx`)
- Report interface → Summary chart: renders (evidence: `src/ui/App.tsx`)
- Report interface → Timing charts: renders (evidence: `src/ui/App.tsx`)
- Report interface → Chart image conversion: converts chart (evidence: `src/ui/App.tsx`)
- Report interface → PDF generation: exports report (evidence: `src/ui/App.tsx`)
