Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
elray1 authored and hubdashboard[bot] committed Feb 28, 2025
0 parents commit ae6126d
Show file tree
Hide file tree
Showing 24 changed files with 6,938 additions and 0 deletions.
Empty file added .nojekyll
Empty file.
610 changes: 610 additions & 0 deletions eval.html

Large diffs are not rendered by default.

610 changes: 610 additions & 0 deletions forecast.html

Large diffs are not rendered by default.

644 changes: 644 additions & 0 deletions index.html

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions resources/css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.navbar {
background-color: #003a80;
}

body {
font-family: "Source Sans Pro", "Helvetica Neue", Helvetica Neue, Helvetica, Arial, sans-serif;
}

a {
color: #0073ff;
}

a:hover,
a:focus {
color: #0073ff;
}

.navbar-inverse .navbar-nav > li > a:hover {
background-color: #002858;
}

.navbar-inverse .navbar-nav > li > a:focus {
background-color: #002858;
}

.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover,
.navbar-inverse .navbar-nav > .active > a:focus {
background-color: #002858;
}

.button {
color: #ffffff;
padding: 20px 40px;
font-size: 20px;
border: none;

border-radius: 5px;

margin: 5px;
}

.button.forecasts {
color: #fff;
background-color: #003a80;
}

.button.reports {
color: #fff;
background-color: #64a621;
}

.list-group-item.active,
.list-group-item.active:hover,
.list-group-item.active:focus {
background-color: #003a80;
}

@media (min-width: 768px) and (max-width: 991px) {
header {
padding-bottom: 89.2px !important;
}
}
56 changes: 56 additions & 0 deletions resources/predevals_interface.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import App from "https://cdn.jsdelivr.net/gh/hubverse-org/[email protected]/dist/predevals.bundle.js";
import * as d3 from "https://cdn.jsdelivr.net/npm/d3@7/+esm";

document.predevals = App; // for debugging
document.d3m = d3; // for debugging

function replace_chars(the_string) {
// replace all non-alphanumeric characters, except dashes and underscores, with a dash
return the_string.replace(/[^a-zA-Z0-9-_]/g, '-');
}

const root = "https://raw.githubusercontent.com/reichlab/flusight-dashboard/refs/heads/predevals/data/";

async function _fetchData(target, eval_window, disaggregate_by) {
// ex taskIDs: {"scenario_id": "A-2022-05-09", "location": "US"} . NB: key order not sorted
console.info("_fetchData(): entered.", `"${target}"`, `"${eval_window}"`, `"${disaggregate_by}"`);

let target_path;
if (disaggregate_by === '(None)') {
target_path = `${root}scores/${target}/${eval_window}/scores.csv`;
} else {
target_path = `${root}scores/${target}/${eval_window}/${disaggregate_by}/scores.csv`;
}
return d3.csv(target_path);
}


// load options and then initialize the component
fetch(`${root}/predevals-options.json`)
.then(response => response.json())
.then((data) => {
console.info("fetch(): done. calling App.initialize().", data);

// componentDiv, _fetchData, options:
App.initialize('predEval_row', _fetchData, data);
})
.then(function() {
// ZNK 2024-09-16: update for bootstrap 5
var divs = document.querySelectorAll("div[class^='col-md']");
for (var div of divs) {
if (div.className.match("g-col") == null) {
var n = div.className.match("col-md-(.{1,2})")[1];
div.classList.add("g-col-"+n);
}
}
});

window.addEventListener('DOMContentLoaded', function() {
var divs = document.querySelectorAll("div[class^='col-md']");
for (var div of divs) {
if (div.className.match("g-col") == null) {
var n = div.className.match("col-md-(.{1,2})")[1];
div.classList.add("g-col-"+n);
}
}
});
63 changes: 63 additions & 0 deletions resources/predtimechart.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import App from 'https://cdn.jsdelivr.net/gh/reichlab/[email protected]/dist/predtimechart.bundle.js';
document.predtimechart = App; // for debugging

function replace_chars(the_string) {
// replace all non-alphanumeric characters, except dashes and underscores, with a dash
return the_string.replace(/[^a-zA-Z0-9-_]/g, '-');
}

const root = "https://raw.githubusercontent.com/reichlab/flusight-dashboard/refs/heads/ptc/data/";

function _fetchData(isForecast, targetKey, taskIDs, referenceDate) {
// ex taskIDs: {"scenario_id": "A-2022-05-09", "location": "US"} . NB: key order not sorted
console.info("_fetchData(): entered.", isForecast, `"${targetKey}"`, taskIDs, `"${referenceDate}"`);

const targetKeyStr = replace_chars(targetKey);

// get .json file name: 1) get taskIDs values ordered by sorted keys, 2) clean up ala `json_file_name()`
const taskIDsValsSorted = Object.keys(taskIDs).sort().map(key => taskIDs[key]);
const taskIDsValsStr = replace_chars(taskIDsValsSorted.join(' '));

let target_path;
const file_name = `${targetKeyStr}_${taskIDsValsStr}_${referenceDate}.json`;
if (isForecast) {
target_path = `${root}/forecasts/${file_name}`;
} else {
target_path = `${root}/targets/${file_name}`;
}
return fetch(target_path); // Pwomise?
}


// load options and then initialize the component
fetch(`${root}/predtimechart-options.json`)
.then(response => response.json())
.then((data) => {
console.info("fetch(): done. calling App.initialize().", data);

// componentDiv, _fetchData, isIndicateRedraw, options, _calcUemForecasts:
App.initialize('forecastViz_row', _fetchData, false, data, null);
})
.then(function() {
// ZNK 2024-09-16: update for bootstrap 5
var divs = document.querySelectorAll("div[class^='col-md']");
for (var div of divs) {
if (div.className.match("g-col") == null) {
var n = div.className.match("col-md-(.{1,2})")[1];
div.classList.add("g-col-"+n);
}
}
});

window.addEventListener('DOMContentLoaded', function() {
var divs = document.querySelectorAll("div[class^='col-md']");
for (var div of divs) {
if (div.className.match("g-col") == null) {
var n = div.className.match("col-md-(.{1,2})")[1];
div.classList.add("g-col-"+n);
}
}
});



23 changes: 23 additions & 0 deletions search.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[
{
"objectID": "eval.html",
"href": "eval.html",
"title": "FluSight Forecast Hub Dashboard",
"section": "",
"text": "this is replaced"
},
{
"objectID": "index.html",
"href": "index.html",
"title": "Introduction",
"section": "",
"text": "This is a dashboard for the FluSight forecasting challenge that is organized by the US CDC.\n\nView The Latest Forecasts\n\nThe target data for the FluSight challenge is hospitalizations with influenza as reported to the National Healthcare Safety Network (NHSN); this data is publicly available through the CDC’s Weekly Hospital Respiratory Data (HRD) Metrics dataset.\nFor the evaluations, we have excluded predictions for two reference dates that were substantively impacted by NHSN reporting issues: 2024-11-23 and 2025-01-25.\n\n\n\n\n\n\nNote\n\n\n\nThe CDC notes that:\n\nData for reporting dates through April 30, 2024 represent data reported during a previous mandated reporting period as specified by the HHS Secretary. Data for reporting dates May 1, 2024–October 31, 2024 represent voluntarily reported data in the absence of a mandate. Data for reporting dates beginning November 1, 2024 represent data reported during a current mandated reporting period."
},
{
"objectID": "forecast.html",
"href": "forecast.html",
"title": "FluSight Forecast Hub Dashboard",
"section": "",
"text": "this is replaced"
}
]
Loading

0 comments on commit ae6126d

Please sign in to comment.