From c7aa67be6cfbdc7864e218c943130a0cc9bf878c Mon Sep 17 00:00:00 2001 From: Ben Hammond Date: Fri, 3 May 2024 12:43:35 -0600 Subject: [PATCH] Refactors Subpop labeling (#3221) --- frontend/playwright-tests/ami.ci.spec.ts | 6 +- .../arv_adherence.nightly.spec.ts | 2 +- .../playwright-tests/bb_ami.nightly.spec.ts | 4 +- .../playwright-tests/hiv_prep.nightly.spec.ts | 4 +- .../medicare_hiv.nightly.spec.ts | 2 +- frontend/src/cards/DisparityBarChartCard.tsx | 4 +- frontend/src/cards/MapCard.tsx | 22 +++- frontend/src/cards/RateTrendsChartCard.tsx | 13 ++- frontend/src/cards/ShareTrendsChartCard.tsx | 8 +- frontend/src/cards/SimpleBarChartCard.tsx | 2 +- frontend/src/cards/TableCard.tsx | 7 +- frontend/src/cards/UnknownsMapCard.tsx | 3 +- frontend/src/cards/ui/GeoContext.test.ts | 28 +++-- frontend/src/cards/ui/GeoContext.tsx | 17 ++- .../src/charts/SimpleHorizontalBarChart.tsx | 47 +++----- .../src/charts/mapHelperFunctions.test.ts | 20 +++- frontend/src/charts/mapHelperFunctions.ts | 7 +- frontend/src/charts/trendsChart/Index.tsx | 30 +++--- frontend/src/charts/utils.test.ts | 38 +++---- frontend/src/charts/utils.ts | 89 +++------------ frontend/src/data/config/MetadataMap.ts | 42 ++++++-- frontend/src/data/config/MetricConfig.ts | 5 +- .../config/MetricConfigBehavioralHealth.ts | 4 + .../data/config/MetricConfigChronicDisease.ts | 5 + .../config/MetricConfigCommunitySafety.ts | 40 ++----- .../data/config/MetricConfigHivCategory.ts | 83 ++++++-------- frontend/src/data/config/MetricConfigPDOH.ts | 18 ++-- frontend/src/data/config/MetricConfigPhrma.ts | 101 ++++++------------ frontend/src/data/config/MetricConfigSDOH.ts | 16 +-- .../providers/GunViolenceYouthProvider.ts | 9 +- frontend/src/data/utils/DatasetTypes.ts | 1 + frontend/src/reports/reportUtils.ts | 4 +- .../src/reports/ui/AnnouncementBanner.tsx | 4 +- 33 files changed, 299 insertions(+), 386 deletions(-) diff --git a/frontend/playwright-tests/ami.ci.spec.ts b/frontend/playwright-tests/ami.ci.spec.ts index a9546f600d..dfc443a617 100644 --- a/frontend/playwright-tests/ami.ci.spec.ts +++ b/frontend/playwright-tests/ami.ci.spec.ts @@ -3,10 +3,10 @@ import { test } from '@playwright/test'; test('PHRMA: Medicare AMI', async ({ page }) => { await page.goto('/exploredata?mls=1.medicare_cardiovascular-3.12&group1=85PLUS&dt1=medicare_ami&demo=age'); await page.locator('#rate-map').getByRole('heading', { name: 'Rates of Acute MI in Florida' }).click(); - await page.getByRole('heading', { name: 'Ages 85+, Medicare' }).click(); + await page.getByRole('heading', { name: 'Medicare Beneficiaries diagnosed with AMI, Ages 85+' }).click(); await page.getByLabel('Legend for rate map').getByRole('img').click(); - await page.locator('li').filter({ hasText: 'Total Medicare Population:' }).click(); - await page.locator('#rate-chart').getByText('Medication Utilization and Disease Rates in the Medicare Population (data from 2020)').click(); + await page.locator('li').filter({ hasText: 'Total population of Medicare Beneficiaries diagnosed with AMI, Ages 18+:' }).click(); + await page.locator('#rate-chart').getByText('Medicare Administrative Data (data from 2020) ').click(); await page.locator('#unknown-demographic-map').getByRole('note').click(); await page.getByRole('button', { name: 'Population vs. distribution' }).click(); await page.getByLabel('Comparison bar chart showing').getByRole('img').click(); diff --git a/frontend/playwright-tests/arv_adherence.nightly.spec.ts b/frontend/playwright-tests/arv_adherence.nightly.spec.ts index 4f271bd57a..8c222f1b9c 100644 --- a/frontend/playwright-tests/arv_adherence.nightly.spec.ts +++ b/frontend/playwright-tests/arv_adherence.nightly.spec.ts @@ -11,7 +11,7 @@ test('ARV Adherence', async ({ page }) => { name: 'Population adherent to antiretrovirals in the United States', }) .click() - await page.locator('#rate-map').getByRole('heading', { name: 'Medicare beneficiaries' }).click(); + await page.locator('#rate-map').getByRole('heading', { name: 'Medicare ARV Beneficiaries, Ages 18+' }).click(); await page.getByText('Demographic', { exact: true }).nth(2).click() await page.getByText('Off').nth(1).click() await page.locator('#menu- div').first().click() diff --git a/frontend/playwright-tests/bb_ami.nightly.spec.ts b/frontend/playwright-tests/bb_ami.nightly.spec.ts index d51ce427cc..d0e447847e 100644 --- a/frontend/playwright-tests/bb_ami.nightly.spec.ts +++ b/frontend/playwright-tests/bb_ami.nightly.spec.ts @@ -7,9 +7,9 @@ test('PHRMA: Beta Blockers after Heart Attack (AMI)', async ({ page }) => { await page.getByText('Medicare eligibility:').click(); await page.getByRole('button', { name: 'Eligible due to disability', exact: true }).click(); await page.locator('#rate-map').getByRole('heading', { name: 'Population Persistent to Beta' }).click(); - await page.getByRole('heading', { name: 'Eligible due to disability,' }).click(); + await page.getByRole('heading', { name: 'Medicare Beta-Blocker Beneficiaries, Eligible due to disability, Ages 18+' }).click(); await page.getByLabel('Legend for rate map').getByRole('img').click(); - await page.locator('li').filter({ hasText: 'Total Medicare Population:' }).click(); + await page.locator('li').filter({ hasText: 'Total population of Medicare Beta-Blocker Beneficiaries, Ages 18+:' }).click(); await page.locator('#rate-chart').getByRole('heading', { name: 'Population Persistent to Beta' }).click(); await page.getByRole('button', { name: 'Unknown demographic map' }).click(); await page.getByText('No unknown values for').click(); diff --git a/frontend/playwright-tests/hiv_prep.nightly.spec.ts b/frontend/playwright-tests/hiv_prep.nightly.spec.ts index 8266ed17ae..1db6ffb03f 100644 --- a/frontend/playwright-tests/hiv_prep.nightly.spec.ts +++ b/frontend/playwright-tests/hiv_prep.nightly.spec.ts @@ -62,7 +62,7 @@ test('HIV PrEP', async ({ page }) => { await page.getByRole('heading', { name: 'Share of total PrEP' }).click() await page .locator('#unknown-demographic-map') - .getByRole('heading', { name: 'Ages 13+' }) + .getByRole('heading', { name: 'Ages 16+' }) .click() await page.getByText('No unknown values for sex').click() await page @@ -98,7 +98,7 @@ test('HIV PrEP', async ({ page }) => { .click() await page .locator('#population-vs-distribution') - .getByRole('heading', { name: 'Ages 13+' }) + .getByRole('heading', { name: 'Ages 16+' }) .click() await page .getByRole('heading', { name: 'Breakdown summary for PrEP' }) diff --git a/frontend/playwright-tests/medicare_hiv.nightly.spec.ts b/frontend/playwright-tests/medicare_hiv.nightly.spec.ts index 47062eaeb6..3217fb2073 100644 --- a/frontend/playwright-tests/medicare_hiv.nightly.spec.ts +++ b/frontend/playwright-tests/medicare_hiv.nightly.spec.ts @@ -12,7 +12,7 @@ test('PHRMA HIV conditions and medication adherence', async ({ page }) => { await page.locator('#rate-chart').getByRole('heading', { name: 'Rates of HIV cases in the United States' }).click() await page.locator('#rate-chart').getByRole('heading', { name: 'Medicare beneficiaries' }).click() - await page.locator('#rate-chart').getByText('Sources: Medication').click() + await page.locator('#rate-chart').getByText('Sources: Medicare Administrative Data').click() await page.locator('#unknown-demographic-map').getByRole('heading', { name: 'Share of total beneficiaries living with HIV with unknown race and ethnicity in the United States' }).click() await page.locator('#unknown-demographic-map').getByRole('heading', { name: 'Medicare beneficiaries' }).click() diff --git a/frontend/src/cards/DisparityBarChartCard.tsx b/frontend/src/cards/DisparityBarChartCard.tsx index dd987b50e4..a9f8bb8817 100644 --- a/frontend/src/cards/DisparityBarChartCard.tsx +++ b/frontend/src/cards/DisparityBarChartCard.tsx @@ -92,14 +92,14 @@ function DisparityBarChartCardWithKey(props: DisparityBarChartCardProps) { const chartTitle = generateChartTitle( /* chartTitle: */ metricConfig?.populationComparisonMetric?.chartTitle ?? - metricConfig.chartTitle, + metricConfig.chartTitle, /* fips: */ props.fips ) const subtitle = generateSubtitle( ALL, props.demographicType, - metricConfig.metricId + props.dataTypeConfig ) const HASH_ID: ScrollableHashId = 'population-vs-distribution' diff --git a/frontend/src/cards/MapCard.tsx b/frontend/src/cards/MapCard.tsx index 03d152c9d5..c5ff540e91 100644 --- a/frontend/src/cards/MapCard.tsx +++ b/frontend/src/cards/MapCard.tsx @@ -42,7 +42,7 @@ import { useGuessPreloadHeight } from '../utils/hooks/useGuessPreloadHeight' import { generateChartTitle, generateSubtitle } from '../charts/utils' import { useLocation } from 'react-router-dom' import { type ScrollableHashId } from '../utils/hooks/useStepObserver' -import { useEffect, useMemo, useState } from 'react' +import { useEffect, useState } from 'react' import { getHighestLowestGroupsByFips } from '../charts/mapHelperFunctions' import { Legend } from '../charts/Legend' import GeoContext, { @@ -73,6 +73,8 @@ import { type MadLibId } from '../utils/MadLibs' import { useIsBreakpointAndUp } from '../utils/hooks/useIsBreakpointAndUp' import HetLinkButton from '../styles/HetComponents/HetLinkButton' import HetDivider from '../styles/HetComponents/HetDivider' +import { dataSourceMetadataMap } from '../data/config/MetadataMap' +import { DatasetId } from '../data/config/DatasetMetadata' const SIZE_OF_HIGHEST_LOWEST_GEOS_RATES_LIST = 5 const HASH_ID: ScrollableHashId = 'rate-map' @@ -207,8 +209,7 @@ function MapCardWithKey(props: MapCardProps) { const initialMetridIds = [metricConfig.metricId] - const subPopulationId = - props.dataTypeConfig.metrics.sub_population_count?.metricId + const subPopulationId = metricConfig?.rateDenominatorMetric?.metricId if (subPopulationId) initialMetridIds.push(subPopulationId) const queries = [ @@ -253,7 +254,7 @@ function MapCardWithKey(props: MapCardProps) { let subtitle = generateSubtitle( activeDemographicGroup, demographicType, - metricId + props.dataTypeConfig ) if (highestLowestGeosMode) subtitle += ` (only ${props.fips.getPluralChildFipsTypeDisplayName() ?? 'places' @@ -278,6 +279,7 @@ function MapCardWithKey(props: MapCardProps) { isCompareCard={props.isCompareCard} > {(queryResponses, metadata, geoData) => { + // contains rows for sub-geos (if viewing US, this data will be STATE level) const childGeoQueryResponse: MetricQueryResponse = queryResponses[0] // contains data rows current level (if viewing US, this data will be US level) @@ -296,8 +298,17 @@ function MapCardWithKey(props: MapCardProps) { const totalPopulationPhrase = getTotalACSPopulationPhrase( acsPopulationQueryResponse.data ) + + let subPopSourceLabel = Object.values(dataSourceMetadataMap).find((metadata) => metadata.dataset_ids.includes(parentGeoQueryResponse.consumedDatasetIds[0] as DatasetId))?.data_source_acronym ?? '' + + // US Congress denominators come from @unitestedstates not CAWP + if (props.dataTypeConfig.dataTypeId === 'women_in_us_congress') { + subPopSourceLabel = '@unitedstates' + } + const subPopulationPhrase = getSubPopulationPhrase( parentGeoQueryResponse.data, + subPopSourceLabel, demographicType, props.dataTypeConfig ) @@ -417,9 +428,10 @@ function MapCardWithKey(props: MapCardProps) { ) const highestLowestGroupsByFips = getHighestLowestGroupsByFips( + props.dataTypeConfig, mapQueryResponse.data, props.demographicType, - metricId + metricId, ) const isPhrmaAdherence = diff --git a/frontend/src/cards/RateTrendsChartCard.tsx b/frontend/src/cards/RateTrendsChartCard.tsx index 0a86a20ceb..85fd90276e 100644 --- a/frontend/src/cards/RateTrendsChartCard.tsx +++ b/frontend/src/cards/RateTrendsChartCard.tsx @@ -14,6 +14,7 @@ import { type DemographicGroup, NON_HISPANIC, AIAN_API, + ALL, } from '../data/utils/Constants' import MissingDataAlert from './ui/MissingDataAlert' import { splitIntoKnownsAndUnknowns } from '../data/utils/datasetutils' @@ -33,6 +34,7 @@ import Hiv2020Alert from './ui/Hiv2020Alert' import ChartTitle from './ChartTitle' import { type ElementHashIdHiddenOnScreenshot } from '../utils/hooks/useDownloadCardImage' import UnknownPctRateGradient from './UnknownPctRateGradient' +import { generateSubtitle } from '../charts/utils' /* minimize layout shift */ const PRELOAD_HEIGHT = 668 @@ -70,7 +72,7 @@ export default function RateTrendsChartCard(props: RateTrendsChartCardProps) { let hasUnknowns = Boolean(metricConfigPctShares) - const isWisqars = props.dataTypeConfig.categoryId === 'community-safety' + const isWisqarsByRace = props.dataTypeConfig.categoryId === 'community-safety' && props.demographicType === 'race_and_ethnicity' const breakdowns = Breakdowns.forFips(props.fips).addBreakdown( props.demographicType, @@ -103,6 +105,12 @@ export default function RateTrendsChartCard(props: RateTrendsChartCardProps) { } in ${props.fips.getSentenceDisplayName()}` } + const subtitle = generateSubtitle( + ALL, + props.demographicType, + props.dataTypeConfig + ) + const isCawp = CAWP_METRICS.includes(metricConfigRates.metricId) const isCawpStateLeg = metricConfigRates.metricId === 'pct_share_of_state_leg' @@ -212,6 +220,7 @@ export default function RateTrendsChartCard(props: RateTrendsChartCardProps) { - {isWisqars && { const normalPopPhrase = getTotalACSPopulationPhrase( /* data */ nationalACSPopData ) - expect(normalPopPhrase).toEqual('Total Population (from 2022 ACS): 328,016,242') + expect(normalPopPhrase).toEqual('Total population: 328,016,242 (from ACS 2022)') }) }) describe('test getSubPopulationPhrase()', () => { const nationalPhrmaData: Row[] = [ { - medicare_population: 41816007, + statins_beneficiaries_estimated_total: 41816007, race_and_ethnicity: 'All', fips: '00', fips_name: 'United States', }, { - medicare_population: 216860, + statins_beneficiaries_estimated_total: 216860, race_and_ethnicity: 'American Indian and Alaska Native (NH)', fips: '00', fips_name: 'United States', }, { - medicare_population: 1209171, + statins_beneficiaries_estimated_total: 1209171, race_and_ethnicity: 'Asian, Native Hawaiian, and Pacific Islander (NH)', fips: '00', fips_name: 'United States', }, { - medicare_population: 4330893, + statins_beneficiaries_estimated_total: 4330893, race_and_ethnicity: 'Black or African American (NH)', fips: '00', fips_name: 'United States', }, { - medicare_population: 2987102, + statins_beneficiaries_estimated_total: 2987102, race_and_ethnicity: 'Hispanic or Latino', fips: '00', fips_name: 'United States', }, { - medicare_population: 332663, + statins_beneficiaries_estimated_total: 332663, race_and_ethnicity: 'Two or more races & Unrepresented race (NH)', fips: '00', fips_name: 'United States', }, { - medicare_population: 32003930, + statins_beneficiaries_estimated_total: 32003930, race_and_ethnicity: 'White (NH)', fips: '00', fips_name: 'United States', }, ] const statinsAdherenceConfig: DataTypeConfig = - METRIC_CONFIG.medicare_cardiovascular[0] + METRIC_CONFIG.medicare_cardiovascular[1] test('phrma medicare national population', () => { + const medicarePopPhrase = getSubPopulationPhrase( /* data */ nationalPhrmaData, + /* subPopulationSourceLabel */ dataSourceMetadataMap.phrma.data_source_acronym, /* demographicType */ 'race_and_ethnicity', /* dataTypeConfig */ statinsAdherenceConfig ) - expect(medicarePopPhrase).toEqual('Total Medicare Population: 41,816,007') + expect(medicarePopPhrase).toEqual('Total population of Medicare Statins Beneficiaries, Ages 18+: 41,816,007 (from CMS)') }) const countyPhrmaData: Row[] = [ @@ -107,10 +111,11 @@ describe('test getSubPopulationPhrase()', () => { test('phrma medicare metric expects extra subpop breadcrumb, but pop data is unavailable', () => { const medicarePopPhrase = getSubPopulationPhrase( /* data */ countyPhrmaData, + /* subPopulationSourceLabel */ dataSourceMetadataMap.phrma.data_source_acronym, /* demographicType */ 'sex', /* dataTypeConfig */ statinsAdherenceConfig ) - expect(medicarePopPhrase).toEqual('Total Medicare Population: unavailable') + expect(medicarePopPhrase).toEqual('Total population of Medicare Statins Beneficiaries, Ages 18+: unavailable (from CMS)') }) const nationalCovidData: Row[] = [ @@ -163,6 +168,7 @@ describe('test getSubPopulationPhrase()', () => { test('covid should not get a subpopulation', () => { const emptyCovidSubPopPhrase = getSubPopulationPhrase( /* data */ nationalCovidData, + /* subPopulationSourceLabel */ dataSourceMetadataMap.cdc_restricted.data_source_acronym, /* demographicType */ 'race_and_ethnicity', /* dataTypeConfig */ covidCasesConfig ) diff --git a/frontend/src/cards/ui/GeoContext.tsx b/frontend/src/cards/ui/GeoContext.tsx index 6e5421022b..714102e593 100644 --- a/frontend/src/cards/ui/GeoContext.tsx +++ b/frontend/src/cards/ui/GeoContext.tsx @@ -7,6 +7,8 @@ import { type MetricQueryResponse } from '../../data/query/MetricQuery' import { type DemographicType } from '../../data/query/Breakdowns' import { ALL } from '../../data/utils/Constants' import { type Row } from '../../data/utils/DatasetTypes' +import { DatasetId, DatasetMetadataMap } from '../../data/config/DatasetMetadata' +import { dataSourceMetadataMap, getDataSourceMetadataByDatasetId } from '../../data/config/MetadataMap' interface GeoContextProps { fips: Fips @@ -49,18 +51,23 @@ const POP_MISSING_VALUE = 'unavailable' export function getTotalACSPopulationPhrase(populationData: Row[]): string { const popAllCount: string = populationData[0].population.toLocaleString() - return `Total Population (from 2022 ACS): ${popAllCount ?? POP_MISSING_VALUE}` + return `Total population: ${popAllCount ?? POP_MISSING_VALUE} (from ACS 2022)` } export function getSubPopulationPhrase( subPopulationData: Row[], + subPopulationSourceLabel: string, demographicType: DemographicType, dataTypeConfig: DataTypeConfig ): string { - const subPopConfig = dataTypeConfig.metrics?.sub_population_count - if (!subPopConfig) return '' + + const subPopConfig = dataTypeConfig.metrics?.pct_rate ?? dataTypeConfig.metrics?.per100k + if (!subPopConfig?.rateDenominatorMetric) return '' const allRow = subPopulationData.find((row) => row[demographicType] === ALL) const popAllCount: string = - allRow?.[subPopConfig.metricId]?.toLocaleString() ?? POP_MISSING_VALUE - return `${subPopConfig.shortLabel}: ${popAllCount}` + allRow?.[subPopConfig.rateDenominatorMetric?.metricId]?.toLocaleString('en-US', { maximumFractionDigits: 0 }) ?? POP_MISSING_VALUE + + const combinedSubPop = [dataTypeConfig.otherSubPopulationLabel, dataTypeConfig.ageSubPopulationLabel].filter(Boolean).join(', ') + + return `Total population${dataTypeConfig.otherSubPopulationLabel ? ' of' : ''}${combinedSubPop ? ' ' + combinedSubPop : ''}: ${popAllCount}${subPopulationSourceLabel ? ' (from ' + subPopulationSourceLabel + ')' : ''}` } diff --git a/frontend/src/charts/SimpleHorizontalBarChart.tsx b/frontend/src/charts/SimpleHorizontalBarChart.tsx index 9676f84ea5..fd8958a5e7 100644 --- a/frontend/src/charts/SimpleHorizontalBarChart.tsx +++ b/frontend/src/charts/SimpleHorizontalBarChart.tsx @@ -14,11 +14,8 @@ import { oneLineLabel, addMetricDisplayColumn, PADDING_FOR_ACTIONS_MENU, - getAltGroupLabel, LABEL_HEIGHT, } from './utils' -import { CAWP_METRICS } from '../data/providers/CawpProvider' -import { HIV_METRICS } from '../data/providers/HivProvider' import { createBarLabel } from './mapHelperFunctions' import { het, ThemeZIndexValues } from '../styles/DesignTokens' @@ -63,12 +60,12 @@ function getSpec( const legends = showLegend ? [ - { - fill: 'variables', - orient: 'top', - padding: 4, - }, - ] + { + fill: 'variables', + orient: 'top', + padding: 4, + }, + ] : [] const onlyZeros = data.every((row) => { @@ -164,9 +161,8 @@ function getSpec( }, baseline: { value: 'middle' }, dx: { - signal: `if(datum.${measure} > ${barLabelBreakpoint}, -5,${ - width > 250 ? '5' : '1' - })`, + signal: `if(datum.${measure} > ${barLabelBreakpoint}, -5,${width > 250 ? '5' : '1' + })`, }, dy: { signal: chartIsSmall ? -15 : 0, @@ -280,23 +276,8 @@ export function SimpleHorizontalBarChart(props: SimpleHorizontalBarChartProps) { const [ref, width] = useResponsiveWidth() - const altLabelMetrics = [...CAWP_METRICS, ...HIV_METRICS] - - // swap race labels if applicable - const dataLabelled = altLabelMetrics.includes(props.metric.metricId) - ? props.data.map((row: Row) => { - const altRow = { ...row } - altRow[props.demographicType] = getAltGroupLabel( - row[props.demographicType], - props.metric.metricId, - props.demographicType - ) - return altRow - }) - : props.data - const dataWithLineBreakDelimiter = addLineBreakDelimitersToField( - dataLabelled, + props.data, props.demographicType ) const [dataWithDisplayCol, barMetricDisplayColumnName] = @@ -316,18 +297,16 @@ export function SimpleHorizontalBarChart(props: SimpleHorizontalBarChartProps) {
{ const phrmaCountColsMap: CountColsMap = { numeratorConfig: { @@ -265,7 +267,21 @@ describe('Test getHighestLowestGroupsByFips()', () => { { fips: '07', sex: 'D', condition_per_100k: 0 }, ] + const testDataTypeConfig: DataTypeConfig = { + dataTypeId: 'some_datatype_id' as DataTypeId, + dataTypeShortLabel: '', + fullDisplayName: '', + metrics: { + }, + dataTableTitle: '', + mapConfig: defaultHigherIsBetterMapConfig, + categoryId: 'covid', + subPopulationPrefixMap: { + } + } + const highLowSex = getHighestLowestGroupsByFips( + /* dataTypeConfig */testDataTypeConfig, /* fullData */ normalData, /* demographicType */ 'sex', /* metricId */ 'condition_per_100k' as MetricId diff --git a/frontend/src/charts/mapHelperFunctions.ts b/frontend/src/charts/mapHelperFunctions.ts index d4f495e8d5..6a838b9059 100644 --- a/frontend/src/charts/mapHelperFunctions.ts +++ b/frontend/src/charts/mapHelperFunctions.ts @@ -1,4 +1,4 @@ -import { isPctType, type MetricId, type MetricType } from '../data/config/MetricConfig' +import { DataTypeConfig, isPctType, type MetricId, type MetricType } from '../data/config/MetricConfig' import { type Fips } from '../data/utils/Fips' import { type FieldRange, type Row } from '../data/utils/DatasetTypes' import { generateSubtitle } from './utils' @@ -362,6 +362,7 @@ export function setupColorScale( } export function getHighestLowestGroupsByFips( + dataTypeConfig: DataTypeConfig, fullData?: Row[], demographicType?: DemographicType, metricId?: MetricId @@ -397,12 +398,12 @@ export function getHighestLowestGroupsByFips( ascendingGroups.length - 1 ], /* demographicType: */ demographicType, - metricId + dataTypeConfig ), lowest: generateSubtitle( /* activeDemographicGroup: */ ascendingGroups[0], /* demographicType: */ demographicType, - metricId + dataTypeConfig ), } // TIE OVERRIDES diff --git a/frontend/src/charts/trendsChart/Index.tsx b/frontend/src/charts/trendsChart/Index.tsx index 7d738a75df..8f9f13ab06 100644 --- a/frontend/src/charts/trendsChart/Index.tsx +++ b/frontend/src/charts/trendsChart/Index.tsx @@ -46,6 +46,7 @@ export interface TrendsChartProps { unknown: UnknownData axisConfig: AxisConfig chartTitle: string + chartSubTitle: string demographicType: DemographicType setSelectedTableGroups: (selectedTableGroups: any[]) => void isCompareCard: boolean @@ -60,6 +61,7 @@ export function TrendsChart({ unknown, axisConfig, chartTitle, + chartSubTitle, demographicType, setSelectedTableGroups, isCompareCard, @@ -234,9 +236,8 @@ export function TrendsChart({ [dates, xScale] ) - const chartTitleId = `chart-title-label-${axisConfig.type}-${ - isCompareCard ? '2' : '1' - }` + const chartTitleId = `chart-title-label-${axisConfig.type}-${isCompareCard ? '2' : '1' + }` return ( // Container @@ -244,7 +245,7 @@ export function TrendsChart({
{isSm && ( // Render Chart Title DESKTOP ABOVE LEGEND - + )} {/* Filter */} {data && ( @@ -257,14 +258,13 @@ export function TrendsChart({ isSkinny={isSkinny} chartWidth={width} demographicType={demographicType} - legendId={`legend-filter-label-${axisConfig.type}-${ - isCompareCard ? '2' : '1' - }`} + legendId={`legend-filter-label-${axisConfig.type}-${isCompareCard ? '2' : '1' + }`} /> )} {!isSm && ( // Render Chart Title MOBILE BELOW LEGEND - + )}
{/* Tooltip */} @@ -272,9 +272,8 @@ export function TrendsChart({ className='pointer-events-none absolute transition-transform duration-300 ease-linear' // Position tooltip to the right of the cursor until until cursor is half way across chart, then to left style={{ - transform: `translate(${xScale(new Date(hoveredDate ?? ''))}px, ${ - MARGIN.top - }px)`, + transform: `translate(${xScale(new Date(hoveredDate ?? ''))}px, ${MARGIN.top + }px)`, opacity: hoveredDate ? 1 : 0, }} > @@ -282,11 +281,10 @@ export function TrendsChart({ className='transition-transform duration-300 ease-linear' ref={toolTipRef} style={{ - transform: `translateX(${ - xScale(new Date(hoveredDate ?? '')) > width / 2 - ? -tooltipWidth - 10 - : 10 - }px)`, + transform: `translateX(${xScale(new Date(hoveredDate ?? '')) > width / 2 + ? -tooltipWidth - 10 + : 10 + }px)`, }} > { test('Chart title (standard state)', () => { @@ -24,52 +28,34 @@ describe('Tests generateChartTitle()', () => { }) test('preventable hosp. subtitle', () => { + const subTitle = generateSubtitle( 'Male', 'sex', - 'preventable_hospitalizations_per_100k' + PREVENTABLE_HOSP_METRICS[0] ) - expect(subTitle).toEqual('Male, Medicare beneficiaries') + expect(subTitle).toEqual('Medicare beneficiaries, Male') }) test('PHRMA subtitle', () => { const subTitle = generateSubtitle( 'Male', 'sex', - 'statins_adherence_pct_rate' + PHRMA_CARDIOVASCULAR_METRICS[0] ) - expect(subTitle).toEqual('Male, Medicare beneficiaries') + expect(subTitle).toEqual('Medicare Beta-Blocker Beneficiaries, Male, Ages 18+') }) test('Standard subtitle', () => { - const subTitle = generateSubtitle('Male', 'sex', 'uninsured_pct_rate') + const subTitle = generateSubtitle('Male', 'sex', UNINSURANCE_METRICS[0]) expect(subTitle).toEqual('Male') }) }) describe('Tests generateSubtitle()', () => { test('HIV subtitle', () => { - const subTitle = generateSubtitle('Male', 'sex', 'hiv_deaths_per_100k') + const subTitle = generateSubtitle('Male', 'sex', HIV_DISEASE_METRICS[2]) expect(subTitle).toEqual('Male, Ages 13+') }) }) -describe('Tests getAltGroupLabel()', () => { - test('All by age prep', () => { - const groupLabel = getAltGroupLabel( - 'All', - 'pct_share_of_women_us_congress', - 'race_and_ethnicity' - ) - expect(groupLabel).toEqual('All women') - }) - test('All by age prep', () => { - const groupLabel = getAltGroupLabel('All', 'hiv_prep_coverage', 'age') - expect(groupLabel).toEqual('All (16+)') - }) - - test('Standard group pass through', () => { - const groupLabel = getAltGroupLabel('Some group', 'prison_pct_share', 'sex') - expect(groupLabel).toEqual('Some group') - }) -}) diff --git a/frontend/src/charts/utils.ts b/frontend/src/charts/utils.ts index 9e6862b393..0647b619d3 100644 --- a/frontend/src/charts/utils.ts +++ b/frontend/src/charts/utils.ts @@ -1,4 +1,5 @@ import { + DataTypeConfig, formatFieldValue, type MetricConfig, type MetricId, @@ -13,7 +14,7 @@ import { type Fips } from '../data/utils/Fips' import { CAWP_METRICS, getWomenRaceLabel } from '../data/providers/CawpProvider' import { HIV_METRICS } from '../data/providers/HivProvider' import { PHRMA_METRICS } from '../data/providers/PhrmaProvider' -import { GUN_DEATH_YOUTH_METRIC_IDS, GUN_VIOLENCE_YOUTH_METRICS } from '../data/providers/GunViolenceYouthProvider' +import { GUN_DEATHS_CHILDREN_METRIC_IDS, GUN_VIOLENCE_YOUTH_METRICS } from '../data/providers/GunViolenceYouthProvider' export type VisualizationType = 'chart' | 'map' | 'table' export const PADDING_FOR_ACTIONS_MENU = 30 @@ -103,91 +104,31 @@ export function generateChartTitle( export function generateSubtitle( activeDemographicGroup: DemographicGroup, demographicType: DemographicType, - metricId: MetricId + dataTypeConfig: DataTypeConfig ) { - let subtitle = '' - + // active group label, if any + let activeGroupLabel = '' if (activeDemographicGroup === ALL) { - subtitle = '' + activeGroupLabel = '' } else if (demographicType === AGE) { - subtitle = `Ages ${activeDemographicGroup}` + activeGroupLabel = `Ages ${activeDemographicGroup}` } else if (demographicType === 'urbanicity') { - subtitle = `Living in ${activeDemographicGroup} areas` - - } else { - subtitle = activeDemographicGroup + activeGroupLabel = `Living in ${activeDemographicGroup} areas` } - - if (HIV_METRICS.includes(metricId)) { - let ageTitle = '' - if (metricId === 'hiv_prep_coverage') { - ageTitle = 'Ages 16+' - } else if (metricId === 'hiv_stigma_index') { - ageTitle = 'Ages 18+' - } else { - ageTitle = 'Ages 13+' - } - - if (subtitle === '') { - subtitle = ageTitle - } else if (demographicType !== AGE) { - subtitle += `, ${ageTitle}` - } + else { + activeGroupLabel = activeDemographicGroup } - if (GUN_VIOLENCE_YOUTH_METRICS.includes(metricId)) { - let youthTitle = 'Ages 18-25' - if (GUN_DEATH_YOUTH_METRIC_IDS.includes(metricId)) { - youthTitle = 'Ages 0-17' - } - if (subtitle === '') { - subtitle = youthTitle - } else { - subtitle += `, ${youthTitle}` - } - } + // age and any other subpopulations, if any + const ageSubPop = demographicType === AGE && activeDemographicGroup !== ALL ? '' : dataTypeConfig?.ageSubPopulationLabel ?? '' + const otherSubPop = dataTypeConfig?.otherSubPopulationLabel ?? '' - const medicareMetricIds: MetricId[] = [ - ...PHRMA_METRICS, - 'preventable_hospitalizations_per_100k', - ] - if (medicareMetricIds.includes(metricId)) { - const beneficiariesTitle = 'Medicare beneficiaries' - if (subtitle === '') { - subtitle = beneficiariesTitle - } else { - subtitle += `, ${beneficiariesTitle}` - } - } + // combine as needed to create specific population subtitle + const subtitle = [otherSubPop, activeGroupLabel, ageSubPop].filter(Boolean).join(', ') return subtitle } -export function getAltGroupLabel( - group: DemographicGroup, - metricId: MetricId, - demographicType: DemographicType -) { - if (CAWP_METRICS.includes(metricId)) { - return getWomenRaceLabel(group) - } - if (GUN_DEATH_YOUTH_METRIC_IDS.includes(metricId)) { - return `${group} (0-25)` - } - if (group === ALL && demographicType === AGE) { - if (metricId.includes('prep')) { - return `${group} (16+)` - } - if (metricId.includes('stigma')) { - return `${group} (18+)` - } - if (metricId.includes('hiv')) { - return `${group} (13+)` - } - } - return group -} - export function removeLastS(inputString: string) { // Use a regular expression to replace the last "s" with an empty string return inputString.replace(/s$/, '') diff --git a/frontend/src/data/config/MetadataMap.ts b/frontend/src/data/config/MetadataMap.ts index 46eac260f6..426a78046e 100644 --- a/frontend/src/data/config/MetadataMap.ts +++ b/frontend/src/data/config/MetadataMap.ts @@ -1,5 +1,6 @@ import { type DataSourceMetadata } from '../utils/DatasetTypes' import { SHOW_GUN_VIOLENCE } from '../providers/GunViolenceProvider' +import { DatasetId } from './DatasetMetadata' export const GEOGRAPHIES_DATASET_ID = 'geographies' @@ -32,6 +33,7 @@ export const dataSourceMetadataMap: Record = { cdc_restricted: { id: 'cdc_restricted', data_source_name: 'CDC Case Surveillance Restricted Access Detailed Data', + data_source_acronym: 'CDC', data_source_pretty_site_name: 'data.cdc.gov', data_source_link: 'https://data.cdc.gov/Case-Surveillance/COVID-19-Case-Surveillance-Restricted-Access-Detai/mbd7-r32t', @@ -66,6 +68,7 @@ export const dataSourceMetadataMap: Record = { acs: { id: 'acs', data_source_name: 'American Community Survey (ACS) 5-year estimates', + data_source_acronym: 'ACS', data_source_pretty_site_name: 'census.gov', data_source_link: 'https://www.census.gov/data/developers/data-sets/acs-5year.html', @@ -109,7 +112,8 @@ export const dataSourceMetadataMap: Record = { }, decia_2010_territory_population: { id: 'decia_2010_territory_population', - data_source_name: 'Census 2010 Decennial Island Areas', + data_source_name: 'Census 2010 Decennial Island Areas (DECIA)', + data_source_acronym: 'DECIA', data_source_pretty_site_name: 'census.gov', data_source_link: 'https://www.census.gov/data/datasets/2010/dec/virgin-islands.html', @@ -128,7 +132,8 @@ export const dataSourceMetadataMap: Record = { }, decia_2020_territory_population: { id: 'decia_2020_territory_population', - data_source_name: 'Census 2020 Decennial Island Areas', + data_source_name: 'Census 2020 Decennial Island Areas (DECIA)', + data_source_acronym: 'DECIA', data_source_pretty_site_name: 'census.gov', data_source_link: 'https://www.census.gov/data/tables/2020/dec/2020-us-virgin-islands.html', @@ -151,6 +156,7 @@ export const dataSourceMetadataMap: Record = { census_pop_estimates: { id: 'census_pop_estimates', data_source_name: 'County Population by Characteristics: 2010-2019', + data_source_acronym: 'Census', data_source_pretty_site_name: 'census.gov', data_source_link: 'https://www.census.gov/data/tables/time-series/demo/popest/2010s-counties-detail.html', @@ -166,6 +172,7 @@ export const dataSourceMetadataMap: Record = { cdc_svi_county: { id: 'cdc_svi_county', data_source_name: 'CDC SVI County Rankings', + data_source_acronym: 'CDC', data_source_pretty_site_name: 'atsdr.cdc.gov', data_source_link: 'https://www.atsdr.cdc.gov/placeandhealth/svi/documentation/SVI_documentation_2018.html', @@ -181,6 +188,7 @@ export const dataSourceMetadataMap: Record = { cdc_vaccination_county: { id: 'cdc_vaccination_county', data_source_name: 'CDC COVID-19 Vaccinations in the United States, County', + data_source_acronym: 'CDC', data_source_pretty_site_name: 'data.cdc.gov', data_source_link: 'https://data.cdc.gov/Vaccinations/COVID-19-Vaccinations-in-the-United-States-County/8xkx-amqh', @@ -197,6 +205,7 @@ export const dataSourceMetadataMap: Record = { id: 'cdc_vaccination_national', data_source_name: 'CDC COVID-19 Vaccination Demographics in the United States, National', + data_source_acronym: 'CDC', data_source_pretty_site_name: 'data.cdc.gov', data_source_link: 'https://data.cdc.gov/Vaccinations/COVID-19-Vaccination-Demographics-in-the-United-St/km4m-vcsb', @@ -216,6 +225,7 @@ export const dataSourceMetadataMap: Record = { cdc_atlas: { id: 'cdc_atlas', data_source_name: 'CDC NCHHSTP AtlasPlus', + data_source_acronym: 'CDC', data_source_pretty_site_name: 'cdc.gov', data_source_link: 'https://www.cdc.gov/nchhstp/atlas/index.htm', geographic_level: 'National, State, County', @@ -254,7 +264,8 @@ export const dataSourceMetadataMap: Record = { }, kff_vaccination: { id: 'kff_vaccination', - data_source_name: 'Kaiser Family Foundation COVID-19 Indicators', + data_source_name: 'Kaiser Family Foundation (KFF) COVID-19 Indicators', + data_source_acronym: 'KFF', data_source_pretty_site_name: 'kff.org', data_source_link: 'https://www.kff.org/state-category/covid-19/', geographic_level: 'State', @@ -271,7 +282,8 @@ export const dataSourceMetadataMap: Record = { }, ahr: { id: 'ahr', - data_source_name: "America's Health Rankings", + data_source_name: "America's Health Rankings (AHR)", + data_source_acronym: 'AHR', data_source_pretty_site_name: 'americashealthrankings.org', data_source_link: 'https://www.americashealthrankings.org/explore/measures/CHC', @@ -294,6 +306,7 @@ export const dataSourceMetadataMap: Record = { bjs: { id: 'bjs', data_source_name: 'Bureau of Justice Statistics (BJS)', + data_source_acronym: 'BJS', data_source_pretty_site_name: 'bjs.ojp.gov', data_source_link: 'https://bjs.ojp.gov', geographic_level: 'National, State', @@ -315,6 +328,7 @@ export const dataSourceMetadataMap: Record = { vera: { id: 'vera', data_source_name: 'Vera Institute of Justice', + data_source_acronym: 'Vera', data_source_pretty_site_name: 'vera.org', data_source_link: 'https://www.vera.org/projects/incarceration-trends', geographic_level: 'County', @@ -333,6 +347,7 @@ export const dataSourceMetadataMap: Record = { cawp: { id: 'cawp', data_source_name: 'Center for American Women in Politics (CAWP)', + data_source_acronym: 'CAWP', data_source_pretty_site_name: 'cawpdata.rutgers.edu', data_source_link: 'https://cawpdata.rutgers.edu/', geographic_level: 'National, State', @@ -354,6 +369,7 @@ export const dataSourceMetadataMap: Record = { the_unitedstates_project: { id: 'the_unitedstates_project', data_source_name: 'The @unitedstates Project', + data_source_acronym: '@unitedstates', data_source_pretty_site_name: 'theunitedstates.io', data_source_link: 'https://github.com/unitedstates/congress-legislators', geographic_level: 'National, State', @@ -368,6 +384,7 @@ export const dataSourceMetadataMap: Record = { geo_context: { id: 'geo_context', data_source_name: 'Geographic Context - Composite Dataset', + data_source_acronym: 'CDC, ACS', data_source_pretty_site_name: 'github.com/SatcherInstitute/health-equity-tracker', data_source_link: @@ -388,7 +405,8 @@ export const dataSourceMetadataMap: Record = { phrma: { id: 'phrma', data_source_name: - 'Medication Utilization and Disease Rates in the Medicare Population', + 'Medicare Administrative Data', + data_source_acronym: 'CMS', data_source_pretty_site_name: 'cms.gov', data_source_link: 'https://www.cms.gov/research-statistics-data-and-systems/cms-information-technology/accesstodataapplication', @@ -423,7 +441,8 @@ export const dataSourceMetadataMap: Record = { }, covid_tracking_project: { id: 'covid_tracking_project', - data_source_name: 'Covid Tracking Project’s Racial Data Tracker', + data_source_name: 'Covid Tracking Project’s (CTP) Racial Data Tracker', + data_source_acronym: 'CTP', data_source_pretty_site_name: 'covidtracking.com', data_source_link: 'https://covidtracking.com/race', geographic_level: 'State', @@ -443,6 +462,7 @@ export const dataSourceMetadataMap: Record = { geographies_source: { id: 'geographies_source', data_source_name: 'Map Data', + data_source_acronym: 'TopoJSON', data_source_pretty_site_name: 'github.com/SatcherInstitute/health-equity-tracker', data_source_link: 'https://github.com/topojson/us-atlas#counties-10m.json', @@ -458,7 +478,8 @@ export const dataSourceMetadataMap: Record = { cdc_wisqars_data: { hideFromUser: !SHOW_GUN_VIOLENCE, id: 'cdc_wisqars_data', - data_source_name: `CDC's WISQARS™ Web-based Injury Statistics Query and Reporting System`, + data_source_name: `CDC WISQARS`, + data_source_acronym: 'CDC', data_source_pretty_site_name: 'cdc.gov/injury/wisqars', data_source_link: 'https://www.cdc.gov/injury/wisqars/index.html', geographic_level: 'National, State', @@ -496,3 +517,10 @@ export const dataSourceMetadataMap: Record = { time_period_range: '2001 - current', }, } + + +export function getDataSourceMetadataByDatasetId(id: DatasetId): DataSourceMetadata | undefined { + return Object.values(dataSourceMetadataMap).find((metadata) => { + return metadata.dataset_ids.includes(id) + }) +} \ No newline at end of file diff --git a/frontend/src/data/config/MetricConfig.ts b/frontend/src/data/config/MetricConfig.ts index ae076cbbe0..7b8e3a889d 100644 --- a/frontend/src/data/config/MetricConfig.ts +++ b/frontend/src/data/config/MetricConfig.ts @@ -75,6 +75,7 @@ import { GUN_VIOLENCE_METRICS, GUN_VIOLENCE_YOUTH_METRICS } from './MetricConfigCommunitySafety' +import { DemographicType } from '../query/Breakdowns' const dropdownVarIds = [ ...CHRONIC_DISEASE_CATEGORY_DROPDOWNIDS, @@ -175,6 +176,7 @@ export interface InfoWithCitations { citations?: Citation[] } + export interface DataTypeConfig { dataTypeId: DataTypeId dataTypeShortLabel: string @@ -192,12 +194,13 @@ export interface DataTypeConfig { index?: MetricConfig ratio?: MetricConfig age_adjusted_ratio?: MetricConfig - sub_population_count?: MetricConfig } surveyCollectedData?: boolean dataTableTitle: string mapConfig: MapConfig categoryId: CategoryTypeId + ageSubPopulationLabel?: string + otherSubPopulationLabel?: string } export const SYMBOL_TYPE_LOOKUP: Record = { diff --git a/frontend/src/data/config/MetricConfigBehavioralHealth.ts b/frontend/src/data/config/MetricConfigBehavioralHealth.ts index ebafa96253..a8459eeebc 100644 --- a/frontend/src/data/config/MetricConfigBehavioralHealth.ts +++ b/frontend/src/data/config/MetricConfigBehavioralHealth.ts @@ -52,6 +52,7 @@ export const DEPRESSION_METRICS: DataTypeConfig[] = [ }, surveyCollectedData: true, dataTableTitle: 'Breakdown summary for depression', + ageSubPopulationLabel: 'Ages 18+', metrics: { pct_share: { chartTitle: 'Share of total adult depression cases', @@ -102,6 +103,7 @@ export const EXCESSIVE_DRINKING_METRICS: DataTypeConfig[] = [ }, surveyCollectedData: true, dataTableTitle: 'Breakdown summary for excessive drinking cases', + ageSubPopulationLabel: 'Ages 18+', metrics: { pct_share: { chartTitle: 'Share of all adult excessive drinking cases', @@ -154,6 +156,7 @@ export const SUBSTANCE_MISUSE_METRICS: DataTypeConfig[] = [ surveyCollectedData: true, dataTableTitle: 'Breakdown summary for opioid and other non-medical drug use', + ageSubPopulationLabel: 'Ages 18+', metrics: { pct_share: { chartTitle: 'Share of total adult non-medical drug use', @@ -204,6 +207,7 @@ export const FREQUENT_MENTAL_DISTRESS_METRICS: DataTypeConfig[] = [ }, surveyCollectedData: true, dataTableTitle: 'Breakdown summary for frequent mental distress', + ageSubPopulationLabel: 'Ages 18+', metrics: { pct_share: { chartTitle: 'Share of all adult frequent mental distress cases', diff --git a/frontend/src/data/config/MetricConfigChronicDisease.ts b/frontend/src/data/config/MetricConfigChronicDisease.ts index 7df5a73263..b336c041d8 100644 --- a/frontend/src/data/config/MetricConfigChronicDisease.ts +++ b/frontend/src/data/config/MetricConfigChronicDisease.ts @@ -52,6 +52,7 @@ export const ASTHMA_METRICS: DataTypeConfig[] = [ }, ], }, + ageSubPopulationLabel: 'Ages 18+', metrics: { per100k: { metricId: 'asthma_per_100k', @@ -101,6 +102,7 @@ export const CARDIOVASCULAR_DISEASES_METRICS: DataTypeConfig[] = [ }, ], }, + ageSubPopulationLabel: 'Ages 18+', metrics: { per100k: { metricId: 'cardiovascular_diseases_per_100k', @@ -152,6 +154,7 @@ export const CHRONIC_KIDNEY_DISEASE_METRICS: DataTypeConfig[] = [ ], }, dataTableTitle: 'Breakdown summary for cases of chronic kidney disease', + ageSubPopulationLabel: 'Ages 18+', metrics: { per100k: { metricId: 'chronic_kidney_disease_per_100k', @@ -195,6 +198,7 @@ export const DIABETES_METRICS: DataTypeConfig[] = [ }, surveyCollectedData: true, dataTableTitle: 'Breakdown summary for diabetes', + ageSubPopulationLabel: 'Ages 18+', metrics: { pct_share: { chartTitle: 'Share of total adult diabetes cases', @@ -244,6 +248,7 @@ export const COPD_METRICS: DataTypeConfig[] = [ }, surveyCollectedData: true, dataTableTitle: 'Breakdown summary for COPD', + ageSubPopulationLabel: 'Ages 18+', metrics: { pct_share: { chartTitle: 'Share of total adult COPD cases', diff --git a/frontend/src/data/config/MetricConfigCommunitySafety.ts b/frontend/src/data/config/MetricConfigCommunitySafety.ts index 7c542a76ca..fa4abfd902 100644 --- a/frontend/src/data/config/MetricConfigCommunitySafety.ts +++ b/frontend/src/data/config/MetricConfigCommunitySafety.ts @@ -5,7 +5,7 @@ import { DataTypeConfig } from './MetricConfig' import { populationPctShortLabel, populationPctTitle } from './MetricConfigUtils' -console.log('Gun violence preview enabled') +SHOW_GUN_VIOLENCE && console.log('Gun violence preview enabled') export const COMMUNITY_SAFETY_DROPDOWNIDS = ['gun_violence', 'gun_violence_youth', 'gun_deaths_black_men'] as const export type CommunitySafetyDataTypeId = @@ -62,12 +62,7 @@ export const GUN_VIOLENCE_METRICS: DataTypeConfig[] = [ fullDisplayNameInline: 'gun homicides', mapConfig: defaultHigherIsWorseMapConfig, metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'fatal_population', - shortLabel: 'Total Population for Gun Homicide Rates', - type: 'count', - }, + pct_relative_inequity: { chartTitle: 'Historical relative inequity of gun homicides', @@ -128,12 +123,7 @@ export const GUN_VIOLENCE_METRICS: DataTypeConfig[] = [ fullDisplayNameInline: 'gun suicides', mapConfig: defaultHigherIsWorseMapConfig, metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'fatal_population', - shortLabel: 'Total Population for Gun Suicide Rates', - type: 'count', - }, + pct_relative_inequity: { chartTitle: 'Historical relative inequity of gun suicides', @@ -196,13 +186,10 @@ export const GUN_VIOLENCE_YOUTH_METRICS: DataTypeConfig[] = [ fullDisplayName: 'Gun deaths (children)', fullDisplayNameInline: 'gun deaths (children)', mapConfig: youthHigherIsWorseMapConfig, + ageSubPopulationLabel: 'Ages 0-17', + metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'gun_deaths_youth_population', - shortLabel: 'Total Population for Gun Deaths (Children)', - type: 'count', - }, + pct_relative_inequity: { chartTitle: 'Historical relative inequity of gun deaths among children', metricId: 'gun_deaths_youth_pct_relative_inequity', @@ -259,13 +246,8 @@ export const GUN_VIOLENCE_YOUTH_METRICS: DataTypeConfig[] = [ fullDisplayName: 'Gun deaths (young adults)', fullDisplayNameInline: 'gun deaths (young adults)', mapConfig: youthHigherIsWorseMapConfig, + ageSubPopulationLabel: 'Ages 18-25', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'gun_deaths_young_adults_population', - shortLabel: 'Total Population for Gun Deaths (Young Adults)', - type: 'count', - }, pct_relative_inequity: { chartTitle: 'Historical relative inequity of gun deaths among young adults', metricId: 'gun_deaths_young_adults_pct_relative_inequity', @@ -323,13 +305,9 @@ export const GUN_DEATHS_BLACK_MEN_METRICS: DataTypeConfig[] = [ fullDisplayName: 'Gun homicides (Black Men)', fullDisplayNameInline: 'gun homicides (Black Men)', mapConfig: menHigherIsWorseMapConfig, + otherSubPopulationLabel: 'Black Men', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'gun_homicides_black_men_population_estimated_total', - shortLabel: 'Total Population (Black Men)', - type: 'count', - }, + pct_relative_inequity: { chartTitle: 'Historical relative inequity of gun homicides among Black men', metricId: 'gun_homicides_black_men_pct_relative_inequity', diff --git a/frontend/src/data/config/MetricConfigHivCategory.ts b/frontend/src/data/config/MetricConfigHivCategory.ts index 78464b47d0..6b95e7250b 100644 --- a/frontend/src/data/config/MetricConfigHivCategory.ts +++ b/frontend/src/data/config/MetricConfigHivCategory.ts @@ -95,13 +95,11 @@ export const HIV_CARE_METRICS: DataTypeConfig[] = [ text: 'Access to quality HIV care is essential for ensuring that people living with HIV can live long and healthy lives. However, not everyone with HIV has access to quality care. Studying HIV care in regard to health equity can help us to understand why these disparities exist and how to improve access to quality care for all people living with HIV.', }, dataTableTitle: 'Breakdown summary for linkage to HIV care', + ageSubPopulationLabel: + 'Ages 13+', + metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'hiv_care_population', - shortLabel: 'Total Population (Ages 13+ with HIV Diagnoses)', - type: 'count', - }, + pct_share: { chartTitle: 'Share of total linkage to HIV care', metricId: 'hiv_care_pct_share', @@ -163,13 +161,11 @@ export const HIV_DISEASE_METRICS: DataTypeConfig[] = [ text: 'HIV is a serious and chronic disease that can be fatal if not treated. However, HIV is now a manageable condition thanks to effective antiretroviral therapy. Studying HIV in regard to health equity can help us to understand why certain populations are more likely to be diagnosed with HIV and why they are less likely to receive effective treatment.', }, dataTableTitle: 'Breakdown summary for HIV prevalence', + ageSubPopulationLabel: + 'Ages 13+', + metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'hiv_population', - shortLabel: 'Total Population (Ages 13+)', - type: 'count', - }, + pct_share: { chartTitle: 'Share of total HIV prevalence', metricId: 'hiv_prevalence_pct_share', @@ -227,13 +223,11 @@ export const HIV_DISEASE_METRICS: DataTypeConfig[] = [ text: 'HIV is a serious and chronic disease that can be fatal if not treated. However, HIV is now a manageable condition thanks to effective antiretroviral therapy. Studying HIV in regard to health equity can help us to understand why certain populations are more likely to be diagnosed with HIV and why they are less likely to receive effective treatment.', }, dataTableTitle: 'Breakdown summary for HIV diagnoses', + ageSubPopulationLabel: + 'Ages 13+', + metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'hiv_population', - shortLabel: 'Total Population (Ages 13+)', - type: 'count', - }, + pct_share: { chartTitle: 'Share of total HIV diagnoses', metricId: 'hiv_diagnoses_pct_share', @@ -290,13 +284,11 @@ export const HIV_DISEASE_METRICS: DataTypeConfig[] = [ text: 'HIV is a serious and chronic disease that can be fatal if not treated. However, HIV is now a manageable condition thanks to effective antiretroviral therapy. Studying HIV in regard to health equity can help us to understand why certain populations are more likely to be diagnosed with HIV and why they are less likely to receive effective treatment.', }, dataTableTitle: 'Breakdown summary for HIV deaths', + ageSubPopulationLabel: + 'Ages 13+', + metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'hiv_population', - shortLabel: 'Total Population (Ages 13+)', - type: 'count', - }, + pct_share: { chartTitle: 'Share of total HIV deaths', metricId: 'hiv_deaths_pct_share', @@ -365,6 +357,8 @@ export const HIV_STIGMA_METRICS: DataTypeConfig[] = [ text: 'HIV stigma often intersects with other forms of stigma and discrimination, such as racism, homophobia, and sexism. Studying HIV stigma can shed light on broader issues of social injustice and inequality.', }, dataTableTitle: 'Breakdown summary for HIV stigma', + ageSubPopulationLabel: 'Ages 18+', + metrics: { index: { @@ -372,7 +366,7 @@ export const HIV_STIGMA_METRICS: DataTypeConfig[] = [ chartTitle: 'HIV stigma', trendsCardTitleName: 'Rates of HIV stigma over time', columnTitleHeader: 'HIV stigma', - shortLabel: 'stigma score out of 100', + shortLabel: ' score out of 100', type: 'index', }, pct_share: { @@ -406,13 +400,11 @@ export const HIV_BW_DISEASE_METRICS: DataTypeConfig[] = [ text: 'Black women are disproportionately affected by HIV. In fact, Black women are six times more likely to be diagnosed with HIV than white women. Studying HIV among Black women in regard to health equity can help us to understand why this disparity exists and how to address it.', }, dataTableTitle: 'Breakdown summary for HIV prevalence for Black (NH) women', + + ageSubPopulationLabel: 'Ages 13+', + otherSubPopulationLabel: 'Black Women', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'black_women_population_count', - shortLabel: 'Total Population (Black Women, Ages 13+)', - type: 'count', - }, + pct_share: { chartTitle: 'Share of total HIV prevalence for Black (NH) women', metricId: 'hiv_prevalence_black_women_pct_share', @@ -421,6 +413,7 @@ export const HIV_BW_DISEASE_METRICS: DataTypeConfig[] = [ 'Inequitable share of HIV prevalence for Black (NH) women over time', shortLabel: '% of HIV prevalence (Black women)', type: 'pct_share', + populationComparisonMetric: { chartTitle: 'Population vs. distribution of total HIV prevalence for Black (NH) women', @@ -474,13 +467,11 @@ export const HIV_BW_DISEASE_METRICS: DataTypeConfig[] = [ }, dataTableTitle: 'Breakdown summary for new HIV diagnoses for Black (NH) women', + + ageSubPopulationLabel: 'Ages 13+', + otherSubPopulationLabel: 'Black Women', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'black_women_population_count', - shortLabel: 'Total Population (Black Women, Ages 13+)', - type: 'count', - }, + pct_share: { chartTitle: 'Share of total new HIV diagnoses for Black (NH) women', metricId: 'hiv_diagnoses_black_women_pct_share', @@ -542,13 +533,11 @@ export const HIV_BW_DISEASE_METRICS: DataTypeConfig[] = [ text: 'Black women are disproportionately affected by HIV. In fact, Black women are six times more likely to be diagnosed with HIV than white women. Studying HIV among Black women in regard to health equity can help us to understand why this disparity exists and how to address it.', }, dataTableTitle: 'Breakdown summary for HIV deaths for Black (NH) women', + + ageSubPopulationLabel: 'Ages 13+', + otherSubPopulationLabel: 'Black Women', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'black_women_population_count', - shortLabel: 'Total Population (Black Women, Ages 13+)', - type: 'count', - }, + pct_share: { chartTitle: 'Share of total HIV deaths for Black (NH) Women', metricId: 'hiv_deaths_black_women_pct_share', @@ -612,13 +601,9 @@ export const HIV_PREP_METRICS: DataTypeConfig[] = [ text: 'HIV PrEP is a medication that can help to prevent HIV infection. PrEP is highly effective when taken as prescribed. Studying HIV PrEP in regard to health equity can help us to understand why certain populations are more likely to use PrEP and why others are less likely to use it.', }, dataTableTitle: 'Breakdown summary for PrEP coverage', + ageSubPopulationLabel: 'Ages 16+', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'hiv_prep_population', - shortLabel: 'Total PrEP-Eligible Population', - type: 'count', - }, + pct_share: { chartTitle: 'Share of total PrEP prescriptions', metricId: 'hiv_prep_pct_share', diff --git a/frontend/src/data/config/MetricConfigPDOH.ts b/frontend/src/data/config/MetricConfigPDOH.ts index db07aa04e9..1e57ffb752 100644 --- a/frontend/src/data/config/MetricConfigPDOH.ts +++ b/frontend/src/data/config/MetricConfigPDOH.ts @@ -68,6 +68,7 @@ export const VOTER_PARTICIPATION_METRICS: DataTypeConfig[] = [ definition: { text: `U.S. citizens ages 18 and older who voted in the last presidential election.`, }, + ageSubPopulationLabel: 'Ages 18+', metrics: { pct_rate: { metricId: 'voter_participation_pct_rate', @@ -110,6 +111,7 @@ export const WOMEN_IN_GOV_METRICS: DataTypeConfig[] = [ text: `Individuals identifying as women who have served in the Congress of the United States, including members of the U.S. Senate and members, territorial delegates, and resident commissioners of the U.S. House of Representatives. Women who self-identify as more than one race/ethnicity are included in the rates for each group with which they identify.`, }, dataTableTitle: 'Breakdown summary for Women in US Congress', + otherSubPopulationLabel: 'US Congress members incl. Territorial Delegates', metrics: { pct_rate: { metricId: 'pct_share_of_us_congress', @@ -169,7 +171,10 @@ export const WOMEN_IN_GOV_METRICS: DataTypeConfig[] = [ text: `Individuals identifying as women currently serving in their state or territory’s legislature. Women who self-identify as more than one race/ethnicity are included in the rates for each group with which they identify.`, }, dataTableTitle: 'Breakdown summary for Women in state legislatures', + otherSubPopulationLabel: 'State and Territorial Legislators', + metrics: { + pct_rate: { metricId: 'pct_share_of_state_leg', chartTitle: 'Percentage of state legislators identifying as women', @@ -237,12 +242,7 @@ export const INCARCERATION_METRICS: DataTypeConfig[] = [ }, dataTableTitle: 'Breakdown summary for people in prison', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'incarceration_population_estimated_total', - shortLabel: 'Total Population (from rate data)', - type: 'count', - }, + per100k: { metricId: 'prison_per_100k', chartTitle: 'Prison incarceration', @@ -311,12 +311,6 @@ export const INCARCERATION_METRICS: DataTypeConfig[] = [ dataTableTitle: 'Breakdown summary for people in jail', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'incarceration_population_estimated_total', - shortLabel: 'Total Population (from rate data)', - type: 'count', - }, per100k: { metricId: 'jail_per_100k', chartTitle: 'Jail incarceration', diff --git a/frontend/src/data/config/MetricConfigPhrma.ts b/frontend/src/data/config/MetricConfigPhrma.ts index f0166ac9df..52b83da451 100644 --- a/frontend/src/data/config/MetricConfigPhrma.ts +++ b/frontend/src/data/config/MetricConfigPhrma.ts @@ -117,13 +117,9 @@ export const PHRMA_CARDIOVASCULAR_METRICS: DataTypeConfig[] = [ }, ], }, + otherSubPopulationLabel: 'Medicare Beta-Blocker Beneficiaries', + ageSubPopulationLabel: 'Ages 18+', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'medicare_population', - shortLabel: 'Total Medicare Population', - type: 'count', - }, pct_rate: { rateNumeratorMetric: { metricId: 'bb_ami_adherence_estimated_total', @@ -190,13 +186,9 @@ export const PHRMA_CARDIOVASCULAR_METRICS: DataTypeConfig[] = [ }, ], }, + otherSubPopulationLabel: 'Medicare Statins Beneficiaries', + ageSubPopulationLabel: 'Ages 18+', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'medicare_population', - shortLabel: 'Total Medicare Population', - type: 'count', - }, pct_rate: { metricId: 'statins_adherence_pct_rate', chartTitle: 'Population adherent to statins', @@ -256,13 +248,10 @@ export const PHRMA_CARDIOVASCULAR_METRICS: DataTypeConfig[] = [ }, ], }, + otherSubPopulationLabel: 'Medicare Beta Blockers Beneficiaries', + ageSubPopulationLabel: 'Ages 18+', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'medicare_population', - shortLabel: 'Total Medicare Population', - type: 'count', - }, + pct_rate: { rateNumeratorMetric: { metricId: 'beta_blockers_adherence_estimated_total', @@ -324,13 +313,10 @@ export const PHRMA_CARDIOVASCULAR_METRICS: DataTypeConfig[] = [ }, ], }, + otherSubPopulationLabel: 'Medicare RASA Beneficiaries', + ageSubPopulationLabel: 'Ages 18+', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'medicare_population', - shortLabel: 'Total Medicare Population', - type: 'count', - }, + pct_rate: { rateNumeratorMetric: { metricId: 'ras_antagonists_adherence_estimated_total', @@ -390,13 +376,10 @@ export const PHRMA_CARDIOVASCULAR_METRICS: DataTypeConfig[] = [ }, ], }, + otherSubPopulationLabel: 'Medicare CCBs Beneficiaries', + ageSubPopulationLabel: 'Ages 18+', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'medicare_population', - shortLabel: 'Total Medicare Population', - type: 'count', - }, + pct_rate: { rateNumeratorMetric: { metricId: 'ccb_adherence_estimated_total', @@ -459,13 +442,10 @@ export const PHRMA_CARDIOVASCULAR_METRICS: DataTypeConfig[] = [ */ }, + otherSubPopulationLabel: 'Medicare DOACs Beneficiaries', + ageSubPopulationLabel: 'Ages 18+', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'medicare_population', - shortLabel: 'Total Medicare Population', - type: 'count', - }, + pct_rate: { rateNumeratorMetric: { metricId: 'doac_adherence_estimated_total', @@ -516,13 +496,10 @@ export const PHRMA_CARDIOVASCULAR_METRICS: DataTypeConfig[] = [ }, ], }, + otherSubPopulationLabel: 'Medicare Beneficiaries diagnosed with AMI', + ageSubPopulationLabel: 'Ages 18+', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'medicare_population', - shortLabel: 'Total Medicare Population', - type: 'count', - }, + per100k: { metricId: 'medicare_ami_per_100k', chartTitle: 'Rates of Acute MI', @@ -592,18 +569,11 @@ export const PHRMA_HIV_METRICS: DataTypeConfig[] = [ url: 'https://health.gov/healthypeople/tools-action/browse-evidence-based-resources/recommendations-hiv-prevention-adults-and-adolescents-hiv-united-states-2014', }, ], - /* - - - */ }, + otherSubPopulationLabel: 'Medicare ARV Beneficiaries', + ageSubPopulationLabel: 'Ages 18+', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'medicare_population', - shortLabel: 'Total Medicare Population', - type: 'count', - }, + pct_rate: { rateNumeratorMetric: { metricId: 'arv_adherence_estimated_total', @@ -653,13 +623,9 @@ export const PHRMA_HIV_METRICS: DataTypeConfig[] = [ }, ], }, + otherSubPopulationLabel: 'Medicare Beneficiaries Diagnosed with HIV', + ageSubPopulationLabel: 'Ages 18+', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'medicare_population', - shortLabel: 'Total Medicare Population', - type: 'count', - }, per100k: { metricId: 'medicare_hiv_per_100k', chartTitle: 'Rates of HIV cases', @@ -719,13 +685,10 @@ export const PHRMA_MENTAL_HEALTH_METRICS: DataTypeConfig[] = [ }, ], }, + otherSubPopulationLabel: 'Medicare Antipsychotics Beneficiaries', + ageSubPopulationLabel: 'Ages 18+', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'medicare_population', - shortLabel: 'Total Medicare Population', - type: 'count', - }, + pct_rate: { rateNumeratorMetric: { metricId: 'anti_psychotics_adherence_estimated_total', @@ -758,19 +721,15 @@ export const PHRMA_MENTAL_HEALTH_METRICS: DataTypeConfig[] = [ mapConfig: medicareHigherIsWorseMapConfig, dataTypeShortLabel: 'Schizophrenia', dataTableTitle: 'Breakdown summary for schizophrenia cases', - fullDisplayName: 'Cases of Schizophrenia', surveyCollectedData: true, definition: { text: `The number of Medicare fee-for-service beneficiaries per 100K with a diagnosis of schizophrenia during the measurement period.`, }, + otherSubPopulationLabel: 'Medicare Beneficiaries Diagnosed with Schizophrenia', + ageSubPopulationLabel: 'Ages 18+', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'medicare_population', - shortLabel: 'Total Medicare Population', - type: 'count', - }, + per100k: { metricId: 'medicare_schizophrenia_per_100k', chartTitle: 'Rates of schizophrenia', diff --git a/frontend/src/data/config/MetricConfigSDOH.ts b/frontend/src/data/config/MetricConfigSDOH.ts index 5724e77aba..037ab94181 100644 --- a/frontend/src/data/config/MetricConfigSDOH.ts +++ b/frontend/src/data/config/MetricConfigSDOH.ts @@ -62,12 +62,7 @@ export const UNINSURANCE_METRICS: DataTypeConfig[] = [ }, dataTableTitle: 'Breakdown summary for uninsured people', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'uninsured_pop_estimated_total', - shortLabel: 'Total Population for Insurance Rate', - type: 'count', - }, + pct_rate: { metricId: 'uninsured_pct_rate', chartTitle: 'Uninsured people', @@ -128,12 +123,7 @@ export const POVERTY_METRICS: DataTypeConfig[] = [ }, dataTableTitle: 'Breakdown summary for people below the poverty line', metrics: { - sub_population_count: { - chartTitle: '', - metricId: 'poverty_pop_estimated_total', - shortLabel: 'Total Population for Poverty Rate', - type: 'count', - }, + pct_rate: { metricId: 'poverty_pct_rate', chartTitle: 'People below the poverty line', @@ -195,6 +185,7 @@ export const CARE_AVOIDANCE_METRICS: DataTypeConfig[] = [ }, surveyCollectedData: true, dataTableTitle: 'Breakdown summary for care avoidance due to cost', + ageSubPopulationLabel: 'Ages 18+', metrics: { pct_rate: { metricId: 'avoided_care_pct_rate', @@ -237,6 +228,7 @@ export const PREVENTABLE_HOSP_METRICS: DataTypeConfig[] = [ text: 'Studying preventable hospitalizations can help us understand why these disparities exist and how to address them.', }, dataTableTitle: 'Breakdown summary for preventable hospitalizations', + otherSubPopulationLabel: 'Medicare beneficiaries', metrics: { per100k: { metricId: 'preventable_hospitalizations_per_100k', diff --git a/frontend/src/data/providers/GunViolenceYouthProvider.ts b/frontend/src/data/providers/GunViolenceYouthProvider.ts index e5ce7e9e1d..f276580275 100644 --- a/frontend/src/data/providers/GunViolenceYouthProvider.ts +++ b/frontend/src/data/providers/GunViolenceYouthProvider.ts @@ -5,12 +5,15 @@ import { type DatasetId } from "../config/DatasetMetadata"; import { type MetricQuery, MetricQueryResponse } from '../query/MetricQuery'; import VariableProvider from './VariableProvider'; -export const GUN_VIOLENCE_DATATYPES: DataTypeId[] = [ +// TODO: ideally we should fix on the backend to clarify: `youth` is the parent category, that combines both `children` (ages 0-17) and `young_adults` (ages 18-25) + +export const GUN_VIOLENCE_YOUTH_DATATYPES: DataTypeId[] = [ 'gun_deaths_youth', 'gun_deaths_young_adults', ] -export const GUN_DEATH_YOUTH_METRIC_IDS: MetricId[] = [ + +export const GUN_DEATHS_CHILDREN_METRIC_IDS: MetricId[] = [ 'gun_deaths_youth_estimated_total', 'gun_deaths_youth_pct_relative_inequity', 'gun_deaths_youth_pct_share', @@ -34,7 +37,7 @@ export const GUN_VIOLENCE_YOUTH_RESTRICTED_DEMOGRAPHIC_DETAILS = [ ] export const GUN_VIOLENCE_YOUTH_METRICS = [ - ...GUN_DEATH_YOUTH_METRIC_IDS, + ...GUN_DEATHS_CHILDREN_METRIC_IDS, ...GUN_DEATHS_YOUNG_ADULTS_METRIC_IDS ] diff --git a/frontend/src/data/utils/DatasetTypes.ts b/frontend/src/data/utils/DatasetTypes.ts index 6396a5fd63..5e8f615c4b 100644 --- a/frontend/src/data/utils/DatasetTypes.ts +++ b/frontend/src/data/utils/DatasetTypes.ts @@ -9,6 +9,7 @@ export interface DataSourceMetadata { readonly description: string readonly dataset_ids: DatasetId[] readonly data_source_name: string + readonly data_source_acronym: string readonly data_source_pretty_site_name: string readonly data_source_link: string readonly geographic_level: string diff --git a/frontend/src/reports/reportUtils.ts b/frontend/src/reports/reportUtils.ts index 76e6421137..7e29123c68 100644 --- a/frontend/src/reports/reportUtils.ts +++ b/frontend/src/reports/reportUtils.ts @@ -11,7 +11,7 @@ import { CAWP_RESTRICTED_DEMOGRAPHIC_DETAILS, } from '../data/providers/CawpProvider' import { BLACK_MEN_RESTRICTED_DEMOGRAPHIC_DETAILS } from '../data/providers/GunDeathsBlackMenProvider' -import { GUN_VIOLENCE_DATATYPES, GUN_VIOLENCE_YOUTH_RESTRICTED_DEMOGRAPHIC_DETAILS } from '../data/providers/GunViolenceYouthProvider' +import { GUN_VIOLENCE_YOUTH_DATATYPES, GUN_VIOLENCE_YOUTH_RESTRICTED_DEMOGRAPHIC_DETAILS } from '../data/providers/GunViolenceYouthProvider' import { BLACK_WOMEN_DATATYPES, BLACK_WOMEN_RESTRICTED_DEMOGRAPHIC_DETAILS, @@ -93,7 +93,7 @@ export function getAllDemographicOptions( const disabledDemographicOptionsWithRepeats: string[][] = [] // GUN VIOLENCE YOUTH - if (configsContainsMatchingId(configs, GUN_VIOLENCE_DATATYPES)) { + if (configsContainsMatchingId(configs, GUN_VIOLENCE_YOUTH_DATATYPES)) { enabledDemographicOptionsMap = ONLY_RACE_TYPE_MAP disabledDemographicOptionsWithRepeats.push( ...GUN_VIOLENCE_YOUTH_RESTRICTED_DEMOGRAPHIC_DETAILS diff --git a/frontend/src/reports/ui/AnnouncementBanner.tsx b/frontend/src/reports/ui/AnnouncementBanner.tsx index 096a173ec1..2fa7c7c6c6 100644 --- a/frontend/src/reports/ui/AnnouncementBanner.tsx +++ b/frontend/src/reports/ui/AnnouncementBanner.tsx @@ -6,7 +6,7 @@ import { urlMap } from '../../utils/externalUrls' export default function AnnouncementBanner() { return ( } title='Did You Know?' kind='text-only' @@ -22,7 +22,7 @@ export default function AnnouncementBanner() { Explore the Women in Government Data →