Skip to content

Commit ca0263b

Browse files
maccursoragent
andcommitted
docs: add screenshots of the Streamlit interface to all READMEs
- New scripts/capture_screenshots.py automates the workflow with Playwright + Chromium, navigating each multi-page route and writing optimised PNGs to app/assets/screenshots/. - Root README.md gains a hero image and a 2x2 gallery of the four functional pages with concise captions. - app/README.md gets a full visual walkthrough, one screenshot per page (Home / Cohort Builder / Diet Simulator / RCT Engine / Case Studies / About). - Each non-English README (TR / ES / FR / DE / PT / IT / ZH / JA) now embeds the hero image right under the language switcher. Bug fixes uncovered while capturing: - components.py now exposes a public render_html() helper that dedents + strips multi-line HTML before passing to st.markdown, avoiding Streamlit's Markdown engine treating 4-space indentation as a fenced code block (fixes broken feature_grid / diet_card / patient_card rendering). - Pages 2 (Diet Simulator) and 4 (Case Studies) updated to use render_html() for their inline custom cards. - Page 3 (RCT Engine): * adherence_summary is a dict on TrialResult, not a method — removed stray () call. * Replaced paper-coordinate add_annotation arrows in the CONSORT flow diagram with shape-based lines + scatter triangle markers (Plotly 6.x deprecated axref="paper" / ayref="paper"). * Fixed the "completed" count to use dropout_week.isna() | dropout_week > duration_weeks, since the engine writes duration_weeks + 1 for completers. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent bdb74c1 commit ca0263b

22 files changed

Lines changed: 454 additions & 151 deletions

README.de.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ stresstesten möchten, bevor sie in die Klinik gelangen.
2222
> Patientenversorgung wenden Sie sich stets an eine\*n qualifizierte\*n
2323
> registrierte\*n Diätassistent\*in.
2424
25+
![synthdiet hero](app/assets/screenshots/00_hero.png)
26+
2527
---
2628

2729
## Autor

README.es.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ clínica.
2121
> pacientes sintéticos **no son personas reales**. Para la atención al
2222
> paciente consulte siempre a un dietista-nutricionista cualificado.
2323
24+
![synthdiet hero](app/assets/screenshots/00_hero.png)
25+
2426
---
2527

2628
## Autor

README.fr.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ synthétiques avant de les amener en clinique.
2222
> pas de vraies personnes**. Pour la prise en charge des patients,
2323
> référez-vous toujours à un diététicien-nutritionniste qualifié.
2424
25+
![synthdiet hero](app/assets/screenshots/00_hero.png)
26+
2527
---
2628

2729
## Auteur

README.it.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ migliaia di pazienti sintetici prima di portarle in clinica.
1919
> sintetici **non sono persone reali**. Per la cura del paziente
2020
> consultare sempre un dietista qualificato.
2121
22+
![synthdiet hero](app/assets/screenshots/00_hero.png)
23+
2224
---
2325

2426
## Autore

README.ja.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
> **臨床推奨ではなく**、合成患者は**実在の人物ではありません**
1919
> 患者ケアには必ず資格を持つ管理栄養士・登録栄養士に相談してください。
2020
21+
![synthdiet hero](app/assets/screenshots/00_hero.png)
22+
2123
---
2224

2325
## 著者

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
A Python library for generating synthetic patients with realistic clinical
1111
conditions and simulating dietary interventions on them.
1212

