feat(data-analytics-demo): T-09 dashboard — self-built Python+Jinja2+Plotly (Evidence pivot)#89
Merged
Conversation
…Plotly (Evidence pivot)
Phase 5 of the data-analytics-demo bolt-on. Ships a static-HTML dashboard
generator that reads the dbt marts and emits 4 pages of charts + tables to
`dashboard/build/`.
Pivot from Evidence: the original Tradeoff 4 (ADR-0070) chose Evidence as
the BI tool. Local installation hit four+ chained peer-dependency failures
under pnpm 10 isolated layout and npm strict resolution (@sveltejs/kit,
vite, @evidence-dev/tailwind, ...). The fix path was unbounded and would
have introduced a second package manager into an otherwise-Python sub-tree
for a build-time-only artifact. ADR-0070 is amended in this PR with the
revised Tradeoff 4 and the rationale.
What lands:
- src/data_analytics_demo/dashboard/{__init__,render,queries,charts}.py
Pure Python generator — reads from analytics.duckdb via duckdb-py,
builds Plotly figures, renders Jinja2 templates.
- src/data_analytics_demo/dashboard/templates/{base,index,rfm,churn,kpi}.html.j2
Layout (header / nav / metric strip / cards / footer) + 4 page templates.
- tests/test_dashboard.py — 4 cases covering AC-5.1〜5.4 (renders all
pages; index contains all 3 required sections; uses the supplied
DuckDB; missing-warehouse raises a clear error).
- Makefile + cli.py — `make dashboard` / `data-analytics-demo dashboard`
now invoke the Python generator.
- pyproject.toml — adds jinja2 (BSD, Pallets) + plotly (MIT, Plotly Inc.)
to dependencies; both already in the audited stack space.
- ADR-0070 amendment with the revised Tradeoff 4 and a "Why this is the
better fit" narrative.
Local verify (Python 3.12 venv, seed=42):
- `make data` + `make dbt` + `make dashboard` end-to-end OK
- 4 pages produced: index.html (28KB), rfm.html (39KB), churn.html (12KB),
kpi.html (38KB) — Plotly via CDN keeps per-page size small.
- ruff OK / mypy OK (19 source files) / pytest 26 PASS / coverage 88.31%
- doc-drift 0 fail / adr-claims 77/77 PASS
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
2 tasks
leagames0221-sys
added a commit
that referenced
this pull request
May 21, 2026
…Plotly (Evidence pivot) (#89) Phase 5 of the data-analytics-demo bolt-on. Ships a static-HTML dashboard generator that reads the dbt marts and emits 4 pages of charts + tables to `dashboard/build/`. Pivot from Evidence: the original Tradeoff 4 (ADR-0070) chose Evidence as the BI tool. Local installation hit four+ chained peer-dependency failures under pnpm 10 isolated layout and npm strict resolution (@sveltejs/kit, vite, @evidence-dev/tailwind, ...). The fix path was unbounded and would have introduced a second package manager into an otherwise-Python sub-tree for a build-time-only artifact. ADR-0070 is amended in this PR with the revised Tradeoff 4 and the rationale. What lands: - src/data_analytics_demo/dashboard/{__init__,render,queries,charts}.py Pure Python generator — reads from analytics.duckdb via duckdb-py, builds Plotly figures, renders Jinja2 templates. - src/data_analytics_demo/dashboard/templates/{base,index,rfm,churn,kpi}.html.j2 Layout (header / nav / metric strip / cards / footer) + 4 page templates. - tests/test_dashboard.py — 4 cases covering AC-5.1〜5.4 (renders all pages; index contains all 3 required sections; uses the supplied DuckDB; missing-warehouse raises a clear error). - Makefile + cli.py — `make dashboard` / `data-analytics-demo dashboard` now invoke the Python generator. - pyproject.toml — adds jinja2 (BSD, Pallets) + plotly (MIT, Plotly Inc.) to dependencies; both already in the audited stack space. - ADR-0070 amendment with the revised Tradeoff 4 and a "Why this is the better fit" narrative. Local verify (Python 3.12 venv, seed=42): - `make data` + `make dbt` + `make dashboard` end-to-end OK - 4 pages produced: index.html (28KB), rfm.html (39KB), churn.html (12KB), kpi.html (38KB) — Plotly via CDN keeps per-page size small. - ruff OK / mypy OK (19 source files) / pytest 26 PASS / coverage 88.31% - doc-drift 0 fail / adr-claims 77/77 PASS Co-authored-by: leagames0221-sys <leagames0221@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 5 of the data-analytics-demo bolt-on. Ships a self-built static-HTML dashboard generator written in pure Python (Jinja2 + Plotly) that replaces the originally planned Evidence integration.
What lands
src/data_analytics_demo/dashboard/render.pydashboard/build/{index,rfm,churn,kpi}.htmlsrc/data_analytics_demo/dashboard/queries.pysrc/data_analytics_demo/dashboard/charts.pysrc/data_analytics_demo/dashboard/templates/*.html.j2tests/test_dashboard.pypyproject.tomlMakefile+cli.pymake dashboard/data-analytics-demo dashboardinvoke the Python generatordocs/adr/0070-...mdWhy the Evidence pivot
Local installation of Evidence hit four+ chained peer-dep resolution failures under pnpm 10's isolated layout and npm strict resolution (
@sveltejs/kit,vite,@evidence-dev/tailwind, ...). The fix path was unbounded and would have introduced a second package manager into an otherwise-Python sub-tree for a build-time-only artifact. The amended ADR-0070 captures the rationale.A pure-Python generator gives:
AC coverage
make dashboardproduces static HTMLtest_ac_5_1_renders_all_pagestest_ac_5_2_index_includes_required_sectionsanalytics.duckdbtest_ac_5_3_uses_provided_duckdbtest_ac_5_4_missing_warehouse_raisesLocal verify
make data+make dbt+make dashboardend-to-end OK on Python 3.12 venvruff+mypy --strictclean (19 source files)pytest26 passed; coverage 88.31%check-doc-drift.mjs0 failure;check-adr-claims.mjs77/77Test plan