From c3ca34c7e9a8dac64a608c0daaabc2995e9196f1 Mon Sep 17 00:00:00 2001 From: perpil <97474956+perpil@users.noreply.github.com> Date: Fri, 29 May 2026 10:47:29 -0700 Subject: [PATCH 1/2] Add historical graph generation workflow + Add a GitHub Actions workflow to generate and commit SVG performance graphs when data changes. + Introduce graph-generator/app.py to parse data JSONs, produce 2y and 180d SVG charts and commit them to /graphs. + Inject a small clickable graph thumbnail into index.html, add CSS for graph container and thumbnail styling, and update script.js to set thumbnail and large-graph URLs (handles GitHub Pages vs local). + Uses pandas/matplotlib to generate graphs + Gemini CLI w/model 3.0 Flash was used to create this commit --- .github/workflows/generate-graphs.yml | 46 +++++ docs/css/custom.css | 14 +- docs/index.html | 7 +- docs/script.js | 21 +++ graph-generator/app.py | 256 ++++++++++++++++++++++++++ 5 files changed, 341 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/generate-graphs.yml create mode 100644 graph-generator/app.py diff --git a/.github/workflows/generate-graphs.yml b/.github/workflows/generate-graphs.yml new file mode 100644 index 0000000000..a8c0534e09 --- /dev/null +++ b/.github/workflows/generate-graphs.yml @@ -0,0 +1,46 @@ +name: Generate Graphs + +on: + push: + branches: + - main + paths: + - "data/last.json" + workflow_dispatch: + +permissions: + contents: write + +jobs: + generate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + cache: "pip" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pandas matplotlib + + - name: Generate graphs + run: python graph-generator/app.py + + - name: Commit and push graphs + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add graphs/*.svg + if git diff --staged --quiet; then + echo "No changes to graphs" + else + git commit -m "docs: update performance graphs" + git push + fi diff --git a/docs/css/custom.css b/docs/css/custom.css index 80ddbdcd69..7665777a25 100644 --- a/docs/css/custom.css +++ b/docs/css/custom.css @@ -3,7 +3,7 @@ html { min-height: 100%; } body { - margin-bottom: 120px; + margin-bottom: 120px; } hr { margin-bottom: 2px; @@ -13,7 +13,7 @@ hr { position: absolute; bottom: 0; width: 100%; - height: 100px; + height: 100px; line-height: 60px; background-color: #f5f5f5; text-align: center; @@ -66,6 +66,16 @@ hr { text-align: right; font-size: 9px; } +.graph-container { + cursor: pointer; + transition: transform 0.2s; +} +.graph-container:hover { + transform: scale(1.02); +} +.smallGraph { + border-radius: 4px; +} .badge:empty { display: inline-block; } diff --git a/docs/index.html b/docs/index.html index 943acc811a..2feba0d412 100644 --- a/docs/index.html +++ b/docs/index.html @@ -74,6 +74,11 @@