Skip to content

Commit ad04991

Browse files
committed
fix: small polishing
1 parent 7b0db8f commit ad04991

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

src/data/correlationUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function lagToOffset(lag, wrapped = true) {
1515
return wrap('1 day earlier');
1616
}
1717
if (lag < -1) {
18-
return wrap(`${lag} days earlier`);
18+
return wrap(`${-lag} days earlier`);
1919
}
2020
return '';
2121
}

src/modes/correlation/IndicatorCorrelation.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@
118118
at all).
119119
</p>
120120
<p>
121-
<strong>Lag</strong> is the number in days that an indicator can be shifted, with respect to another. For example,
122-
if we hypothesize that an increase in new cases results in an increase in hospitalizations three days later, hospitalizations
123-
are lagged 3 days.
121+
<strong>Lag</strong> is the number of days that an indicator is shifted backwards with respect to another. For
122+
example, if we hypothesize that an increase in new cases results in an increase in hospitalizations three days
123+
later, hospitalizations are lagged 3 days. A negative lag would indicate the indicator is shifted forwards.
124124
</p>
125125
</AboutSection>
126126
<FancyHeader invert sub="Correlations">Lagged</FancyHeader>
@@ -165,6 +165,7 @@
165165
<h3 class="mobile-h3" slot="header">About the TIME SERIES</h3>
166166
<p>The x-axes in the time series plots below are offset from each other by the selected lag.</p>
167167
</AboutSection>
168+
<p />
168169
<div class="chart-300">
169170
<HistoryLineChart sensor={primary} {date} {region} {fetcher} singleRegionOnly domain={domains.primary} />
170171
</div>

src/modes/correlation/IndicatorCorrelationChart.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
}
165165
166166
function makeIndicatorCompareSpec(primary, secondary, { zero = true, isMobile, xDomain = [], yDomain = [] } = {}) {
167-
const title = joinTitle([`${primary.name} correlated with`, `${secondary.name} $lag_days_later`], isMobile);
167+
const title = joinTitle([`${primary.name} correlated with`, `${secondary.name}$lag_days_later`], isMobile);
168168
/**
169169
* @type {import('vega-lite').TopLevelSpec}
170170
*/

src/modes/mobile/IndicatorCorrelation.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@
107107
at all).
108108
</p>
109109
<p>
110-
It is sometimes useful to examine signals that move together, but are offset in time. For example, a change in new
111-
cases is reflected in a change in deaths about 20 days later.
112-
<strong>Lag</strong> is the number of days that an indicator is shifted, with respect to another. In this example, new
113-
cases are most highly correlated with deaths at a lag of 20 days.
110+
It is sometimes useful to examine signals that move together, but are offset in time.
111+
<strong>Lag</strong> is the number of days that an indicator is shifted backwards with respect to another. For example,
112+
a change in new cases is reflected in a change in deaths about 20 days later. In this example, new cases are most highly
113+
correlated with deaths at a lag of 20 days. A negative lag would indicate the indicator is shifted forwards.
114114
</p>
115115
<p>This table shows the following metrics between indicators:</p>
116116
<ul>

0 commit comments

Comments
 (0)