Skip to content

Add interactive download statistics dashboard with GitHub Pages deployment#15

Merged
hechth merged 4 commits into
mainfrom
copilot/visualization-of-download-stats
Mar 25, 2026
Merged

Add interactive download statistics dashboard with GitHub Pages deployment#15
hechth merged 4 commits into
mainfrom
copilot/visualization-of-download-stats

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 25, 2026

The repo collects download stats across PyPI, Bioconda, CRAN, and GitHub but had no way to visualise them. This adds a self-contained interactive HTML dashboard that can be hosted on GitHub Pages or generated locally for inspection.

New module: src/dashboard.py

  • Reads all TSV reports from reports/YYYY/ across all year subdirectories
  • Merges data across years, deduplicating overlapping periods by taking the max value
  • Generates a Bootstrap + Altair (Vega-Lite) HTML file with summary cards and per-source tabs (PyPI, Bioconda, CRAN, GitHub Clones, GitHub Views)
  • Charts are built with Altair's declarative Python API and rendered client-side via vegaEmbed — no server required

New CLI command

# Generate locally (default output: docs/index.html)
./specdatri generate-dashboard

# Custom paths
./specdatri generate-dashboard --reports-dir reports --output /tmp/dashboard.html

CI/CD

  • actions.yml: adds a generate-dashboard step after generate-reports, so the page rebuilds every Monday
  • pages.yml: new workflow that deploys docs/ to GitHub Pages whenever it changes on main — enable via Settings → Pages → Source: GitHub Actions

Notes

  • Bootstrap 5.3.3 loaded with official SRI hashes
  • Vega/Vega-Lite/Vega-Embed loaded from jsDelivr CDN (pinned versions)
  • altair==6.0.0 added to requirements/base.txt
  • docs/index.html is the initial generated dashboard committed to the repo
Original prompt

This section details on the original issue you should resolve

<issue_title>Visualization of download stats</issue_title>
<issue_description>Implement a small interactive dashboard that can be hosted on a github page for the repository which displays graphs for the download statistics in the main reporting foloders. For testing, it should also be possible to create the html locally so that it can be inspected.</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] Add interactive dashboard for download statistics Add interactive download statistics dashboard with GitHub Pages deployment Mar 25, 2026
Copilot AI requested a review from hechth March 25, 2026 17:37
@hechth
Copy link
Copy Markdown
Member

hechth commented Mar 25, 2026

@copilot would it make sense to use some software framework to build the dashboard, rather than using pure plotly?

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 25, 2026

@copilot would it make sense to use some software framework to build the dashboard, rather than using pure plotly?

Yes — I switched from manually-crafted Plotly JSON to Altair (commit f1655fd), a declarative Python visualization framework built on the Vega-Lite grammar.

Key reasons Altair fits well here:

  • Static HTML output — it generates Vega-Lite JSON specs that are rendered client-side via vegaEmbed, which is exactly what GitHub Pages needs (no server required)
  • Declarative API — chart definitions are concise alt.Chart(df).mark_line().encode(...) expressions rather than manually constructed JSON dicts
  • Native pandas integration — accepts DataFrames directly, so the data pipeline stays unchanged

Server-based frameworks (Dash, Streamlit, Panel in server mode) were ruled out because GitHub Pages only serves static files.

@hechth hechth marked this pull request as ready for review March 25, 2026 19:46
@hechth hechth merged commit 173b292 into main Mar 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Visualization of download stats

2 participants