Skip to content

Commit ea98ea6

Browse files
authored
Merge pull request #120 from cmu-delphi/release/v2.1.11
Release v2.1.11
2 parents ae0f696 + 9456367 commit ea98ea6

File tree

12 files changed

+102
-16
lines changed

12 files changed

+102
-16
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "www-epivis",
3-
"version": "2.1.10",
3+
"version": "2.1.11",
44
"private": true,
55
"license": "MIT",
66
"description": "",

src/api/EpiData.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,35 @@ export function importFluView({
437437
});
438438
}
439439

440+
export function importFluViewClinical({
441+
regions,
442+
issues,
443+
lag,
444+
}: {
445+
regions: string;
446+
issues?: number | null;
447+
lag?: number | null;
448+
}): Promise<DataGroup | null> {
449+
const regionLabel = fluViewRegions.find((d) => d.value === regions)?.label ?? '?';
450+
const title = appendIssueToTitle(`[API] FluView Clinical: ${regionLabel}`, { issues, lag });
451+
return loadDataSet(
452+
title,
453+
'fluview_clinical',
454+
{
455+
epiweeks: epiRange(firstEpiWeek.fluview, currentEpiWeek),
456+
},
457+
{ regions, issues, lag },
458+
['total_specimens', 'total_a', 'total_b', 'percent_positive', 'percent_a', 'percent_b'],
459+
).then((ds) => {
460+
// get inside the Promise and make sure its not null,
461+
// then enable display of 'percent_positive' data
462+
if (ds instanceof DataGroup) {
463+
ds.defaultEnabled = ['percent_positive'];
464+
}
465+
return ds;
466+
});
467+
}
468+
440469
export function importGFT({ locations }: { locations: string }): Promise<DataGroup | null> {
441470
const regionLabel = gftLocations.find((d) => d.value === locations)?.label ?? '?';
442471
const title = `[API] GFT: ${regionLabel}`;

src/components/Chart.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@
751751
let labelOffset = 0;
752752
for (const ds of datasets) {
753753
ctx.fillStyle = ds.color;
754-
const label = `— ${ds.title}`;
754+
const label = `— ${ds.displayTitle()}`;
755755
drawText(ctx, label, width - 10, height - 10 - labelOffset, 0, Align.right, Align.bottom);
756756
labelOffset += 12;
757757
}

src/components/LeftMenu.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<side class="left" {style} data-tour="browser">
1414
<ImportDataSetsMenu />
1515
<div class="tree">
16-
{#each $datasetTree.datasets as child (child.title)}
16+
{#each $datasetTree.datasets as child (child.displayTitle())}
1717
{#if child instanceof DataSet}
1818
<TreeLeafNode {chart} node={child} />
1919
{:else}

src/components/dialogs/ImportAPIDialog.svelte

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script lang="ts">
22
import FluSurv from './dataSources/FluSurv.svelte';
33
import FluView from './dataSources/FluView.svelte';
4+
import FluViewClinical from './dataSources/FluViewClinical.svelte';
45
56
import { createEventDispatcher } from 'svelte';
67
@@ -81,6 +82,17 @@
8182
>cmu-delphi.github.io</a
8283
>)</label
8384
>
85+
<label
86+
><input
87+
class="uk-radio"
88+
type="radio"
89+
name="dataSource"
90+
bind:group={$formSelections.dataSource}
91+
value="fluview_clinical"
92+
/>
93+
FluView Clinical (source:
94+
<a target="_blank" href="https://gis.cdc.gov/grasp/fluview/fluportaldashboard.html">cdc.gov</a>)
95+
</label>
8496
<label
8597
><input
8698
class="uk-radio"
@@ -200,6 +212,8 @@
200212

201213
{#if $formSelections.dataSource === 'fluview'}
202214
<FluView {id} bind:this={handler} />
215+
{:else if $formSelections.dataSource === 'fluview_clinical'}
216+
<FluViewClinical {id} bind:this={handler} />
203217
{:else if $formSelections.dataSource === 'flusurv'}
204218
<FluSurv {id} bind:this={handler} />
205219
{:else if $formSelections.dataSource === 'gft'}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<script lang="ts">
2+
import { importFluViewClinical } from '../../../api/EpiData';
3+
import { fluViewRegions } from '../../../data/data';
4+
import SelectField from '../inputs/SelectField.svelte';
5+
import SelectIssue from '../inputs/SelectIssue.svelte';
6+
import { formSelections } from '../../../store';
7+
8+
export let id: string;
9+
10+
export function importDataSet() {
11+
return importFluViewClinical({
12+
regions: $formSelections.fluViewClinical.locations,
13+
...$formSelections.fluViewClinical.issue,
14+
});
15+
}
16+
</script>
17+
18+
<SelectField
19+
id="{id}-r"
20+
label="Region"
21+
bind:value={$formSelections.fluViewClinical.locations}
22+
options={fluViewRegions}
23+
/>
24+
<SelectIssue {id} bind:value={$formSelections.fluViewClinical.issue} />

src/components/dialogs/formSelections.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ export class FluViewSelections {
4444
issue = DEFAULT_ISSUE;
4545
}
4646

47+
export class FluViewClinicalSelections {
48+
locations = fluViewRegions[0].value;
49+
issue = DEFAULT_ISSUE;
50+
}
51+
4752
export class GftSelections {
4853
locations = gftLocations[0].value;
4954
}
@@ -93,6 +98,7 @@ export class WikiSelections {
9398
export default class FormSelections {
9499
dataSource:
95100
| 'fluview'
101+
| 'fluview_clinical'
96102
| 'flusurv'
97103
| 'gft'
98104
| 'ght'
@@ -111,6 +117,7 @@ export default class FormSelections {
111117
covidHosp = new CovidHospSelections();
112118
fluSurv = new FluSurvSelections();
113119
fluView = new FluViewSelections();
120+
fluViewClinical = new FluViewClinicalSelections();
114121
gft = new GftSelections();
115122
ght = new GhtSelections();
116123
nidssDengue = new NidssDengueSelections();

src/components/tree/TreeInnerNode.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
<span on:click={toggleExpanded}>
2525
<Fa icon={expanded ? faChevronDown : faChevronRight} style="width: 0.9em; margin-right: 0.5em" />
2626
<span>
27-
{node.title}
27+
{node.displayTitle()}
2828
</span>
2929
</span>
3030
{#if expanded}
31-
{#each node.datasets as child (child.title)}
31+
{#each node.datasets as child (child.displayTitle())}
3232
{#if child instanceof DataSet}
3333
<TreeLeafNode {chart} node={child} />
3434
{:else}

src/components/tree/TreeLeafNode.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
>
3636
<Fa icon={selected ? faEye : faEyeSlash} {color} style="width: 1em; margin-right: 0.5em" />
3737
<span>
38-
{node.title}
38+
{node.displayTitle()}
3939
</span>
4040
</div>
4141

0 commit comments

Comments
 (0)