From 5199b79a3e5f5496d5755c571aaecee203026fe7 Mon Sep 17 00:00:00 2001 From: frievoe97 Date: Mon, 3 Feb 2025 10:12:19 +0100 Subject: [PATCH] Fix R Value Display --- src/views/v1/RValuePlot.vue | 6 ++++++ src/views/v2/RValuePlot.vue | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/views/v1/RValuePlot.vue b/src/views/v1/RValuePlot.vue index 854bcb22..64f17f85 100644 --- a/src/views/v1/RValuePlot.vue +++ b/src/views/v1/RValuePlot.vue @@ -288,6 +288,12 @@ export default defineComponent({ }, }, ] + // Ensure avg7dayLookup is updated when manually calculating R-values, + // so it remains available even if precomputed rValues are missing. + this.avg7dayLookup = { + date: susceptible.x.slice(this.lagDays * 2), + avgR: rValues, + } }, }, }) diff --git a/src/views/v2/RValuePlot.vue b/src/views/v2/RValuePlot.vue index 6f1d845b..1068038a 100644 --- a/src/views/v2/RValuePlot.vue +++ b/src/views/v2/RValuePlot.vue @@ -265,7 +265,6 @@ export default defineComponent({ // marker: { color: '#c44', size: 3 }, // }, ] - // save the 7-day average so we can query it later for the summary stats this.avg7dayLookup = { date: x.slice(center), avgR } }, @@ -343,6 +342,13 @@ export default defineComponent({ }, }, ] + + // Ensure avg7dayLookup is updated when manually calculating R-values, + // so it remains available even if precomputed rValues are missing. + this.avg7dayLookup = { + date: susceptible.x.slice(this.lagDays * 2), + avgR: rValues, + } }, }, })