Skip to content

Add monthly trend charts for export events to static analytics pages #4825

@MillenniumFalconMechanic

Description

Summary

Add time-series charts to the static analytics pages for AnVIL Explorer, HCA Data Explorer, and LungMAP showing monthly trends for the three export event types, broken down by dataset/project and cohort:

  • Export to Terra (dataset + cohort)
  • curl Command (dataset + cohort)
  • File Manifest (dataset + cohort)

These charts should start from April 2026 rather than the existing analytics_start date for each project, since these events were only recently instrumented/standardized.

Motivation

The current static analytics pages show monthly counts for these events as stat cards (current month vs prior month), but there is no way to visualize the trend over time. Monthly trend charts would make it easier to see adoption patterns and growth for these key export workflows.

Requirements

  • Add a new chart_start parameter (or per-chart start date) to the static site generator, independent of analytics_start
  • Fetch monthly event counts over time for each configured export event, starting from the chart start date
  • Export monthly event time-series data as JSON (e.g., event_monthly_counts.json)
  • Render Chart.js line or bar charts in the static site template, grouped by event type (Export to Terra, curl Command, File Manifest), with separate series for dataset/project and cohort
  • Configure charts for all three projects:
    • AnVIL Explorer - Dataset / Cross-Dataset
    • HCA Data Explorer - Project / Cross-Dataset
    • LungMAP - Project / Cross-Dataset
  • Chart start date: 2026-04-01 for all three projects

Affected files

  • analytics/analytics_package/analytics/static_site/fetch.py - new monthly event count fetcher
  • analytics/analytics_package/analytics/static_site/export.py - export event time-series JSON
  • analytics/analytics_package/analytics/static_site/generator.py - pass through chart config
  • analytics/analytics_package/analytics/static_site/template/index.html - render charts
  • analytics/anvil-explorer-sheets/generate_static_site.py - add chart config
  • analytics/hca-explorer-sheets/generate_static_site.py - add chart config
  • analytics/lungmap-analytics/sheets/generate_static_site.py - add chart config

Notes

  • The existing event_counts stat cards should remain as-is; the new charts are additive
  • Consider placing the charts in a new "Export Trends" section between the Key Metrics cards and the Key Metric Detail tables
  • The chart grouping (3 charts, each with 2 series) keeps the layout clean vs 6 individual charts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions