From a621fc56e863acc44742be1106c9ef4a9852bf37 Mon Sep 17 00:00:00 2001 From: Rostyslav Zatserkovnyi Date: Fri, 15 Mar 2024 00:08:19 +0200 Subject: [PATCH 01/13] Set default values based on URL params --- src/modes/exportdata/ExportData.svelte | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/modes/exportdata/ExportData.svelte b/src/modes/exportdata/ExportData.svelte index b04c2da7..da102de6 100644 --- a/src/modes/exportdata/ExportData.svelte +++ b/src/modes/exportdata/ExportData.svelte @@ -27,18 +27,31 @@ } } + const urlParams = new URLSearchParams(window.location.search); + + // Overwrite default source & sensor if these are present in the URL + if (urlParams.has('source')) { + sourceValue = urlParams.get('source'); + + if (urlParams.has('sensor')) { + sensorValue = urlParams.get('sensor'); + } + } + $: isWeekly = sensor ? sensor.isWeeklySignal : false; $: formatDate = isWeekly ? (d) => formatWeek(d).replace('W', '') : formatDateISO; - let geoType = 'county'; + let geoType = urlParams.has('geo') ? urlParams.get('geo') : 'county'; let startDate = new Date(); let endDate = new Date(); function initDate(date) { const param = new DateParam(date); - endDate = param.sparkLineTimeFrame.max; - startDate = param.sparkLineTimeFrame.min; + + // Populate date based on URL params or, if absent, the current date + startDate = urlParams.has('start') ? new Date(urlParams.get('start')) : param.sparkLineTimeFrame.min; + endDate = urlParams.has('end') ? new Date(urlParams.get('end')) : param.sparkLineTimeFrame.max; } $: initDate($currentDateObject); From 0d5d1492c0fe41bb7ffce09f04e54ea436bbbfbc Mon Sep 17 00:00:00 2001 From: Rostyslav Zatserkovnyi Date: Fri, 15 Mar 2024 00:26:33 +0200 Subject: [PATCH 02/13] Also add geo_id --- src/modes/exportdata/ExportData.svelte | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/modes/exportdata/ExportData.svelte b/src/modes/exportdata/ExportData.svelte index da102de6..a898a8c7 100644 --- a/src/modes/exportdata/ExportData.svelte +++ b/src/modes/exportdata/ExportData.svelte @@ -27,6 +27,8 @@ } } + // Pre-fill the form from URL parameters. + // Supported parameters: source, sensor, start, end, geo_type, geo_id const urlParams = new URLSearchParams(window.location.search); // Overwrite default source & sensor if these are present in the URL @@ -41,7 +43,7 @@ $: isWeekly = sensor ? sensor.isWeeklySignal : false; $: formatDate = isWeekly ? (d) => formatWeek(d).replace('W', '') : formatDateISO; - let geoType = urlParams.has('geo') ? urlParams.get('geo') : 'county'; + let geoType = urlParams.has('geo_type') ? urlParams.get('geo_type') : 'county'; let startDate = new Date(); let endDate = new Date(); @@ -72,12 +74,20 @@ let geoValuesMode = 'all'; let geoValues = []; + let geoURLSet = false; $: geoItems = [...(infosByLevel[geoType] || []), ...(geoType === 'county' ? infosByLevel.state : [])]; $: { if (geoItems != null) { geoValues = []; geoValuesMode = guessMode(geoItems.length); } + + // Populate region based on URL params... but let the user override this later + if (urlParams.has('geo_id') && !geoURLSet) { + let infos = infosByLevel[geoType].filter((d) => d.propertyId == urlParams.get('geo_id')); + addRegion(infos[0]); + geoURLSet = true; + } } function flatIds(geoValues) { From cd448c32d932fc0e324d6acf5b5db1dee016ba0d Mon Sep 17 00:00:00 2001 From: Rostyslav Zatserkovnyi Date: Wed, 27 Mar 2024 15:03:34 +0200 Subject: [PATCH 03/13] Fix review comments --- src/modes/exportdata/ExportData.svelte | 35 ++++++++++++++++++++------ 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/src/modes/exportdata/ExportData.svelte b/src/modes/exportdata/ExportData.svelte index a898a8c7..f469bdfe 100644 --- a/src/modes/exportdata/ExportData.svelte +++ b/src/modes/exportdata/ExportData.svelte @@ -32,11 +32,11 @@ const urlParams = new URLSearchParams(window.location.search); // Overwrite default source & sensor if these are present in the URL - if (urlParams.has('source')) { - sourceValue = urlParams.get('source'); + if (urlParams.has('data_source')) { + sourceValue = urlParams.get('data_source'); - if (urlParams.has('sensor')) { - sensorValue = urlParams.get('sensor'); + if (urlParams.has('signal')) { + sensorValue = urlParams.get('signal'); } } @@ -52,8 +52,14 @@ const param = new DateParam(date); // Populate date based on URL params or, if absent, the current date - startDate = urlParams.has('start') ? new Date(urlParams.get('start')) : param.sparkLineTimeFrame.min; - endDate = urlParams.has('end') ? new Date(urlParams.get('end')) : param.sparkLineTimeFrame.max; + if (sensor && !sensor.active) { + // If the sensor is inactive, set the start and end dates to its historical range rather than current date + startDate = urlParams.has('start_day') ? new Date(urlParams.get('start_day')) : sensor.meta.minTime; + endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : sensor.meta.maxTime; + } else { + startDate = urlParams.has('start_day') ? new Date(urlParams.get('start_day')) : param.sparkLineTimeFrame.min; + endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : param.sparkLineTimeFrame.max; + } } $: initDate($currentDateObject); @@ -83,8 +89,8 @@ } // Populate region based on URL params... but let the user override this later - if (urlParams.has('geo_id') && !geoURLSet) { - let infos = infosByLevel[geoType].filter((d) => d.propertyId == urlParams.get('geo_id')); + if (urlParams.has('geo_value') && !geoURLSet) { + let infos = infosByLevel[geoType].filter((d) => d.propertyId == urlParams.get('geo_value')); addRegion(infos[0]); geoURLSet = true; } @@ -113,6 +119,11 @@ } } $: usesAsOf = asOfMode !== 'latest' && asOfDate instanceof Date; + // set as_of based on URL params, if it's a valid date + if (urlParams.has('as_of') && !isNaN(new Date(urlParams.get('as_of')))) { + asOfMode = 'single'; + asOfDate = new Date(urlParams.get('as_of')); + } let form = null; @@ -127,6 +138,14 @@ ); }); } + // Fix up the UI if we got an inactive sensor from the URL parameters. + if (sensor && !sensor.active) { + showInActive = true; + // Force an update to sourceValue to set related reactive statements correctly. + let temp = sourceValue; + sourceValue = ''; + sourceValue = temp; + } }); function addRegion(detail) { From d9f12debc95d9ec6f8558f861df42ac28cd2af3d Mon Sep 17 00:00:00 2001 From: Rostyslav Zatserkovnyi Date: Wed, 27 Mar 2024 15:11:20 +0200 Subject: [PATCH 04/13] Discard date from URL if it's not within the right range --- src/modes/exportdata/ExportData.svelte | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/modes/exportdata/ExportData.svelte b/src/modes/exportdata/ExportData.svelte index f469bdfe..8a586f7d 100644 --- a/src/modes/exportdata/ExportData.svelte +++ b/src/modes/exportdata/ExportData.svelte @@ -54,8 +54,24 @@ // Populate date based on URL params or, if absent, the current date if (sensor && !sensor.active) { // If the sensor is inactive, set the start and end dates to its historical range rather than current date - startDate = urlParams.has('start_day') ? new Date(urlParams.get('start_day')) : sensor.meta.minTime; - endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : sensor.meta.maxTime; + if ( + urlParams.has('start_day') && + new Date(urlParams.get('start_day')) >= sensor.meta.minTime && + new Date(urlParams.get('start_day')) <= sensor.meta.maxTime + ) { + startDate = new Date(urlParams.get('start_day')); + } else { + startDate = sensor.meta.minTime; + } + if ( + urlParams.has('end_day') && + new Date(urlParams.get('end_day')) <= sensor.meta.minTime && + new Date(urlParams.get('end_day')) <= sensor.meta.maxTime + ) { + endDate = new Date(urlParams.get('end_day')); + } else { + endDate = sensor.meta.maxTime; + } } else { startDate = urlParams.has('start_day') ? new Date(urlParams.get('start_day')) : param.sparkLineTimeFrame.min; endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : param.sparkLineTimeFrame.max; From f978fa7e48fc59adf73b4e40736f8f1405225f13 Mon Sep 17 00:00:00 2001 From: Rostyslav Zatserkovnyi Date: Wed, 27 Mar 2024 17:16:37 +0200 Subject: [PATCH 05/13] Revert time clamping, modify comment --- src/modes/exportdata/ExportData.svelte | 28 +++----------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/src/modes/exportdata/ExportData.svelte b/src/modes/exportdata/ExportData.svelte index 8a586f7d..01f6f375 100644 --- a/src/modes/exportdata/ExportData.svelte +++ b/src/modes/exportdata/ExportData.svelte @@ -28,7 +28,7 @@ } // Pre-fill the form from URL parameters. - // Supported parameters: source, sensor, start, end, geo_type, geo_id + // Supported parameters: data_source, signal, start_day, end_day, geo_type, geo_value, as_of const urlParams = new URLSearchParams(window.location.search); // Overwrite default source & sensor if these are present in the URL @@ -52,30 +52,8 @@ const param = new DateParam(date); // Populate date based on URL params or, if absent, the current date - if (sensor && !sensor.active) { - // If the sensor is inactive, set the start and end dates to its historical range rather than current date - if ( - urlParams.has('start_day') && - new Date(urlParams.get('start_day')) >= sensor.meta.minTime && - new Date(urlParams.get('start_day')) <= sensor.meta.maxTime - ) { - startDate = new Date(urlParams.get('start_day')); - } else { - startDate = sensor.meta.minTime; - } - if ( - urlParams.has('end_day') && - new Date(urlParams.get('end_day')) <= sensor.meta.minTime && - new Date(urlParams.get('end_day')) <= sensor.meta.maxTime - ) { - endDate = new Date(urlParams.get('end_day')); - } else { - endDate = sensor.meta.maxTime; - } - } else { - startDate = urlParams.has('start_day') ? new Date(urlParams.get('start_day')) : param.sparkLineTimeFrame.min; - endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : param.sparkLineTimeFrame.max; - } + startDate = urlParams.has('start_day') ? new Date(urlParams.get('start_day')) : param.sparkLineTimeFrame.min; + endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : param.sparkLineTimeFrame.max; } $: initDate($currentDateObject); From b94ad01321817fb62ab539e8dc4a43d3cd9498a6 Mon Sep 17 00:00:00 2001 From: Rostyslav Zatserkovnyi Date: Wed, 27 Mar 2024 17:26:43 +0200 Subject: [PATCH 06/13] Date off-by-one error fix --- src/modes/exportdata/ExportData.svelte | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modes/exportdata/ExportData.svelte b/src/modes/exportdata/ExportData.svelte index 01f6f375..a45837f5 100644 --- a/src/modes/exportdata/ExportData.svelte +++ b/src/modes/exportdata/ExportData.svelte @@ -54,6 +54,10 @@ // Populate date based on URL params or, if absent, the current date startDate = urlParams.has('start_day') ? new Date(urlParams.get('start_day')) : param.sparkLineTimeFrame.min; endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : param.sparkLineTimeFrame.max; + + // Also normalize the dates to the current timezone + startDate = new Date(startDate.getTime() + Math.abs(startDate.getTimezoneOffset() * 60000)); + endDate = new Date(endDate.getTime() + Math.abs(endDate.getTimezoneOffset() * 60000)); } $: initDate($currentDateObject); @@ -117,6 +121,8 @@ if (urlParams.has('as_of') && !isNaN(new Date(urlParams.get('as_of')))) { asOfMode = 'single'; asOfDate = new Date(urlParams.get('as_of')); + // Also normalize the dates to the current timezone + asOfDate = new Date(asOfDate.getTime() + Math.abs(asOfDate.getTimezoneOffset() * 60000)); } let form = null; From 333a79c85f0a971045d1ba747b47f818626d1372 Mon Sep 17 00:00:00 2001 From: Rostyslav Zatserkovnyi Date: Wed, 27 Mar 2024 17:32:59 +0200 Subject: [PATCH 07/13] Better timezone offset --- src/modes/exportdata/ExportData.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modes/exportdata/ExportData.svelte b/src/modes/exportdata/ExportData.svelte index a45837f5..bde068c3 100644 --- a/src/modes/exportdata/ExportData.svelte +++ b/src/modes/exportdata/ExportData.svelte @@ -56,8 +56,8 @@ endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : param.sparkLineTimeFrame.max; // Also normalize the dates to the current timezone - startDate = new Date(startDate.getTime() + Math.abs(startDate.getTimezoneOffset() * 60000)); - endDate = new Date(endDate.getTime() + Math.abs(endDate.getTimezoneOffset() * 60000)); + startDate = new Date(startDate.getTime() - startDate.getTimezoneOffset() * -60000); + endDate = new Date(endDate.getTime() - endDate.getTimezoneOffset() * -60000); } $: initDate($currentDateObject); @@ -122,7 +122,7 @@ asOfMode = 'single'; asOfDate = new Date(urlParams.get('as_of')); // Also normalize the dates to the current timezone - asOfDate = new Date(asOfDate.getTime() + Math.abs(asOfDate.getTimezoneOffset() * 60000)); + asOfDate = new Date(asOfDate.getTime() - asOfDate.getTimezoneOffset() * -60000); } let form = null; From db70761e4f33f458bce79c6ceabc266242ea17f6 Mon Sep 17 00:00:00 2001 From: george haff Date: Wed, 24 Apr 2024 12:24:20 -0400 Subject: [PATCH 08/13] updated gh actions versions to match those in www-main --- .github/workflows/ci.yml | 8 +++---- .github/workflows/create_release.yml | 6 ++--- .github/workflows/release_main.yml | 30 ++++++++++++------------- .github/workflows/update_gdocs_data.yml | 10 ++++----- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9260ff00..791c26c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,12 +6,12 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Cache Node.js modules - uses: actions/cache@v2 + uses: actions/cache@v4.0.1 with: path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS key: ${{ runner.OS }}-node2-${{ hashFiles('**/package-lock.json') }} diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 2aa6320a..e95ef52b 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: main ssh-key: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_SSH }} @@ -25,7 +25,7 @@ jobs: echo -n "::set-output name=next_tag::" npm version --no-git-tag-version ${{ github.event.inputs.versionName }} - name: Create pull request into main - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v4 with: branch: release/${{ steps.version.outputs.next_tag }} commit-message: 'chore: release ${{ steps.version.outputs.next_tag }}' @@ -37,7 +37,7 @@ jobs: body: | Releasing ${{ steps.version.outputs.next_tag }}. - name: Check out delphi epidata - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_PAT }} repository: cmu-delphi/delphi-epidata diff --git a/.github/workflows/release_main.yml b/.github/workflows/release_main.yml index c9a7516c..49414e70 100644 --- a/.github/workflows/release_main.yml +++ b/.github/workflows/release_main.yml @@ -17,16 +17,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Extract version id: extract_version run: node -pe "'::set-output name=version::' + require('./package.json').version" - name: Create Release id: create_release - uses: release-drafter/release-drafter@v5 + uses: release-drafter/release-drafter@v6 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -42,12 +42,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Cache Node.js modules - uses: actions/cache@v2 + uses: actions/cache@v4.0.1 with: path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS key: ${{ runner.OS }}-node2-${{ hashFiles('**/package-lock.json') }} @@ -57,7 +57,7 @@ jobs: - name: Build Assets run: npm pack - name: Upload Release Asset - uses: AButler/upload-release-assets@v2.0 + uses: AButler/upload-release-assets@v3.0 with: files: 'www-covidcast-*.tgz' repo-token: ${{ secrets.GITHUB_TOKEN }} @@ -70,15 +70,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: cmu-delphi/www-main ssh-key: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_SSH }} - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Cache Node.js modules - uses: actions/cache@v2 + uses: actions/cache@v4.0.1 with: path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS key: ${{ runner.OS }}-main-node2-${{ hashFiles('**/package-lock.json') }} @@ -89,7 +89,7 @@ jobs: run: | npm install https://github.com/cmu-delphi/www-covidcast/releases/download/${{ needs.create_release.outputs.tag_name }}/www-covidcast-${{ needs.create_release.outputs.version }}.tgz - name: Create pull request to update COVIDcast - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_PAT }} branch: bot/update-covidcast @@ -106,7 +106,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: dev ssh-key: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_SSH }} diff --git a/.github/workflows/update_gdocs_data.yml b/.github/workflows/update_gdocs_data.yml index ed9f9602..5e2582a4 100644 --- a/.github/workflows/update_gdocs_data.yml +++ b/.github/workflows/update_gdocs_data.yml @@ -6,14 +6,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ssh-key: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_SSH }} - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Cache Node.js modules - uses: actions/cache@v2 + uses: actions/cache@v4.0.1 with: path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS key: ${{ runner.OS }}-node2-${{ hashFiles('**/package-lock.json') }} @@ -23,7 +23,7 @@ jobs: - name: Update Docs run: npm run gen - name: Create pull request into main - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v4 with: branch: bot/update-docs commit-message: 'chore: update docs' From 9dbf917b2ddf8182018b5b4b15f9fd168e445776 Mon Sep 17 00:00:00 2001 From: Dmytro Trotsko Date: Thu, 2 May 2024 23:21:13 +0300 Subject: [PATCH 09/13] Simplified 'No Recent Data' warning logic. (#1249) * Simplified 'No Recent Data' warning logic. * Added comments * Included DEATHS sensor to the list of indicators for which we are getting latest date we have data for all indicators. --- src/blocks/NoRecentDataWarning.svelte | 10 +++--- src/modes/summary/Overview.svelte | 46 ++++++++++----------------- 2 files changed, 22 insertions(+), 34 deletions(-) diff --git a/src/blocks/NoRecentDataWarning.svelte b/src/blocks/NoRecentDataWarning.svelte index 1b4d21cb..1a86e115 100644 --- a/src/blocks/NoRecentDataWarning.svelte +++ b/src/blocks/NoRecentDataWarning.svelte @@ -10,14 +10,15 @@ */ export let date; - export let warningType; - function switchDate() { date.set(minMaxDate); } -{#if warningType === 1} + + + +{#if minMaxDate.getTime() === date.value.getTime()}