13+
![synthdiet hero](app/assets/screenshots/00_hero.png)
14+
1315
`synthdiet` is built for dietitians, clinical-nutrition researchers, and
1416
educators who want to prototype diets, run virtual trials, and stress-test
1517
nutritional recommendations against hundreds or thousands of synthetic
@@ -101,10 +103,15 @@ pip install "synthdiet[app]"
101103
streamlit run app/streamlit_app.py
102104
```
103105

104-
A multi-page Streamlit interface (Home / Cohort Builder / Diet Simulator
105-
/ RCT Engine / Case Studies) with animated Plotly charts, CONSORT flow
106-
and OSCE grading. See [`app/README.md`](app/README.md) for details and
107-
Streamlit Community Cloud deployment instructions.
106+
A multi-page Streamlit interface with animated Plotly charts, a custom
107+
CONSORT flow diagram and OSCE-style grading. See
108+
[`app/README.md`](app/README.md) for full details and Streamlit Community
109+
Cloud deployment instructions.
110+
111+
| | |
112+
|---|---|
113+
| <a href="app/assets/screenshots/02_cohort_builder.png"><img src="app/assets/screenshots/02_cohort_builder.png" alt="Cohort Builder" width="100%"></a><br/>**📋 Cohort Builder** — interactive prevalence sliders → live age × sex × BMI × diagnosis distributions, CSV export. | <a href="app/assets/screenshots/03_diet_simulator.png"><img src="app/assets/screenshots/03_diet_simulator.png" alt="Diet Simulator" width="100%"></a><br/>**🍽️ Diet Simulator** — pick any of 8 preset diets and watch HbA1c, BP, LDL and weight trajectories animate week by week. |
114+
| <a href="app/assets/screenshots/04_rct_engine.png"><img src="app/assets/screenshots/04_rct_engine.png" alt="RCT Engine" width="100%"></a><br/>**🧪 RCT Engine** — parallel-arm trials with Weibull dropout, custom CONSORT flow diagram, forest plot and ITT/PP/AT analyses. | <a href="app/assets/screenshots/05_case_studies.png"><img src="app/assets/screenshots/05_case_studies.png" alt="Case Studies" width="100%"></a><br/>**📚 Case Studies** — 15 built-in clinical scenarios with OSCE-style automatic grading of student diet plans. |
108115

109116
`synthdiet` requires Python 3.9+ and depends on `numpy`, `pandas`, and `scipy`.
110117

README.pt.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ milhares de pacientes sintéticos antes de levá-las à prática clínica.
2020
> sintéticos **não são pessoas reais**. Para o cuidado de pacientes
2121
> reais, consulte sempre um(a) nutricionista qualificado(a).
2222
23+
![synthdiet hero](app/assets/screenshots/00_hero.png)
24+
2325
---
2426

2527
## Autor

README.tr.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
> Diğer diller: [English](README.md) · [Español](README.es.md) · [Français](README.fr.md) · [Deutsch](README.de.md) · [Português](README.pt.md) · [Italiano](README.it.md) · [中文](README.zh.md) · [日本語](README.ja.md)
99
10+
![synthdiet hero](app/assets/screenshots/00_hero.png)
11+
1012
Gerçekçi klinik tablolara sahip **sentetik hastalar** üreten ve bu hastalar
1113
üzerinde **diyet müdahalelerini simüle eden** bir Python kütüphanesi.
1214

README.zh.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
> **不是临床建议**,合成患者**也不是真实人物**。患者诊疗请始终
1818
> 咨询合格的注册营养师/临床营养师。
1919
20+
![synthdiet hero](app/assets/screenshots/00_hero.png)
21+
2022
---
2123

2224
## 作者

app/README.md

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,58 @@
33
An interactive multi-page web interface for the
44
[`synthdiet`](https://github.com/bugraayancom/synthdiet) Python library.
55

6-
It exposes the full workflow visually:
7-
8-
| Page | What it does |
9-
|------|--------------|
10-
| 🩺 Home | Project overview, hero, feature grid, quick links. |
11-
| 📋 Cohort Builder | Interactive prevalence sliders → live age × sex × BMI × diagnosis distributions, CSV export. |
12-
| 🍽️ Diet Simulator | Apply any of 8 preset diets to a single patient and watch HbA1c, BP, LDL and weight trajectories animate week-by-week. |
13-
| 🧪 RCT Engine | Set up a parallel-arm trial, run with Weibull dropout + adherence, view CONSORT flow, forest plot, ITT / per-protocol / as-treated. |
14-
| 📚 Case Studies | Browse the 15 built-in clinical cases, filter by difficulty / tag, and grade student diet plans with the OSCE rubric. |
15-
| ℹ️ About | Author, citation, license, deployment instructions. |
6+
![synthdiet — hero](assets/screenshots/00_hero.png)
167

178
The visual style is "clinical clean": white background, medical
189
blue / green accents, glassmorphism cards, smooth fade-up animations
1910
and animated Plotly charts.
2011

12+
## Pages
13+
14+
### 🩺 Home
15+
16+
Project overview, hero, feature grid, quick links.
17+
18+
![Home](assets/screenshots/01_home.png)
19+
20+
### 📋 Cohort Builder
21+
22+
Interactive prevalence sliders → live age × sex × BMI × diagnosis
23+
distributions, CSV export. The cohort persists in
24+
``st.session_state`` and is reused by every downstream page.
25+
26+
![Cohort Builder](assets/screenshots/02_cohort_builder.png)
27+
28+
### 🍽️ Diet Simulator
29+
30+
Apply any of 8 preset diets to a single patient and watch HbA1c,
31+
blood pressure, LDL and weight trajectories animate week by week
32+
(Plotly frame animation with Play / Pause).
33+
34+
![Diet Simulator](assets/screenshots/03_diet_simulator.png)
35+
36+
### 🧪 RCT Engine
37+
38+
Set up a parallel-arm trial with Weibull dropout, configurable
39+
adherence and randomisation strategy, then read the trial through
40+
ITT / per-protocol / as-treated lenses with a custom CONSORT flow
41+
diagram and forest plot.
42+
43+
![RCT Engine](assets/screenshots/04_rct_engine.png)
44+
45+
### 📚 Case Studies
46+
47+
Browse the 15 built-in clinical cases, filter by difficulty or tag,
48+
and grade student diet plans with the OSCE rubric.
49+
50+
![Case Studies](assets/screenshots/05_case_studies.png)
51+
52+
### ℹ️ About
53+
54+
Author, citation, license, deployment instructions.
55+
56+
![About](assets/screenshots/06_about.png)
57+
2158
---
2259

2360
## Run locally

0 commit comments

Comments
 (0)