From 8c8499fb1c58941b3cefbb1520fbcfeefdadb66a Mon Sep 17 00:00:00 2001 From: Emily Doherty Date: Sun, 3 Nov 2024 16:29:31 -0800 Subject: [PATCH] Add backwards compatibility for average changes --- src/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 92da1c0..3263aaa 100644 --- a/src/index.js +++ b/src/index.js @@ -165,9 +165,13 @@ function detectTimeQuery(urlSearchParams) { } function detectAggregateQuery(urlSearchParams) { - const validOperations = ['none', 'daily_mean']; + const validOperations = ['none', 'daily_mean', 'avg']; if (validOperations.includes(urlSearchParams.get('aggregate').toLowerCase())) { currentAggregateSelection = urlSearchParams.get('aggregate').toLowerCase(); + // For backwards compatibility + if (currentAggregateSelection === 'daily_mean') { + currentAggregateSelection = 'avg'; + } let aggregateDDL = document.getElementById('aggregate'); for (let i = 0; i < aggregateDDL.options.length; i++) { if (aggregateDDL.options[i].value === currentAggregateSelection) {