Adds adjacency, impute flag and custom colors

This commit is contained in:
Vim USDS 2022-09-02 00:50:02 -07:00
parent 4b9580c28a
commit ffcd352f6e
6 changed files with 179 additions and 3 deletions

View file

@ -560,6 +560,25 @@ const AreaDetail = ({properties, hash, isCensusLayerSelected}: IAreaDetailProps)
threshold: 10, threshold: 10,
}; };
// Temp adding to workforce category
const adjacency: indicatorInfo = {
label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.ADJ),
description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.ADJ),
type: 'percentile',
value: properties.hasOwnProperty(constants.ADJACENCY_PERCENTILE) ?
properties[constants.ADJACENCY_PERCENTILE] : null,
isDisadvagtaged: properties[constants.ADJACENCY_EXCEEDS_THRESH] ?
properties[constants.ADJACENCY_EXCEEDS_THRESH] : null,
};
const imputeFlag: indicatorInfo = {
label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.IMP_FLG),
description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.IMP_FLG),
type: 'boolean',
value: properties.hasOwnProperty(constants.IMPUTE_FLAG) ?
(properties[constants.IMPUTE_FLAG] == '0' ? false : true) : null,
isDisadvagtaged: false,
};
/** /**
* Aggregate indicators based on categories * Aggregate indicators based on categories
@ -664,6 +683,15 @@ const AreaDetail = ({properties, hash, isCensusLayerSelected}: IAreaDetailProps)
isExceedBothSocioBurdens: properties[constants.IS_WORKFORCE_EXCEED_BOTH_SOCIO_INDICATORS_M] ? isExceedBothSocioBurdens: properties[constants.IS_WORKFORCE_EXCEED_BOTH_SOCIO_INDICATORS_M] ?
properties[constants.IS_WORKFORCE_EXCEED_BOTH_SOCIO_INDICATORS_M] : null, properties[constants.IS_WORKFORCE_EXCEED_BOTH_SOCIO_INDICATORS_M] : null,
}, },
{
id: 'test',
titleText: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_CATEGORY.TEST),
indicators: [adjacency],
socioEcIndicators: [imputeFlag],
isDisadvagtaged: null,
isExceed1MoreBurden: null,
isExceedBothSocioBurdens: null,
},
]; ];

View file

@ -2261,6 +2261,106 @@ exports[`rendering of the Islan areas in AreaDetail checks if indicators for NAT
</div> </div>
</li> </li>
</div> </div>
<h4
class="usa-accordion__heading"
>
<button
aria-controls="test"
aria-expanded="false"
class="usa-accordion__button"
data-testid="accordionButton_test"
type="button"
>
<div>
<div>
Testing
</div>
<div
class=""
/>
</div>
</button>
</h4>
<div
class="usa-accordion__content usa-prose"
data-testid="accordionItem_test"
hidden=""
id="test"
>
<div>
<div>
At or above at least one threshold?
</div>
<div>
No
</div>
</div>
<li
data-cy="indicatorBox"
data-testid="indicator-box"
>
<div>
<div>
Adjacency
<div>
Adjacency percentile?
</div>
</div>
<div>
<div>
<div />
<div>
<img
alt="an icon to represent data is unavailable"
src="test-file-stub"
/>
</div>
</div>
<div>
<div>
missing data
</div>
</div>
</div>
</div>
</li>
<div>
AND
</div>
<li
data-cy="indicatorBox"
data-testid="indicator-box"
>
<div>
<div>
Impute flag
<div>
A flag to inform imputation?
</div>
</div>
<div>
<div>
<div />
<div>
<img
alt="an icon to represent data is unavailable"
src="test-file-stub"
/>
</div>
</div>
<div>
<div>
missing data
</div>
</div>
</div>
</div>
</li>
</div>
</div> </div>
<div> <div>
Methodology version 0.1 Methodology version 0.1

View file

@ -324,7 +324,7 @@ const J40Map = ({location}: IJ40Interface) => {
setGeolocationInProgress(true); setGeolocationInProgress(true);
}; };
const mapBoxBaseLayer = 'tl' in flags ? `mapbox://styles/justice40/cl2qimpi2000014qeb1egpox8` : `mapbox://styles/mapbox/streets-v11`; const mapBoxBaseLayer = 'tl' in flags ? `mapbox://styles/justice40/cl2qimpi2000014qeb1egpox8` : `mapbox://styles/justice40/cl5mp95tu000k14lpl21spgny`;
return ( return (
<> <>

View file

@ -230,6 +230,11 @@ export const IS_LOW_HS_EDUCATION_LOW_HIGHER_ED_PRIORITIZED = 'LHE';
export const ISLAND_AREAS_HS_EDU_PERCENTAGE_FIELD= 'IAHSEF'; export const ISLAND_AREAS_HS_EDU_PERCENTAGE_FIELD= 'IAHSEF';
export const ISLAND_AREA_LOW_HS_EDU = 'IALHE'; export const ISLAND_AREA_LOW_HS_EDU = 'IALHE';
// Misc category
export const ADJACENCY_PERCENTILE = 'ADJ_PFS';
export const ADJACENCY_EXCEEDS_THRESH = 'ADJ_ET';
export const IMPUTE_FLAG = 'IMP_FLG';
// ********** MAP CONSTANTS *************** // ********** MAP CONSTANTS ***************
// Source name constants // Source name constants

View file

@ -533,6 +533,12 @@ export const SIDE_PANEL_CATEGORY = defineMessages({
id: 'explore.map.page.side.panel.indicator.title.work.dev', id: 'explore.map.page.side.panel.indicator.title.work.dev',
defaultMessage: 'Workforce development', defaultMessage: 'Workforce development',
description: `Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Workforce development title description: `Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Workforce development title
`,
},
TEST: {
id: 'explore.map.page.side.panel.indicator.title.testing',
defaultMessage: 'Testing',
description: `Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Testing title
`, `,
}, },
}); });
@ -707,6 +713,17 @@ export const SIDE_PANEL_INDICATORS = defineMessages({
defaultMessage: 'High school degree non-attainment', defaultMessage: 'High school degree non-attainment',
description: `Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show High school degree achievement rate`, description: `Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show High school degree achievement rate`,
}, },
ADJ: {
id: 'explore.map.page.side.panel.indicator.adjacency',
defaultMessage: 'Adjacency',
description: `Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Adjancency`,
},
IMP_FLG: {
id: 'explore.map.page.side.panel.indicator.imp.flg',
defaultMessage: 'Impute flag',
description: `Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Impute flag`,
},
}); });
export const SIDE_PANEL_VALUES = { export const SIDE_PANEL_VALUES = {
@ -964,6 +981,20 @@ export const SIDE_PANEL_INDICATOR_DESCRIPTION = defineMessages({
description: `Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show an indicator description of Percent of people ages 25 years or older whose education level description: `Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show an indicator description of Percent of people ages 25 years or older whose education level
is less than a high school diploma`, is less than a high school diploma`,
}, },
ADJ: {
id: 'explore.map.page.side.panel.indicator.description.ling.iso',
defaultMessage: `
Adjacency percentile?
`,
description: `Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show an indicator about adjacency`,
},
IMP_FLG: {
id: 'explore.map.page.side.panel.indicator.description.ling.iso',
defaultMessage: `
A flag to inform imputation?
`,
description: `Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show an indicator about adjacency`,
},
}); });
export const SIDE_PANEL_SPACERS = { export const SIDE_PANEL_SPACERS = {

View file

@ -559,6 +559,10 @@
"defaultMessage": "Abandoned mine lands", "defaultMessage": "Abandoned mine lands",
"description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Abandoned land mines" "description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Abandoned land mines"
}, },
"explore.map.page.side.panel.indicator.adjacency": {
"defaultMessage": "Adjacency",
"description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Adjancency"
},
"explore.map.page.side.panel.indicator.asthma": { "explore.map.page.side.panel.indicator.asthma": {
"defaultMessage": "Asthma", "defaultMessage": "Asthma",
"description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Asthma" "description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Asthma"
@ -652,8 +656,8 @@
"description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show an indicator description of Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show an indicator description of Average number of years of life a person can expect to live" "description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show an indicator description of Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show an indicator description of Average number of years of life a person can expect to live"
}, },
"explore.map.page.side.panel.indicator.description.ling.iso": { "explore.map.page.side.panel.indicator.description.ling.iso": {
"defaultMessage": "Percent of households where no one over the age 14 speaks English well", "defaultMessage": "A flag to inform imputation?",
"description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show an indicator description of Households in which no one age 14 and over speaks English only or also speaks a language other than English" "description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show an indicator about adjacency"
}, },
"explore.map.page.side.panel.indicator.description.low.income": { "explore.map.page.side.panel.indicator.description.low.income": {
"defaultMessage": "Household income is less than or equal to twice the federal poverty level", "defaultMessage": "Household income is less than or equal to twice the federal poverty level",
@ -755,6 +759,10 @@
"defaultMessage": "Housing cost burden", "defaultMessage": "Housing cost burden",
"description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Housing cost burden" "description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Housing cost burden"
}, },
"explore.map.page.side.panel.indicator.imp.flg": {
"defaultMessage": "Impute flag",
"description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Impute flag"
},
"explore.map.page.side.panel.indicator.lack.green.space": { "explore.map.page.side.panel.indicator.lack.green.space": {
"defaultMessage": "Lack of green space", "defaultMessage": "Lack of green space",
"description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Lack of green space" "description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Lack of green space"
@ -843,6 +851,10 @@
"defaultMessage": "Sustainable housing", "defaultMessage": "Sustainable housing",
"description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Sustainable housing title\n" "description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Sustainable housing title\n"
}, },
"explore.map.page.side.panel.indicator.title.testing": {
"defaultMessage": "Testing",
"description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Testing title\n"
},
"explore.map.page.side.panel.indicator.title.work.dev": { "explore.map.page.side.panel.indicator.title.work.dev": {
"defaultMessage": "Workforce development", "defaultMessage": "Workforce development",
"description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Workforce development title\n" "description": "Navigate to the explore the map page. When the map is in view, click on the map. The side panel will show Workforce development title\n"