This date, {formatDateYearDayOfWeekAbbr(minMaxDate)}, is the most recent that has data for all three of the @@ -27,7 +28,8 @@

{/if} -{#if warningType === 2} + +{#if minMaxDate.getTime() < date.value.getTime()}

This date ({formatDateYearDayOfWeekAbbr(date.value)}) does not yet have data for all of the highlighted diff --git a/src/modes/summary/Overview.svelte b/src/modes/summary/Overview.svelte index fc4b4a8a..cc96f3d0 100644 --- a/src/modes/summary/Overview.svelte +++ b/src/modes/summary/Overview.svelte @@ -6,7 +6,7 @@ import MaxDateHint from '../../blocks/MaxDateHint.svelte'; import NoRecentDataWarning from '../../blocks/NoRecentDataWarning.svelte'; import { defaultDeathSensor, defaultCasesSensor, defaultHospitalSensor, metaDataManager } from '../../stores'; - import { onMount, beforeUpdate } from 'svelte'; + import { onMount } from 'svelte'; /** * @type {import("../../stores/params").DateParam} @@ -30,44 +30,30 @@ $: hospitalTrend = trends[1]; $: deathTrend = trends[2]; - let minMaxDate = new Date(); + // Get the latest date that has data for all 3 indicators(CASES, HOSPITAL_ADMISSION and DEATHS). + $: minMaxDate = new Date( + Math.min( + ...[CASES, HOSPITAL_ADMISSION, DEATHS].map((s) => { + // As DEATHS sensor is weekly based, we need to add 6 days to the max date of DEATHS sensor to get the last day of the week. + if (s.name === 'COVID Deaths') { + return s.timeFrame.max.getTime() + 6 * 24 * 60 * 60 * 1000; // add 6 days to the max date of DEATHS sensor to get the last day of the week. + } else { + return s.timeFrame.max; + } + }), + ), + ); onMount(() => { - [CASES, HOSPITAL_ADMISSION].map((s) => { - if (s.timeFrame.max < minMaxDate) { - minMaxDate = s.timeFrame.max; - } - }); let urlSearchParams = new URLSearchParams(window.location.search); if (!urlSearchParams.has('date')) { - // if no date is specified in the URL, default to the latest day before today with data from all 3 highlighted indicators + // if no date is specified in the URL, default to the latest day with data from 3 highlighted indicators (CASES, HOSPITAL_ADMISSION and DEATHS). date.set(minMaxDate); } }); - - // warningType is indicator of which exact warning message should be shown. - // By default, when user opens page with no specified date, the date will be set to the latest date we have data for all 3 indicators. - // In this case, warningType should be set to 1. - // In case selected date is set to future date (date > minMaxDate, where we don't have recent data for all 3 indicators), the warningType will be set to 2 - // which has different warning message. - // In case selected date is set to some date which is < minMaxDate, the warningType will be set to 0 which means that we will not show - // any warning message. - - // warningType should be set in beforeUpdate() method, to guess correct warningType. - - let warningType = 1; - beforeUpdate(() => { - if (date.value > minMaxDate) { - warningType = 2; - } else if (date.value < minMaxDate) { - warningType = 0; - } else { - warningType = 1; - } - }); - +

From 39a8e9a5dbdd0c060cef4061731c05680114f1c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 11:56:22 +0000 Subject: [PATCH 10/13] build(deps-dev): bump braces from 3.0.2 to 3.0.3 Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index ca067315..cd85c329 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4557,12 +4557,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -7249,9 +7249,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -19588,12 +19588,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browser-process-hrtime": { @@ -21581,9 +21581,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" From c3fd8b2fef2d2563b401086114d1114f453cb9ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 13:38:29 +0000 Subject: [PATCH 11/13] build(deps-dev): bump ws from 8.8.0 to 8.17.1 Bumps [ws](https://github.com/websockets/ws) from 8.8.0 to 8.17.1. - [Release notes](https://github.com/websockets/ws/releases) - [Commits](https://github.com/websockets/ws/compare/8.8.0...8.17.1) --- updated-dependencies: - dependency-name: ws dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index cd85c329..483e3c8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16064,16 +16064,16 @@ } }, "node_modules/ws": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.0.tgz", - "integrity": "sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -28111,9 +28111,9 @@ } }, "ws": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.0.tgz", - "integrity": "sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, "requires": {} }, From 04ffbab6e4989787f7108cd39f3d516b3b7441e2 Mon Sep 17 00:00:00 2001 From: george Date: Thu, 5 Dec 2024 14:18:29 -0500 Subject: [PATCH 12/13] dashboard signals update: removed hhs, chng; added nssp and more google-symptoms (#1264) --- src/stores/descriptions.raw.txt | 90 ++++++++++++++++++++------------- src/stores/index.ts | 2 +- 2 files changed, 55 insertions(+), 37 deletions(-) diff --git a/src/stores/descriptions.raw.txt b/src/stores/descriptions.raw.txt index 98bda8f1..c403121f 100644 --- a/src/stores/descriptions.raw.txt +++ b/src/stores/descriptions.raw.txt @@ -21,6 +21,39 @@ SignalTooltip: Google search volume of COVID-related symptom searches about comm Description: Using Google Symptoms Searches, Delphi obtains the average of Google search volumes for searches related to nasal congestion, post nasal drip, rhinorrhea, sinusitis, rhinitis, and common cold in each area. These symptoms have shown positive correlation with reported COVID cases, especially since Omicron was declared a variant of concern by the World Health Organization. Note that the average search volume of these symptoms is not equivalent to the search volume of their union. According to Google, the estimates are not comparable across regions since the values are normalized by population and scaled by region-specific maximum popularity (and for this reason, we omit beehive grids and choropleth maps of this signal on the dashboard). --- +Name: Symptom Searches (Cough, Phlegm, Sputum, Upper respiratory tract infection) on Google +Id: google-symptoms +Signal: s01_smoothed_search +Unit: scaled search volume +UnitShort: +noMaps: true + +SignalTooltip: Google search volume of COVID-related symptom searches about Cough, Phlegm, Sputum, Upper respiratory tract infection + +Description: Using Google Symptoms Searches, Delphi obtains the average of Google search volumes for searches related to cough, phlegm, sputum, and upper respiratory tract infection in each area. These symptoms have shown positive correlation with reported COVID cases. Note that the average search volume of these symptoms is not equivalent to the search volume of their union. According to Google, the estimates are not comparable across regions since the values are normalized by population and scaled by region-specific maximum popularity (and for this reason, we omit beehive grids and choropleth maps of this signal on the dashboard). +--- +Name: Symptom Searches (Fever, Hyperthermia, Chills, Shivering) on Google +Id: google-symptoms +Signal: s03_smoothed_search +Unit: scaled search volume +UnitShort: +noMaps: true + +SignalTooltip: Google search volume of COVID-related symptom searches about Fever, Hyperthermia, Chills, Shivering + +Description: Using Google Symptoms Searches, Delphi obtains the average of Google search volumes for searches related to fever, hyperthermia, chills, shivering, and low grade fever in each area. These symptoms have shown positive correlation with reported COVID cases. Note that the average search volume of these symptoms is not equivalent to the search volume of their union. According to Google, the estimates are not comparable across regions since the values are normalized by population and scaled by region-specific maximum popularity (and for this reason, we omit beehive grids and choropleth maps of this signal on the dashboard). +--- +Name: Symptom Searches (Shortness of breath, Wheeze, Croup, Pneumonia, Asthma, Crackles, Bronchitis) on Google +Id: google-symptoms +Signal: s04_smoothed_search +Unit: scaled search volume +UnitShort: +noMaps: true + +SignalTooltip: Google search volume of COVID-related symptom searches about Shortness of breath, Wheeze, Croup, Pneumonia, Asthma, Crackles, Bronchitis + +Description: Using Google Symptoms Searches, Delphi obtains the average of Google search volumes for searches related to shortness of breath, wheeze, croup, pneumonia, asthma, crackles, acute bronchitis, and bronchitis in each area. These symptoms have shown positive correlation with reported COVID cases. Note that the average search volume of these symptoms is not equivalent to the search volume of their union. According to Google, the estimates are not comparable across regions since the values are normalized by population and scaled by region-specific maximum popularity (and for this reason, we omit beehive grids and choropleth maps of this signal on the dashboard). +--- Name: COVID-Related Doctor Visits Id: doctor-visits Signal: smoothed_adj_cli @@ -32,49 +65,18 @@ SignalTooltip: Percentage of daily doctor visits that are due to COVID-like symp Description: Delphi receives aggregated statistics from health system partners on COVID-related outpatient doctor visits, derived from ICD codes found in insurance claims. Using this data, we estimate the percentage of daily doctor’s visits in each area that are due to COVID-like illness. Note that these estimates are based only on visits by patients whose data is accessible to our partners. --- -Name: Lab-Confirmed Flu in Doctor Visits -Id: chng -Signal: smoothed_adj_outpatient_flu -Unit: per 100 visits - - -SignalTooltip: Percentage of daily doctor visits that are due to lab-confirmed influenza - - -Description: Delphi receives aggregated statistics from Change Healthcare, Inc. on lab-confirmed influenza outpatient doctor visits, derived from ICD codes found in insurance claims. Using this data, we estimate the percentage of daily doctor’s visits in each area that resulted in a diagnosis of influenza. Note that these estimates are based only on visits by patients whose insurance claims are accessible to Change Healthcare. ---- -Name: COVID Hospital Admissions -Id: hhs -Signal: confirmed_admissions_covid_1d_prop_7dav -ExtendedColorScale: true -# override with additional county -Levels: [nation, state, county] -Overrides: - County: - Id: hospital-admissions - Signal: smoothed_adj_covid19_from_claims - - - - -SignalTooltip: Confirmed COVID-19 hospital admissions per 100,000 people - - -Description: This data shows the number of hospital admissions with lab-confirmed COVID-19 each day. At the state level and above, we show data from the Report on Patient Impact and Hospital Capacity published by the US Department of Health & Human Services (HHS). At the county and metro level, we show data from the Community Profile Report published by the Data Strategy Execution Workgroup. ---- -Name: Flu Hospital Admissions -Id: hhs -Signal: confirmed_admissions_influenza_1d_prop_7dav +Name: COVID Hospital Admissions From Claims +Id: hospital-admissions +Signal: smoothed_adj_covid19_from_claims ExtendedColorScale: true -Levels: [nation, state] -SignalTooltip: Confirmed influenza hospital admissions per 100,000 people +SignalTooltip: COVID Hospital Admissions From Claims -Description: This data shows the number of hospital admissions with lab-confirmed influenza each day. We source this data from the Report on Patient Impact and Hospital Capacity published by the US Department of Health & Human Services (HHS). +Description: Estimated percentage of new hospital admissions with COVID-associated diagnoses, based on counts of claims from health system partners, smoothed in time using a Gaussian linear smoother, and adjusted to reduce day-of-week effects. --- Name: COVID Deaths Id: nchs-mortality @@ -85,3 +87,19 @@ SignalTooltip: Newly reported COVID-19 deaths per 100,000 people, based on NCHS Description: This data shows the number of COVID-19 deaths newly reported each week. The signal is based on COVID-19 death counts compiled and made public by [the National Center for Health Statistics](https://www.cdc.gov/nchs/nvss/vsrr/COVID19/index.htm). +--- +Name: COVID Emergency Department Visits (Percent of total ED visits) +Id: nssp +Signal: pct_ed_visits_covid + +SignalTooltip: COVID Emergency Department Visits (Percent of total ED visits) + +Description: Percent of ED visits that had a discharge diagnosis code of COVID-19 +--- +Name: Influenza Emergency Department Visits (Percent of total ED visits) +Id: nssp +Signal: pct_ed_visits_influenza + +SignalTooltip: Influenza Emergency Department Visits (Percent of total ED visits) + +Description: Percent of ED visits that had a discharge diagnosis code of influenza diff --git a/src/stores/index.ts b/src/stores/index.ts index 788c30b3..10141ee3 100644 --- a/src/stores/index.ts +++ b/src/stores/index.ts @@ -112,7 +112,7 @@ export const defaultCasesSensor = derived(sensorList, (sensorList) => { return sensorList.find((d) => d.signal === 'smoothed_adj_cli'); }); export const defaultHospitalSensor = derived(sensorList, (sensorList) => { - return sensorList.find((d) => d.signal === 'confirmed_admissions_covid_1d_prop_7dav'); + return sensorList.find((d) => d.signal === 'smoothed_adj_covid19_from_claims'); }); export const defaultDeathSensor = derived(sensorList, (sensorList) => { return sensorList.find((d) => d.signal === 'deaths_covid_incidence_prop'); From 89fc472fa5e5e262d55ad5b622723a767b56d4d0 Mon Sep 17 00:00:00 2001 From: melange396 Date: Fri, 6 Dec 2024 16:52:39 +0000 Subject: [PATCH 13/13] chore: release v3.2.11 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 483e3c8a..66c38456 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "www-covidcast", - "version": "3.2.10", + "version": "3.2.11", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "www-covidcast", - "version": "3.2.10", + "version": "3.2.11", "license": "MIT", "dependencies": { "uikit": "^3.16.13" diff --git a/package.json b/package.json index 53ac1fbc..50b1817f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "www-covidcast", - "version": "3.2.10", + "version": "3.2.11", "private": true, "license": "MIT", "description": "",