Skip to content

feat: add static analytics site generator for all data-browser apps#4789

Merged
NoopDog merged 9 commits intomainfrom
mim/4779-analytics-static-site
May 5, 2026
Merged

feat: add static analytics site generator for all data-browser apps#4789
NoopDog merged 9 commits intomainfrom
mim/4779-analytics-static-site

Conversation

@MillenniumFalconMechanic
Copy link
Copy Markdown
Contributor

Ticket

Closes #4779

Summary

  • Add a shared static_site subpackage (analytics/analytics_package/analytics/static_site/) that generates static HTML analytics dashboards from GA4 data
  • Each app (AnVIL Explorer, AnVIL Catalog, HCA Data Explorer, LungMAP) has a generate_static_site.py script with app-specific config (branding, custom events, entity resolution)
  • Dashboard includes: traffic charts, session/engagement stats, export request metrics (Terra, curl, file manifest), detail tables with entity title resolution, access request tracking (AnVIL), and general usage tables (pages, outbound links, filter selections)
  • Config-driven HTML template using findable-ui design system CSS and Chart.js

Test plan

  • Run generate_static_site.py for each app and verify the output site renders correctly
  • Verify dataset/project titles resolve correctly in detail tables
  • Verify AnVIL access requests section shows DUOS/dbGaP counts
  • Verify LungMAP uses catalog=lm10 for project title resolution
  • Verify apps without event_counts config fall back to all-time totals

🤖 Generated with Claude Code

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a reusable static analytics site generator to the shared analytics Python package and wires it up with per-app scripts so each data-browser app can generate a static HTML GA4 dashboard with minimal configuration.

Changes:

  • Introduce analytics.static_site subpackage to fetch GA4 data, optionally resolve entity titles, and export a static dashboard (HTML template + JSON data).
  • Add per-app generate_static_site.py scripts (AnVIL Explorer/Catalog, HCA Explorer, LungMAP) with branding + custom event configuration.
  • Update .gitignore and report-month constants for March 2026.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
analytics/lungmap-analytics/sheets/generate_static_site.py New LungMAP static site generation script with Azul project title resolution (catalog=lm10) and custom export events.
analytics/lungmap-analytics/sheets/constants.py Updates reporting month/folder constants.
analytics/hca-explorer-sheets/generate_static_site.py New HCA static site generation script with Azul project title resolution and custom export events.
analytics/hca-explorer-sheets/constants.py Updates reporting month/folder constants.
analytics/anvil-explorer-sheets/utils.py Minor cleanup in dataset title map pagination logic.
analytics/anvil-explorer-sheets/generate_static_site.py New AnVIL Explorer static site generation script with dataset title enrichment and access-request tracking.
analytics/anvil-explorer-sheets/constants.py Updates reporting month/folder constants.
analytics/anvil-catalog-sheets/generate_static_site.py New AnVIL Catalog static site generation script (minimal config + filter_selected).
analytics/anvil-catalog-sheets/constants.py Updates reporting month/folder constants.
analytics/analytics_package/setup.py Packages the new analytics.static_site module and HTML template data.
analytics/analytics_package/analytics/static_site/template/index.html New config-driven dashboard template (Chart.js charts + tables).
analytics/analytics_package/analytics/static_site/resolve.py New catalog API resolver utilities (UUID → title, detail-record enrichment).
analytics/analytics_package/analytics/static_site/generator.py New orchestration entry point for generating the site (fetch → resolve → copy template → export).
analytics/analytics_package/analytics/static_site/fetch.py New GA4 fetch layer for traffic/pageviews/outbound/filters/sessions/engagement/custom events/downloads/access requests.
analytics/analytics_package/analytics/static_site/export.py New JSON export layer for the static dashboard data files.
analytics/analytics_package/analytics/static_site/init.py Exposes generate_site and resolver helpers as the public API.
analytics/analytics_package/analytics/static_site/README.md Usage and architecture documentation for the generator.
.gitignore Ignores generated site/ outputs, .credentials/, and egg-info directories.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread analytics/analytics_package/analytics/static_site/resolve.py
Comment thread analytics/analytics_package/analytics/static_site/template/index.html Outdated
Comment thread analytics/analytics_package/analytics/static_site/export.py Outdated
Comment thread analytics/analytics_package/setup.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a shared static-site generator to the analytics Python package to produce app-specific, config-driven HTML analytics dashboards (Chart.js + findable-ui CSS) from GA4 data, with per-app entrypoint scripts for the supported data-browser apps.

