Add impact equivalence conversions for dashboard overview#243
Conversation
Pure-Python helpers that translate emissions (kg CO2e), energy (kWh), and water (L) totals into everyday comparisons: family-car km, flights, home-years, cups of tea, Olympic pools, and bathtubs. Conversion factors are documented constants with cited sources so they stay auditable and easy to tune. No third-party dependencies.
Render an "In everyday terms" block beneath the overview metric cards, translating the emissions, energy, and water totals into the comparisons requested in DigitalPebble#206. Metric labels reuse the dashboard palette (brown emissions, yellow energy, blue water) to stay consistent with the charts. Kept lightweight per the issue: a compact caption block, no extra selector.
Note the "In everyday terms" overview block in the dashboard how-to and point to reporting/equivalences.py for tuning the conversion factors.
Replace the single-caption "In everyday terms" block with per-metric cards in
the style of Cloud Carbon Footprint and EcoLogits: each equivalence gets an
icon, a prominent number, and a muted label, aligned on a fixed icon column.
Metric identity is carried by a small colored dot plus the metric name,
matching the chart palette without relying on color alone.
Add a sidebar "Equivalence style" selector that switches the second
comparison of each metric between neutral sets — Everyday (flights, cups of
tea, bathtubs), Tech (streaming hours, smartphone charges, washing cycles),
and Nature (tree-years, solar-panel days, rainfall). The first comparison
(car km, home-years, Olympic pools) stays fixed so totals remain comparable.
New factors are documented constants with cited sources.
Also trim trailing zeros from equivalence quantities ("8 flights" instead of
"8.0 flights").
Refs DigitalPebble#206
|
Really nice, thanks @dpol1 Is there any way we could display the source for the conversion factors? It is merely for illustration I know but it would give users more confidence in the numbers. It would be great to reuse the same script when generating the static reports, for consistency |
Add a user-facing factor table (comparison, factor, source) to equivalences.py, built from the same constants as the conversions so the displayed values cannot drift, and show it in a "Conversion factors and sources" expander under the overview equivalence tiles.
Reuse reporting/equivalences.py in report.py so the static report and the dashboard stay consistent: an "In Everyday Terms" section after the billing summary converts the emissions, energy, and water totals with the same factors, followed by the factor/source table. Text only (no icons) so the section renders cleanly in Markdown, HTML, and PDF output. Requested in review of DigitalPebble#243.
Reuse reporting/equivalences.py in report.py so the static report and the dashboard stay consistent: an "In Everyday Terms" section after the billing summary converts the emissions, energy, and water totals with the same factors, followed by the factor/source table. Text only (no icons) so the section renders cleanly in Markdown, HTML, and PDF output.
a84bf19 to
d32c681
Compare
|
Pushed a first pass for both points:
I'm not settled on the expander though. I checked how CCF handles this: no table in the UI, just a Still finishing this, will update the PR. |
that's pretty much what I had in mind: just pointers to references |
Replace the factor table in the dashboard expander and in the static report with a single line of links to where the conversion factors come from (DEFRA, atmosfair, IEA, EPA, Eurostat). The full factor table moves to the methodology page of the documentation.
|
It should work now - I choose the "lazy" way. Also added links in docs dor transparency |
|
Please update with that screenshot the docs |
|
|
Thanks J |

Closes #206