You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
uv run kaleido_get_chrome # Chrome for plotly PNG export
60
+
./setup_r.sh # R packages (ggplot2, mgcv)
66
61
```
67
62
68
63
### Build Site
69
64
70
65
```bash
71
-
make qrender # Quick render from Examples.ipynb without executing
72
-
make render # Full build: execute notebook, then render (creates timestamped .ipynb)
73
-
make # Full build + S3 upload
66
+
make qrender # Render from an already-executed Examples.ipynb (fails if outputs are stripped)
67
+
make render # Full build: execute notebook, then render (creates git-hash-stamped .ipynb)
74
68
```
75
69
76
70
The render process:
@@ -83,10 +77,9 @@ The render process:
83
77
84
78
```bash
85
79
make test# Run pytest tests
86
-
python -m pytest tests/
87
80
```
88
81
89
-
The test suite (tests/test_plots.py) validates that Examples.ipynb contains all expected plot/package combinations defined in the defined_plots dictionary.
82
+
The test suite (tests/test_plots.py) validates that Examples.ipynb contains all expected plot/package tag combinations. It reads tags only, so it works on the outputs-stripped notebook.
90
83
91
84
### Local Development
92
85
@@ -98,12 +91,10 @@ cd web && python -m http.server
98
91
99
92
### Image Rendering
100
93
101
-
All plots are rendered to static PNG images:
102
-
-**Plotly**: Uses Kaleido for local rendering (no authentication required with v5+)
103
-
-**Altair**: Uses native rendering or selenium/geckodriver
104
-
-**R/ggplot2**: Uses rpy2 to interface with system R installation
105
-
106
-
**Note**: Plotly authentication is no longer needed with plotly v5+. The old authentication code in `.travis/authenticate_plotly.py` is deprecated.
94
+
All plots are rendered to static PNG images inside the executed notebook:
95
+
-**Plotly**: `pio.renderers.default = "png"` with Kaleido (needs Chrome; `uv run kaleido_get_chrome`)
96
+
-**Altair**: `alt.renderers.enable("png")` with vl-convert-python (set in the notebook's first cell — do not remove)
97
+
-**R/ggplot2**: rpy2 against the system R installation (`%%R` cell magic)
107
98
108
99
## Adding New Plots
109
100
@@ -113,74 +104,30 @@ All plots are rendered to static PNG images:
113
104
4. Keep code lines under ~46 characters to avoid horizontal scrolling in the UI
114
105
5. Optionally add a markdown comment in triple quotes on the first line
115
106
6. Update tests/test_plots.py to include the new plot in defined_plots
116
-
7. Run `make qrender` to test (or `make render`for full rebuild)
107
+
7. Run `make render`and inspect web/index.html
117
108
118
109
## Technical Constraints
119
110
120
111
- Plot code must generate PNG output in the notebook cell
121
-
- For plotly, images must be generated via their server (requires credentials)
122
112
- R code cells must start with `%%R` magic command
123
-
- Altair cells must start with `%%altair` magic command
124
113
- Code lines should wrap to ~46 characters for proper display
125
114
- All image paths are MD5 hashes of the base64-encoded PNG data
126
115
127
116
## Dependencies
128
117
129
-
### Python Environment
130
-
-**Python**: 3.11+ (specified in runtime.txt and pyproject.toml)
131
-
-**Package Manager**: uv (modern, fast alternative to pip)
132
-
-**Jupyter**: For notebook execution
133
-
134
-
### Plotting Libraries (all latest versions)
135
-
- pandas 2.0+
136
-
- matplotlib 3.7+
137
-
- seaborn 0.13+
138
-
- plotnine 0.13+
139
-
- plotly 5.24+ (with Kaleido for image export)
140
-
- altair 5.0+
141
-
- statsmodels 0.14+
142
-
143
-
### R Environment
144
-
-**R**: 4.0+ (system installation required)
145
-
-**R Packages**: ggplot2, mgcv
146
-
-**Python-R Bridge**: rpy2 3.5+
147
-
148
-
### Other Key Dependencies
149
-
- Jinja2 with jinja2-highlight for templating
150
-
- selenium 4.15+ with geckodriver for browser automation
151
-
- markdown for text processing
152
-
153
-
**Configuration Files:**
154
-
-`pyproject.toml`: Modern Python project metadata and dependencies
155
-
-`requirements.txt`: Pin-free dependency list
156
-
-`setup_r.sh`: R package installation script
118
+
Python dependencies are declared in `pyproject.toml` and locked in `uv.lock` (committed). Key libraries: pandas, matplotlib, seaborn, plotnine, plotly (+kaleido), altair (+vl-convert-python), statsmodels, rpy2, Jinja2 with jinja2-highlight.
119
+
120
+
R (system install) with ggplot2 and mgcv, installed by `setup_r.sh`.
157
121
158
122
## CI/CD
159
123
160
-
The project uses **GitHub Actions** for continuous integration and deployment (migrated from Travis CI).
0 commit comments