Skip to content

Commit 403f519

Browse files
authored
Merge pull request #999 from cmu-delphi/krivard/indicator-status
New indicator status page revisions from approval process
2 parents 337b192 + 28f8011 commit 403f519

File tree

4 files changed

+26
-17
lines changed

4 files changed

+26
-17
lines changed

.husky/pre-commit

100644100755
File mode changed.

src/data/meta.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,6 @@ function findRawCumulativeSignal(sensor: SensorSensor, sensors: SensorSensor[])
151151
return cum;
152152
}
153153

154-
function addDUALink(links: { alt: string; href: string }[], dua?: string | null) {
155-
if (dua) {
156-
return [...links, { alt: 'DUA', href: dua }];
157-
}
158-
return links;
159-
}
160-
161154
function deriveMetaSensors(metadata: EpiDataMetaSourceInfo[]): {
162155
list: SensorSensor[];
163156
map: Map<string, SensorSensor>;
@@ -219,7 +212,7 @@ function deriveMetaSensors(metadata: EpiDataMetaSourceInfo[]): {
219212

220213
return {
221214
...sm,
222-
link: addDUALink(sm.link, sm.dua),
215+
link: sm.link,
223216
sensors,
224217
description: sm.description ? parseMarkDown(sm.description.trim()) : '',
225218
credits,

src/modes/indicator-status/IndicatorSignal.svelte

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script>
2-
import { currentRegionInfo, currentSensor, metaDataManager, selectByInfo } from '../../stores';
2+
import { currentRegionInfo, currentSensor, currentMode, metaDataManager, selectByInfo } from '../../stores';
33
import { DEFAULT_SENSOR } from '../../stores/constants';
44
import AboutSection from '../../components/AboutSection.svelte';
55
import SensorSearch from '../../components/SensorSearch.svelte';
@@ -15,6 +15,8 @@
1515
import SensorBadges from '../../components/SensorBadges.svelte';
1616
import GeoLevelBadge from '../../components/GeoLevelBadge.svelte';
1717
import SourceBadges from '../../components/SourceBadges.svelte';
18+
import chevronLeftIcon from '!raw-loader!@fortawesome/fontawesome-free/svgs/solid/chevron-left.svg';
19+
import { modeByID } from '..';
1820
1921
$: sensor = $metaDataManager.getSensor($currentSensor) || $metaDataManager.getSensor(DEFAULT_SENSOR);
2022
$: source = sensor ? $metaDataManager.getSource(sensor) : undefined;
@@ -25,6 +27,10 @@
2527
$: metaData = $metaDataManager.getMetaData(sensor);
2628
$: name = sensor ? sensor.name : 'Signal';
2729
30+
function switchMode() {
31+
currentMode.set(modeByID['indicator-source']);
32+
}
33+
2834
function formatDateOrWeek(sensor, date, week) {
2935
return sensor.isWeeklySignal ? formatWeek(week) : formatDateISO(date);
3036
}
@@ -33,6 +39,9 @@
3339
<div class="mobile-root">
3440
<div class="mobile-header-line-bg">
3541
<div class="mobile-header-line">
42+
<button class="mobile-back inline-svg-icon" on:click={switchMode}>
43+
{@html chevronLeftIcon}
44+
</button>
3645
<h2>Indicator Status of <span>{name}</span></h2>
3746
</div>
3847
<div class="uk-container content-grid">
@@ -75,7 +84,7 @@
7584
{/if}
7685
</AboutSection>
7786
<AboutSection className="uk-margin-small-top uk-margin-small-bottom">
78-
<h3 class="mobile-h3">About {source ? source.name : ''}</h3>
87+
<h3 class="mobile-h3">Provided by {source ? source.name : ''}</h3>
7988
{#if source}
8089
<div>
8190
<SourceBadges {source} />
@@ -123,7 +132,7 @@
123132
<div>
124133
<KPI text={metaData ? formatDateOrWeek(sensor, metaData.maxTime, metaData.maxWeek) : '?'} />
125134
</div>
126-
<div class="sub">Latest Data Available</div>
135+
<div class="sub" title="Most recent date for which data is available">Latest Data Available</div>
127136
</div>
128137
<div>
129138
<div>
@@ -135,7 +144,7 @@
135144
<div>
136145
<KPI text={metaData ? formatDateOrWeek(sensor, metaData.maxIssue, metaData.maxIssueWeek) : '?'} />
137146
</div>
138-
<div class="sub">Latest Issue</div>
147+
<div class="sub" title="Date the most recent update was published by Delphi">Latest Issue</div>
139148
</div>
140149
</div>
141150
</div>

src/modes/indicator-status/IndicatorStatusTable.svelte

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@
7171
</tr>
7272
<tr>
7373
<th />
74-
<th class="mobile-th uk-text-right">Latest Issue</th>
75-
<th class="mobile-th uk-text-right">Latest Data Available</th>
74+
<th class="mobile-th uk-text-right" title="Date the most recent update was published by Delphi">Latest Issue</th>
75+
<th class="mobile-th uk-text-right" title="Most recent date for which data is available">Latest Data</th>
7676
<th class="mobile-th uk-text-right">Lag to Today</th>
77-
<th class="mobile-th uk-text-right">Latest County Coverage</th>
77+
<th class="mobile-th uk-text-right" title="Percent of US counties included in latest day of data"
78+
>Latest County Coverage</th
79+
>
7880
<th class="mobile-th uk-text-right">
79-
<span>County Coverage</span>
81+
<span title="Percent of US counties included">County Coverage</span>
8082
<div class="mobile-th-range">
8183
<span> {formatDateShortNumbers(loader.domain.min)} </span>
8284
<span> {formatDateShortNumbers(loader.domain.max)} </span>
@@ -111,7 +113,12 @@
111113
href="../indicator-source?sensor={r.source}-{r.reference_signal}"
112114
on:click|preventDefault={() => dispatch('select', r)}>{r.name}</a
113115
>
114-
<div class="source">API: {r.source}</div>
116+
<div
117+
class="source"
118+
title="Use 'data_source={r.source}' when fetching from the covidcast endpoint of the Epidata API."
119+
>
120+
API data_source: {r.source}
121+
</div>
115122
</td>
116123
<td class="uk-text-right uk-text-nowrap">
117124
{r.ref.isWeeklySignal ? formatWeek(r.latest_issue_week) : formatDateISO(r.latest_issue)}

0 commit comments

Comments
 (0)