Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves #1466 #1534

Merged
merged 13 commits into from
Sep 24, 2020
4,198 changes: 4,198 additions & 0 deletions code/reports/2020-09-22-weekly-report.html

Large diffs are not rendered by default.

808 changes: 404 additions & 404 deletions code/reports/weekly-report.Rmd

Large diffs are not rendered by default.

920 changes: 920 additions & 0 deletions data-truth/zoltar-truth.csv

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion visualization/scripts/convert_forecasts.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def reformat_forecasts(file_path, target, root, data):
if "US" in locations_in_file:
df.loc[df["location"] == 'US', "location_name"] = "US National"

# Only visualize wk ahead forecasts
# Only visualize 4 wk ahead forecasts
if target == 'Cumulative Deaths':
targets = ['1 wk ahead cum death',
'2 wk ahead cum death',
Expand All @@ -39,6 +39,11 @@ def reformat_forecasts(file_path, target, root, data):
'2 wk ahead inc death',
'3 wk ahead inc death',
'4 wk ahead inc death']
elif target == 'Incident Cases':
targets = ['1 wk ahead inc case',
'2 wk ahead inc case',
'3 wk ahead inc case',
'4 wk ahead inc case']
df = df[df["target"].isin(targets)]

# Only visualize certain states
Expand Down
3 changes: 2 additions & 1 deletion visualization/scripts/modules/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const targets = [

const targets_cats = [
'Cumulative Deaths',
'Incident Deaths'
'Incident Deaths',
'Incident Cases'
]

module.exports.regions = regions
Expand Down
19 changes: 19 additions & 0 deletions visualization/vis-master/covid-csv-tools/dist/csv.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions visualization/vis-master/covid-csv-tools/dist/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ exports.targetFullNameCum = {
'3-ahead': '3 wk ahead cum death',
'4-ahead': '4 wk ahead cum death'
};
exports.targetFullNameIncCase = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this variable used anywhere?

Copy link
Contributor Author

@ydhuang28 ydhuang28 Sep 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it's used here to pick out the incident case data from the filtered CSV files. For some reason GitHub doesn't expand the diff automatically...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe because it has csv in the filename?

'1-ahead': '1 wk ahead inc case',
'2-ahead': '2 wk ahead inc case',
'3-ahead': '3 wk ahead inc case',
'4-ahead': '4 wk ahead inc case'
};
/**
* Target type for each target. Note that there can be only two
* target types, 'percent' and 'week'.
Expand Down
2 changes: 1 addition & 1 deletion visualization/vis-master/scripts/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const HISTORY_IN_FILE = './scripts/assets/history.json'
const HISTORY_OUT_FILE = './src/assets/data/history.json'
const METADATA_OUT_FILE = './src/assets/data/metadata.json'
//const SEASONS = utils.getSubDirectories(DATA_DIR)
SEASONS = ["Incident Deaths", "Cumulative Deaths"]
SEASONS = ["Incident Deaths", "Cumulative Deaths", "Incident Cases"]

console.log(' Generating data files for flusight')
console.log(' ----------------------------------\n')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export default {
require.ensure(["../../store/data"], () => {
this.importLatestChunk(require("../../store/data"));

this.updateSelectedSeason(this.seasons.length - 1);
this.updateSelectedSeason(0); // first loaded season is Incident Deaths

// Setup map
this.initChoropleth(
Expand Down
1 change: 1 addition & 0 deletions visualization/vis-master/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const importLatestChunk = (context, dataChunk) => {
addScoresData(context, dataChunk.latestScoresData)
addDistData(context, dataChunk.latestDistData)
initMetadata(context, dataChunk.metadata)
addSeasonData(context, dataChunk.incCaseSeasonData)
//initHistory(context, dataChunk.history)
}

Expand Down
3 changes: 3 additions & 0 deletions visualization/vis-master/src/store/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import latestSeasonData from '!json!../assets/data/season-latest.json'
import latestScoresData from '!json!../assets/data/scores-latest.json'
import latestDistData from '!json!../assets/data/distributions/season-latest-nat.json'

import incCaseSeasonData from '!json!../assets/data/season-Incident Cases.json'

const seasonDataCtx = require.context(
'file-loader!../assets/data/',
false,
Expand Down Expand Up @@ -55,6 +57,7 @@ export {
latestSeasonData,
latestScoresData,
latestDistData,
incCaseSeasonData,
//history,
metadata
}