From 396b1a857e623bb917d9d55bc0aba2f05bfbce28 Mon Sep 17 00:00:00 2001 From: A Samuel Pottinger Date: Sun, 8 Sep 2024 22:17:42 +0000 Subject: [PATCH 1/6] Add packaging consumption as goal. --- js/const.js | 1 + js/goals.js | 6 ++++++ js/sim_presenter.js | 1 + 3 files changed, 8 insertions(+) diff --git a/js/const.js b/js/const.js index c9554e83..9750fb6f 100644 --- a/js/const.js +++ b/js/const.js @@ -128,6 +128,7 @@ const GOALS = { ghg: "ghg", primaryProduction: "primaryProduction", secondaryProduction: "secondaryProduction", + consumptionPackagingMT: "consumptionPackagingMT" }; const STANDARD_ATTR_NAMES = new Map(); diff --git a/js/goals.js b/js/goals.js index c5b97ca4..0048f729 100644 --- a/js/goals.js +++ b/js/goals.js @@ -102,6 +102,12 @@ function getGoals(target) { "value": getRegionOutput(state, region).get("secondaryProductionMT"), }; }, + (state, region) => { + return { + "goal": "consumptionPackagingMT", + "value": getRegionOutput(state, region).get("consumptionPackagingMT"), + }; + }, ]; const goals = new Map(); diff --git a/js/sim_presenter.js b/js/sim_presenter.js index 851036e1..5c6c06f2 100644 --- a/js/sim_presenter.js +++ b/js/sim_presenter.js @@ -47,6 +47,7 @@ const STANDALONE_X_TITLES = { "ghg": "Global Gross GHG (CO2e Mt)", "primaryProduction": "Primary Production (Mt)", "secondaryProduction": "Secondary Production (Mt)", + "consumptionPackagingMT": "Packaging Consumption (Mt)" }; /** From 749e456935869c0bfc3889545fe9da9ac54aaaf0 Mon Sep 17 00:00:00 2001 From: A Samuel Pottinger Date: Sun, 8 Sep 2024 22:50:48 +0000 Subject: [PATCH 2/6] Touch up on #421. --- js/exporters.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/exporters.js b/js/exporters.js index 88025243..ead98be6 100644 --- a/js/exporters.js +++ b/js/exporters.js @@ -42,6 +42,7 @@ const SIM_EXPORT_ATTRS = [ "ghg", "primaryProduction", "secondaryProduction", + "consumptionPackagingMT", ]; const SIM_SUMMARY_EXPORT_ATTRS = [ @@ -63,6 +64,7 @@ const SIM_EXPORT_ATTR_HEADERS = { "ghg": "totalGhgCO2eMt", "primaryProduction": "primaryProductionMt", "secondaryProduction": "secondaryProductionMt", + "consumptionPackagingMT": "consumptionPackagingMt", }; From 8db178beab566c38cb3f22111bfb3e00525fe52b Mon Sep 17 00:00:00 2001 From: A Samuel Pottinger Date: Mon, 9 Sep 2024 17:57:08 +0000 Subject: [PATCH 3/6] Lint fix. --- js/const.js | 2 +- js/sim_presenter.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/const.js b/js/const.js index 9750fb6f..90c87131 100644 --- a/js/const.js +++ b/js/const.js @@ -128,7 +128,7 @@ const GOALS = { ghg: "ghg", primaryProduction: "primaryProduction", secondaryProduction: "secondaryProduction", - consumptionPackagingMT: "consumptionPackagingMT" + consumptionPackagingMT: "consumptionPackagingMT", }; const STANDARD_ATTR_NAMES = new Map(); diff --git a/js/sim_presenter.js b/js/sim_presenter.js index 5c6c06f2..8fae277e 100644 --- a/js/sim_presenter.js +++ b/js/sim_presenter.js @@ -47,7 +47,7 @@ const STANDALONE_X_TITLES = { "ghg": "Global Gross GHG (CO2e Mt)", "primaryProduction": "Primary Production (Mt)", "secondaryProduction": "Secondary Production (Mt)", - "consumptionPackagingMT": "Packaging Consumption (Mt)" + "consumptionPackagingMT": "Packaging Consumption (Mt)", }; /** From a8ae79b96307ef3cfc68ec039d83962fdeb601cd Mon Sep 17 00:00:00 2001 From: A Samuel Pottinger Date: Fri, 25 Apr 2025 18:35:01 +0000 Subject: [PATCH 4/6] Clarify that start of life is goods on details tab. Clarify that start of life is goods on details tab (after resin trade, with additives). --- js/report_stage.js | 2 +- js/strings.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/report_stage.js b/js/report_stage.js index 334f02ec..008ab5ad 100644 --- a/js/report_stage.js +++ b/js/report_stage.js @@ -196,7 +196,7 @@ class StagePresenter { } else if (labelRaw === "Net Export (Waste)" && isGlobal) { return "Waste Trade"; } else if (isGlobal) { - return labelRaw.replace(" (Dom)", ""); + return labelRaw.replace(" (Dom ", " ("); } else { return labelRaw; } diff --git a/js/strings.js b/js/strings.js index 37156057..27e4f1ce 100644 --- a/js/strings.js +++ b/js/strings.js @@ -33,8 +33,8 @@ STRINGS.set("netImportsMT", "Net Import (Good/Mat)"); STRINGS.set("netExportsMT", "Net Export (Good/Mat)"); STRINGS.set("netWasteImportMT", "Net Import (Waste)"); STRINGS.set("netWasteExportMT", "Net Export (Waste)"); -STRINGS.set("primaryProductionMT", "Virgin (Dom)"); -STRINGS.set("secondaryProductionMT", "Second (Dom)"); +STRINGS.set("primaryProductionMT", "Virgin (Dom Goods)"); +STRINGS.set("secondaryProductionMT", "Second (Dom Goods)"); STRINGS.set("ghg", "GHG"); STRINGS.set(DISPLAY_TYPES.amount, "Annual Million Metric Tons"); From d37650a12c3602da693d0e837d65eefcaaa72b1a Mon Sep 17 00:00:00 2001 From: A Samuel Pottinger Date: Fri, 25 Apr 2025 18:37:38 +0000 Subject: [PATCH 5/6] Bump cache. --- js/version.txt | 2 +- service_worker_v2.js | 3 ++- template/base.html | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/js/version.txt b/js/version.txt index d646852d..8413311e 100644 --- a/js/version.txt +++ b/js/version.txt @@ -1 +1 @@ -20240910 \ No newline at end of file +20250425 \ No newline at end of file diff --git a/service_worker_v2.js b/service_worker_v2.js index d53844bc..f0500209 100644 --- a/service_worker_v2.js +++ b/service_worker_v2.js @@ -54,8 +54,9 @@ const OLD_CACHES = [ "GlobalPlasticsTool_20240907", "GlobalPlasticsTool_20240908", "GlobalPlasticsTool_20240909", + "GlobalPlasticsTool_20240910" ]; -const CACHE_NAME = "GlobalPlasticsTool_20240910"; +const CACHE_NAME = "GlobalPlasticsTool_20250425"; const ESSENTIAL_FILES = [ "/css/README.md", "/css/base.css", diff --git a/template/base.html b/template/base.html index 8a06215e..947aac01 100644 --- a/template/base.html +++ b/template/base.html @@ -1013,7 +1013,7 @@

Table of Contents

Privacy / Terms / Open Source / Contact / Table of Contents / Accessibility / Cite Us - +
From f286383de9f68b0f67a12076e02917e2ea2d3187 Mon Sep 17 00:00:00 2001 From: A Samuel Pottinger Date: Fri, 25 Apr 2025 14:58:33 -0700 Subject: [PATCH 6/6] Revert "Add packaging consumption as goal." --- js/const.js | 1 - js/exporters.js | 2 -- js/goals.js | 6 ------ js/sim_presenter.js | 1 - 4 files changed, 10 deletions(-) diff --git a/js/const.js b/js/const.js index 90c87131..c9554e83 100644 --- a/js/const.js +++ b/js/const.js @@ -128,7 +128,6 @@ const GOALS = { ghg: "ghg", primaryProduction: "primaryProduction", secondaryProduction: "secondaryProduction", - consumptionPackagingMT: "consumptionPackagingMT", }; const STANDARD_ATTR_NAMES = new Map(); diff --git a/js/exporters.js b/js/exporters.js index ead98be6..88025243 100644 --- a/js/exporters.js +++ b/js/exporters.js @@ -42,7 +42,6 @@ const SIM_EXPORT_ATTRS = [ "ghg", "primaryProduction", "secondaryProduction", - "consumptionPackagingMT", ]; const SIM_SUMMARY_EXPORT_ATTRS = [ @@ -64,7 +63,6 @@ const SIM_EXPORT_ATTR_HEADERS = { "ghg": "totalGhgCO2eMt", "primaryProduction": "primaryProductionMt", "secondaryProduction": "secondaryProductionMt", - "consumptionPackagingMT": "consumptionPackagingMt", }; diff --git a/js/goals.js b/js/goals.js index 0048f729..c5b97ca4 100644 --- a/js/goals.js +++ b/js/goals.js @@ -102,12 +102,6 @@ function getGoals(target) { "value": getRegionOutput(state, region).get("secondaryProductionMT"), }; }, - (state, region) => { - return { - "goal": "consumptionPackagingMT", - "value": getRegionOutput(state, region).get("consumptionPackagingMT"), - }; - }, ]; const goals = new Map(); diff --git a/js/sim_presenter.js b/js/sim_presenter.js index 8fae277e..851036e1 100644 --- a/js/sim_presenter.js +++ b/js/sim_presenter.js @@ -47,7 +47,6 @@ const STANDALONE_X_TITLES = { "ghg": "Global Gross GHG (CO2e Mt)", "primaryProduction": "Primary Production (Mt)", "secondaryProduction": "Secondary Production (Mt)", - "consumptionPackagingMT": "Packaging Consumption (Mt)", }; /**