ECG Axis Lab is an interactive playground for understanding frontal ECG geometry. It is built for teaching, visual intuition, and experimentation with lead projections.
This project is educational and non-diagnostic.
This repository is highly experimental.
- APIs, behaviors, and UI may change without backward compatibility.
- Some workflows are intentionally prototype-grade.
- Long-term maintenance is not guaranteed, and updates will likely be infrequent.
- See how lead projections change as the frontal vector changes
- Compare waveform behavior with geometric interpretation in real time
- Explore Einthoven triangle and augmented leads without clinical complexity
- Use a monitor-style teaching mode with play, pause, and timeline scrub
- Upload CSV/JSON ECG data
- Run built-in demos (single lead, Einthoven, frontal six, full twelve)
- Reconstruct frontal vector angle and magnitude
- Visualize the frontal plane with AQRS direction and trajectory
- Teach with a fixed-reference ECG monitor view
Teaching mode is designed like a monitor:
- Fixed time axis and fixed reference grid
- Signal evolves over time
- Fixed NOW marker (playhead)
- Play/Pause control
- Manual timeline slider for scrubbing through the signal
This makes the waveform timing consistent with the animated heart activity panel.
- Python 3.11+
- Miniconda
- Node.js 18+
- npm
cd apps/api
conda env create -f environment.yml
conda activate ecg-axis-lab
pytest tests/
uvicorn app.main:app --reload --port 8000Backend is available at:
cd apps/web
npm install
npm run devFrontend is available at:
Core endpoints:
POST /api/reconstruct/frontalPOST /api/reconstruct/summaryPOST /api/simulateGET /api/demosGET /api/demos/{demo_id}
Utility endpoints:
GET /healthPOST /api/parse/csv-waveformPOST /api/parse/json-waveform
ecg-axis-lab/
├─ apps/
│ ├─ api/
│ └─ web/
├─ data/
├─ docs/
├─ notebooks/
└─ README.md
Backend:
- FastAPI
- NumPy / SciPy
- Pandas
- Pydantic
- pytest
Frontend:
- React + TypeScript
- Vite
- Tailwind CSS
- Plotly.js
- Zustand
Included:
- Geometric interpretation and educational simulation
- Multi-lead waveform visualization
- Frontal vector estimation
Not included:
- Automated diagnosis
- Rhythm/pathology classification
- Clinical decision support
Contributions are welcome.
Before opening a large PR, please open an issue first to discuss scope because this repository may receive limited maintenance updates.
Typical areas for contribution:
- Better educational presets
- Additional visualization modes
- UI/UX refinements for teaching workflows
- Improved docs and examples
See LICENSE for details.

