Skip to content

Commit

Permalink
making suggested changes to pr
Browse files Browse the repository at this point in the history
  • Loading branch information
eriwarr committed Dec 17, 2024
1 parent be36fb5 commit 82b73f5
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 23 deletions.
48 changes: 36 additions & 12 deletions frontend/src/data/config/DatasetMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ export type DatasetId =
| 'cdc_wonder_data-sex_national_historical'
| 'cdc_wonder_data-sex_state_current'
| 'cdc_wonder_data-sex_state_historical'
| 'cdc_wonder_data-alls_national_current'
| 'cdc_wonder_data-alls_national_historical'
| 'cdc_wonder_data-alls_state_current'
| 'cdc_wonder_data-alls_state_historical'
| 'census_pop_estimates-race_and_ethnicity'
| 'chr_data-race_and_ethnicity_county_current'
| 'covid_tracking_project-cases_by_race_state'
Expand Down Expand Up @@ -255,62 +259,82 @@ export const DatasetMetadataMap: Record<DatasetId, DatasetMetadata> = {
...DatasetMetadataMapMaternalHealthCategory,
...DatasetMetadataMapCommunitySafetyCategory,
'cdc_wonder_data-age_national_current': {
name: 'Cancer incidence by age group, national current data',
name: 'Cancer incidence by age, nationally',
original_data_sourced: '2021',
source_id: 'cdc_wonder',
},
'cdc_wonder_data-age_national_historical': {
name: 'Cancer incidence by age group, national historical data',
name: 'Cancer incidence by age, nationally',
original_data_sourced: '1999-2021',
source_id: 'cdc_wonder',
},
'cdc_wonder_data-age_state_current': {
name: 'Cancer incidence by age group, state current data',
name: 'Cancer incidence by age and state',
original_data_sourced: '2021',
source_id: 'cdc_wonder',
},
'cdc_wonder_data-age_state_historical': {
name: 'Cancer incidence by age group, state historical data',
name: 'Cancer incidence by age and state',
original_data_sourced: '1999-2021',
source_id: 'cdc_wonder',
},
'cdc_wonder_data-race_and_ethnicity_national_current': {
name: 'Cancer incidence by race and ethnicity, national current data',
name: 'Cancer incidence by race and ethnicity, nationally',
original_data_sourced: '2021',
source_id: 'cdc_wonder',
},
'cdc_wonder_data-race_and_ethnicity_national_historical': {
name: 'Cancer incidence by race and ethnicity, national historical data',
name: 'Cancer incidence by race and ethnicity, nationally',
original_data_sourced: '1999-2021',
source_id: 'cdc_wonder',
},
'cdc_wonder_data-race_and_ethnicity_state_current': {
name: 'Cancer incidence by race and ethnicity, state current data',
name: 'Cancer incidence by race and ethnicity and state',
original_data_sourced: '2021',
source_id: 'cdc_wonder',
},
'cdc_wonder_data-race_and_ethnicity_state_historical': {
name: 'Cancer incidence by race and ethnicity, state historical data',
name: 'Cancer incidence by race and ethnicity and state',
original_data_sourced: '1999-2021',
source_id: 'cdc_wonder',
},
'cdc_wonder_data-sex_national_current': {
name: 'Cancer incidence by sex, national current data',
name: 'Cancer incidence by sex, nationally',
original_data_sourced: '2021',
source_id: 'cdc_wonder',
},
'cdc_wonder_data-sex_national_historical': {
name: 'Cancer incidence by sex, national historical data',
name: 'Cancer incidence by sex, nationally',
original_data_sourced: '1999-2021',
source_id: 'cdc_wonder',
},
'cdc_wonder_data-sex_state_current': {
name: 'Cancer incidence by sex, state current data',
name: 'Cancer incidence by sex and state',
original_data_sourced: '2021',
source_id: 'cdc_wonder',
},
'cdc_wonder_data-sex_state_historical': {
name: 'Cancer incidence by sex, state historical data',
name: 'Cancer incidence by sex and state',
original_data_sourced: '1999-2021',
source_id: 'cdc_wonder',
},
'cdc_wonder_data-alls_national_current': {
name: 'Cancer incidence, nationally',
original_data_sourced: '2021',
source_id: 'cdc_wonder',
},
'cdc_wonder_data-alls_national_historical': {
name: 'Cancer incidence, nationally',
original_data_sourced: '1999-2021',
source_id: 'cdc_wonder',
},
'cdc_wonder_data-alls_state_current': {
name: 'Cancer incidence by state',
original_data_sourced: '2021',
source_id: 'cdc_wonder',
},
'cdc_wonder_data-alls_state_historical': {
name: 'Cancer incidence by state',
original_data_sourced: '1999-2021',
source_id: 'cdc_wonder',
},
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/data/config/DropDownIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { HIV_CATEGORY_DROPDOWNIDS } from './MetricConfigHivCategory'
import { MATERNAL_HEALTH_CATEGORY_DROPDOWNIDS } from './MetricConfigMaternalHealth'
import { PDOH_CATEGORY_DROPDOWNIDS } from './MetricConfigPDOH'
import { MEDICARE_CATEGORY_DROPDOWNIDS } from './MetricConfigPhrma'
import { CANCER_CATEGORY_DROPDOWNIDS } from './MetricConfigPhrmaBrfss'
import { CANCER_SCREENING_CATEGORY_DROPDOWNIDS } from './MetricConfigPhrmaBrfss'
import { SDOH_CATEGORY_DROPDOWNIDS } from './MetricConfigSDOH'

export const DROPDOWN_IDS = [
Expand All @@ -20,7 +20,7 @@ export const DROPDOWN_IDS = [
...MEDICARE_CATEGORY_DROPDOWNIDS,
...COMMUNITY_SAFETY_DROPDOWNIDS,
...MATERNAL_HEALTH_CATEGORY_DROPDOWNIDS,
...CANCER_CATEGORY_DROPDOWNIDS,
...CANCER_SCREENING_CATEGORY_DROPDOWNIDS,
...CDC_CANCER_CATEGORY_DROPDOWNIDS,
] as const

Expand Down
16 changes: 10 additions & 6 deletions frontend/src/data/config/MetricConfigCancer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { defaultHigherIsWorseMapConfig } from '../../charts/mapGlobals'
import {
defaultHigherIsWorseMapConfig,
menHigherIsWorseMapConfig,
womenHigherIsWorseMapConfig,
} from '../../charts/mapGlobals'
import type { DataTypeConfig } from './MetricConfigTypes'

export const CDC_CANCER_CATEGORY_DROPDOWNIDS = ['cancer_incidence'] as const
Expand Down Expand Up @@ -57,7 +61,7 @@ export const CDC_CANCER_INCIDENCE_METRICS: DataTypeConfig[] = [
},
fullDisplayName: 'Breast cancer cases',
fullDisplayNameInline: 'breast cancer cases',
mapConfig: defaultHigherIsWorseMapConfig,
mapConfig: womenHigherIsWorseMapConfig,
metrics: {
pct_relative_inequity: {
chartTitle: 'Historical relative inequity of breast cancer cases',
Expand Down Expand Up @@ -85,7 +89,7 @@ export const CDC_CANCER_INCIDENCE_METRICS: DataTypeConfig[] = [
type: 'pct_share',
},
per100k: {
chartTitle: 'Breast cancer cases for women',
chartTitle: 'Breast cancer cases per 100k women',
columnTitleHeader: 'Breast cancer cases for women per 100k people',
metricId: 'breast_per_100k',
rateDenominatorMetric: {
Expand Down Expand Up @@ -122,7 +126,7 @@ export const CDC_CANCER_INCIDENCE_METRICS: DataTypeConfig[] = [
},
fullDisplayName: 'Cervical cancer cases',
fullDisplayNameInline: 'cervical cancer cases',
mapConfig: defaultHigherIsWorseMapConfig,
mapConfig: womenHigherIsWorseMapConfig,
metrics: {
pct_relative_inequity: {
chartTitle: 'Historical relative inequity of cervical cancer cases',
Expand Down Expand Up @@ -313,7 +317,7 @@ export const CDC_CANCER_INCIDENCE_METRICS: DataTypeConfig[] = [
},
fullDisplayName: 'Prostate cancer cases',
fullDisplayNameInline: 'prostate cancer cases',
mapConfig: defaultHigherIsWorseMapConfig,
mapConfig: menHigherIsWorseMapConfig,
metrics: {
pct_relative_inequity: {
chartTitle: 'Historical relative inequity of prostate cancer cases',
Expand All @@ -340,7 +344,7 @@ export const CDC_CANCER_INCIDENCE_METRICS: DataTypeConfig[] = [
type: 'pct_share',
},
per100k: {
chartTitle: 'Prostate cancer cases for men',
chartTitle: 'Prostate cancer cases per 100k men',
columnTitleHeader: 'Prostate cancer cases for men per 100k people',
metricId: 'prostate_per_100k',
rateDenominatorMetric: {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/data/config/MetricConfigPhrmaBrfss.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { medicareHigherIsBetterMapConfig } from '../../charts/mapGlobals'
import type { DataTypeConfig } from './MetricConfigTypes'

export const CANCER_CATEGORY_DROPDOWNIDS = ['cancer_screening']
export const CANCER_SCREENING_CATEGORY_DROPDOWNIDS = ['cancer_screening']

export type PhrmaBrfssDataTypeId =
| 'breast_cancer_screening'
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/utils/MadLibs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
MEDICARE_CATEGORY_DROPDOWNIDS,
MEDICARE_CATEGORY_HIV_AND_CVD_DROPDOWNIDS,
} from '../data/config/MetricConfigPhrma'
import { CANCER_CATEGORY_DROPDOWNIDS } from '../data/config/MetricConfigPhrmaBrfss'
import { CANCER_SCREENING_CATEGORY_DROPDOWNIDS } from '../data/config/MetricConfigPhrmaBrfss'
import { SDOH_CATEGORY_DROPDOWNIDS } from '../data/config/MetricConfigSDOH'
import type {
DataTypeConfig,
Expand Down Expand Up @@ -186,6 +186,7 @@ export const SELECTED_DROPDOWN_OVERRIDES: Partial<
gun_violence_youth: 'All Gun Deaths of',
cancer_screening: 'Screening adherence for',
gun_deaths_black_men: 'Black Male Gun Homicide Victims',
cancer_incidence: 'Incidence for',
}

export interface Category {
Expand Down Expand Up @@ -255,7 +256,7 @@ if (SHOW_CANCER_SCREENINGS) {
definition: '',
options: [
...CDC_CANCER_CATEGORY_DROPDOWNIDS,
...CANCER_CATEGORY_DROPDOWNIDS,
...CANCER_SCREENING_CATEGORY_DROPDOWNIDS,
] as unknown as DropdownVarId[],
})
}
Expand Down

0 comments on commit 82b73f5

Please sign in to comment.