Changes:

  • Introduces analytics.static_site (fetch/export/generator + HTML template + title-resolution helpers) and wires it into packaging.
  • Adds per-app generate_static_site.py scripts (AnVIL Explorer, AnVIL Catalog, HCA Explorer, LungMAP) with branding + custom event configuration + entity title resolution.
  • Updates report-month constants and ignores generated site output and credentials in .gitignore.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
analytics/lungmap-analytics/sheets/generate_static_site.py New LungMAP static-site generation script with Azul project title resolution (catalog=lm10).
analytics/lungmap-analytics/sheets/constants.py Updates LungMAP report month/folder constants.
analytics/hca-explorer-sheets/generate_static_site.py New HCA Explorer static-site generation script with Azul project title resolution.
analytics/hca-explorer-sheets/constants.py Updates HCA report month/folder constants.
analytics/anvil-explorer-sheets/utils.py Minor tweak in dataset title map pagination code.
analytics/anvil-explorer-sheets/generate_static_site.py New AnVIL Explorer static-site generation script with dataset title resolution + access request tracking.
analytics/anvil-explorer-sheets/constants.py Updates AnVIL Explorer report month/folder constants.
analytics/anvil-catalog-sheets/generate_static_site.py New AnVIL Catalog static-site generation script.
analytics/anvil-catalog-sheets/constants.py Updates AnVIL Catalog report month/folder constants.
analytics/analytics_package/setup.py Packages analytics.static_site, includes template HTML, adds requests dependency.
analytics/analytics_package/analytics/static_site/template/index.html New config-driven dashboard template (charts, tables, custom event sections).
analytics/analytics_package/analytics/static_site/resolve.py New helpers to resolve UUIDs to titles via catalog APIs and enrich detail records.
analytics/analytics_package/analytics/static_site/generator.py New orchestrator to fetch GA4 data, optionally resolve titles, export JSON, and write site.
analytics/analytics_package/analytics/static_site/fetch.py New GA4 fetching logic for traffic/pageviews/outbound/filters/sessions/events/downloads/access requests.
analytics/analytics_package/analytics/static_site/export.py New JSON export helpers for the template’s site/data/*.json inputs.
analytics/analytics_package/analytics/static_site/init.py Exposes public static-site API (generate_site, title resolution helpers).
analytics/analytics_package/analytics/static_site/README.md Usage and architecture documentation for the generator and per-app scripts.
.gitignore Ignores generated site/ output, egg-info, and .credentials/.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread analytics/analytics_package/analytics/static_site/fetch.py
Comment thread analytics/analytics_package/analytics/static_site/fetch.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a shared static analytics dashboard generator to the analytics Python package and wires it up with per-app entrypoint scripts so each data-browser app can generate a branded, static HTML site from GA4 data.

Changes:

  • Introduces analytics.static_site (fetch/export/generator/title-resolution) plus a Chart.js-based HTML template.
  • Adds per-app generate_static_site.py scripts (AnVIL Catalog/Explorer, HCA Explorer, LungMAP) with branding + event configuration.
  • Updates packaging (setup.py) and repo hygiene (.gitignore) to support distribution and local site output.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
analytics/lungmap-analytics/sheets/generate_static_site.py New LungMAP static-site generator script with Azul project title resolution + custom events.
analytics/lungmap-analytics/sheets/constants.py Updates report month/folder constants.
analytics/hca-explorer-sheets/generate_static_site.py New HCA static-site generator script with Azul project title resolution + custom events.
analytics/hca-explorer-sheets/constants.py Updates report month/folder constants.
analytics/anvil-explorer-sheets/utils.py Minor change in dataset title map fetch loop.
analytics/anvil-explorer-sheets/generate_static_site.py New AnVIL Explorer static-site generator script with dataset title enrichment + access request tracking.
analytics/anvil-explorer-sheets/constants.py Updates report month/folder constants.
analytics/anvil-catalog-sheets/generate_static_site.py New AnVIL Catalog static-site generator script (minimal config + filter_selected).
analytics/anvil-catalog-sheets/constants.py Updates report month/folder constants.
analytics/analytics_package/setup.py Packages analytics.static_site, includes template HTML, adds requests dependency.
analytics/analytics_package/analytics/static_site/template/index.html New static dashboard template (config-driven, loads JSON outputs, renders charts/tables).
analytics/analytics_package/analytics/static_site/resolve.py New helpers to fetch entity title maps and enrich exported detail records.
analytics/analytics_package/analytics/static_site/generator.py New top-level orchestration for fetch → optional title resolution → export → template copy.
analytics/analytics_package/analytics/static_site/fetch.py New GA4 data collection for charts/tables/custom events/file downloads/access requests.
analytics/analytics_package/analytics/static_site/export.py New JSON export for all dashboard inputs + meta/config.
analytics/analytics_package/analytics/static_site/init.py Exposes generate_site and title-resolution helpers.
analytics/analytics_package/analytics/static_site/README.md New usage and architecture documentation.
.gitignore Ignores generated site/, .egg-info/, and .credentials/.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread analytics/analytics_package/analytics/static_site/template/index.html Outdated
Comment thread analytics/analytics_package/analytics/static_site/README.md
Comment thread analytics/analytics_package/analytics/static_site/README.md Outdated
Comment thread analytics/hca-explorer-sheets/generate_static_site.py
Comment thread analytics/lungmap-analytics/sheets/generate_static_site.py
Comment thread analytics/anvil-explorer-sheets/generate_static_site.py
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a reusable static-site analytics dashboard generator to the shared analytics package and wires it up for each data-browser app via per-app generate_static_site.py entrypoints.

Changes:

  • Introduces analytics.static_site subpackage to fetch GA4 data, export JSON artifacts, and copy a static HTML/Chart.js dashboard template.
  • Adds per-app static site generation scripts for AnVIL Explorer, AnVIL Catalog, HCA Explorer, and LungMAP with app-specific branding and event configuration.
  • Updates packaging (setup.py) and repo hygiene (.gitignore) to support the new package and generated site outputs.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
analytics/lungmap-analytics/sheets/generate_static_site.py Adds LungMAP static site generation script and title resolution via Azul (catalog=lm10).
analytics/lungmap-analytics/sheets/constants.py Updates report month/folder constants.
analytics/hca-explorer-sheets/generate_static_site.py Adds HCA static site generation script and title resolution via Azul projects endpoint.
analytics/hca-explorer-sheets/constants.py Updates report month/folder constants.
analytics/anvil-explorer-sheets/utils.py Minor change in dataset title map pagination handling (comment removal).
analytics/anvil-explorer-sheets/generate_static_site.py Adds AnVIL Explorer static site generation script with dataset title resolution and access-request tracking.
analytics/anvil-explorer-sheets/constants.py Updates report month/folder constants.
analytics/anvil-catalog-sheets/generate_static_site.py Adds AnVIL Catalog static site generation script (minimal config).
analytics/anvil-catalog-sheets/constants.py Updates report month/folder constants.
analytics/analytics_package/setup.py Packages analytics.static_site, includes template HTML, adds requests dependency.
analytics/analytics_package/analytics/static_site/template/index.html Adds the static dashboard HTML + JS renderer (fetches exported JSON and renders charts/tables).
analytics/analytics_package/analytics/static_site/resolve.py Adds API-backed entity title resolution and in-memory enrichment for detail tables.
analytics/analytics_package/analytics/static_site/generator.py Adds orchestration entrypoint generate_site() (fetch → enrich → copy template → export).
analytics/analytics_package/analytics/static_site/fetch.py Adds GA4 fetching logic for monthly traffic, tables, custom events, downloads, and access requests.
analytics/analytics_package/analytics/static_site/export.py Adds JSON export logic for the dashboard’s site/data/*.json files.
analytics/analytics_package/analytics/static_site/init.py Exposes the public static-site generator API.
analytics/analytics_package/analytics/static_site/README.md Documents how to install and generate per-app static sites.
.gitignore Ignores generated site/ directories, egg-info, and local .credentials/.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread analytics/analytics_package/analytics/static_site/README.md Outdated
Comment thread analytics/analytics_package/analytics/static_site/resolve.py
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a reusable static analytics dashboard generator to the shared analytics Python package and publishes generated dashboards to GitHub Pages for multiple data-browser apps.

Changes:

  • Introduces analytics.static_site (fetch/export/resolve + HTML template) to generate static GA4 dashboards.
  • Adds per-app generate_static_site.py scripts (AnVIL Explorer, AnVIL Catalog, HCA Explorer, LungMAP) plus updated constants.
  • Adds a gh-pages/ deployment workflow and generated gh-pages/ site artifacts for deployment.

Reviewed changes

Copilot reviewed 55 out of 59 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
gh-pages/index.html Landing page linking to deployed app analytics dashboards
gh-pages/anvil-explorer/index.html Generated static dashboard HTML for AnVIL Explorer
gh-pages/anvil-explorer/data/outbound_links.json Generated outbound-link metrics for AnVIL Explorer
gh-pages/anvil-explorer/data/monthly_traffic.json Generated monthly traffic metrics for AnVIL Explorer
gh-pages/anvil-explorer/data/meta.json Generated metadata (report bounds, sessions, engagement) for AnVIL Explorer
gh-pages/anvil-explorer/data/file_downloads.json Generated file download detail data for AnVIL Explorer
gh-pages/anvil-explorer/data/event_dataset_file_manifest_requested_detail.json Generated detail table for manifest-request event (AnVIL Explorer)
gh-pages/anvil-explorer/data/event_dataset_bulk_download_requested_detail.json Generated detail table for bulk-download event (AnVIL Explorer)
gh-pages/anvil-explorer/data/event_dataset_analyze_in_terra_requested_detail.json Generated detail table for Terra-export event (AnVIL Explorer)
gh-pages/anvil-explorer/data/custom_events.json Generated custom event rollups for AnVIL Explorer
gh-pages/anvil-explorer/data/config.json Generated dashboard branding/config for AnVIL Explorer
gh-pages/anvil-explorer/data/access_requests.json Generated access-request tracking data for AnVIL Explorer
gh-pages/hca-explorer/index.html Generated static dashboard HTML for HCA Explorer
gh-pages/hca-explorer/data/monthly_traffic.json Generated monthly traffic metrics for HCA Explorer
gh-pages/hca-explorer/data/meta.json Generated metadata (report bounds, sessions, engagement) for HCA Explorer
gh-pages/hca-explorer/data/file_downloads.json Generated file download detail data for HCA Explorer
gh-pages/hca-explorer/data/event_dataset_file_manifest_requested_detail.json Generated detail table for manifest-request event (HCA Explorer)
gh-pages/hca-explorer/data/event_dataset_analyze_in_terra_requested_detail.json Generated detail table for Terra-export event (HCA Explorer)
gh-pages/hca-explorer/data/custom_events.json Generated custom event rollups for HCA Explorer
gh-pages/hca-explorer/data/config.json Generated dashboard branding/config for HCA Explorer
gh-pages/lungmap/index.html Generated static dashboard HTML for LungMAP
gh-pages/lungmap/data/pageviews.json Generated pageview metrics for LungMAP
gh-pages/lungmap/data/outbound_links.json Generated outbound-link metrics for LungMAP
gh-pages/lungmap/data/monthly_traffic.json Generated monthly traffic metrics for LungMAP
gh-pages/lungmap/data/meta.json Generated metadata (report bounds, sessions, engagement) for LungMAP
gh-pages/lungmap/data/filter_selected.json Generated filter-selection event metrics for LungMAP
gh-pages/lungmap/data/file_downloads.json Generated file download detail data for LungMAP
gh-pages/lungmap/data/event_dataset_file_manifest_requested_detail.json Generated detail table for manifest-request event (LungMAP)
gh-pages/lungmap/data/event_dataset_bulk_download_requested_detail.json Generated detail table for bulk-download event (LungMAP)
gh-pages/lungmap/data/event_dataset_analyze_in_terra_requested_detail.json Generated detail table for Terra-export event (LungMAP)
gh-pages/lungmap/data/custom_events.json Generated custom event rollups for LungMAP
gh-pages/lungmap/data/config.json Generated dashboard branding/config for LungMAP
analytics/lungmap-analytics/sheets/generate_static_site.py LungMAP-specific generation config and project title resolution
analytics/lungmap-analytics/sheets/constants.py Updates LungMAP report month/constants
analytics/hca-explorer-sheets/generate_static_site.py HCA-specific generation config and project title resolution
analytics/hca-explorer-sheets/constants.py Updates HCA report month/constants
analytics/anvil-explorer-sheets/utils.py Small cleanup in dataset title map fetch helper
analytics/anvil-explorer-sheets/generate_static_site.py AnVIL Explorer generation config + dataset title enrichment + access request tracking
analytics/anvil-explorer-sheets/constants.py Updates AnVIL Explorer report month/constants
analytics/anvil-catalog-sheets/generate_static_site.py AnVIL Catalog generation config
analytics/anvil-catalog-sheets/constants.py Updates AnVIL Catalog report month/constants
analytics/deploy_sites.sh Script to copy generated site/ outputs into gh-pages/ for deployment
analytics/analytics_package/setup.py Packages analytics.static_site, ships template HTML, adds requests dependency
analytics/analytics_package/analytics/static_site/resolve.py Catalog API title resolution + enrichment helpers
analytics/analytics_package/analytics/static_site/generator.py Orchestrates fetch → optional title enrichment → export → template copy
analytics/analytics_package/analytics/static_site/fetch.py GA4 data fetch logic for traffic/pages/outbound/filters/events/downloads/access requests
analytics/analytics_package/analytics/static_site/export.py JSON export pipeline for the static site data directory
analytics/analytics_package/analytics/static_site/init.py Public API exports for static site generator
analytics/analytics_package/analytics/static_site/README.md Documentation for generating and deploying the static dashboards
.prettierignore Ignores gh-pages/ formatting
.gitignore Ignores build artifacts, generated site/ dirs, and .credentials/
.github/workflows/deploy-analytics.yml GitHub Pages deployment workflow for gh-pages/

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gh-pages/index.html
Comment thread gh-pages/anvil-explorer/index.html Outdated
Comment thread gh-pages/anvil-explorer/index.html
Comment thread gh-pages/hca-explorer/index.html Outdated
Comment thread gh-pages/hca-explorer/index.html Outdated
Comment thread analytics/deploy_sites.sh
Comment thread gh-pages/anvil-explorer/index.html
Comment thread gh-pages/hca-explorer/index.html
Comment thread gh-pages/hca-explorer/index.html Outdated
Comment thread gh-pages/lungmap/index.html
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 56 out of 60 changed files in this pull request and generated 11 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gh-pages/anvil-explorer/index.html
Comment thread gh-pages/anvil-explorer/index.html
Comment thread gh-pages/hca-explorer/index.html
Comment thread gh-pages/hca-explorer/index.html
Comment thread gh-pages/hca-explorer/index.html
Comment thread gh-pages/hca-explorer/data/config.json
Comment thread gh-pages/lungmap/index.html
Comment thread gh-pages/lungmap/index.html
Comment thread gh-pages/lungmap/index.html
Comment thread gh-pages/lungmap/data/config.json
MillenniumFalconMechanic and others added 9 commits May 5, 2026 11:30
…4779

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…4779

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…feHref #4779

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@MillenniumFalconMechanic MillenniumFalconMechanic force-pushed the mim/4779-analytics-static-site branch from 1bbb88b to b0954a5 Compare May 5, 2026 18:31
@NoopDog NoopDog merged commit 85eb817 into main May 5, 2026
3 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.

Add static analytics site generator to analytics package

3 participants