Skip to content

Commit

Permalink
beefs out 500 cities disclaimers and changes red highlights to green
Browse files Browse the repository at this point in the history
  • Loading branch information
davelandry committed Dec 5, 2019
1 parent 4888e2a commit d0eeaea
Show file tree
Hide file tree
Showing 20 changed files with 52 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ class HealthCenterDemographics extends SectionColumns {
<SectionTitle>Health Center Demographics</SectionTitle>
<article>
{(!isZipLevelDataAvailable && meta.level !== "county" && meta.name !== "") &&
<Disclaimer>Data is shown for Wayne County</Disclaimer>
<Disclaimer>Data is only available for Wayne County</Disclaimer>
}
{
meta.level === "tract" && isZipLevelDataAvailable &&
<Disclaimer>Data is shown for zip {raceAndEthnicityZipLevelData.data[0].Geography}</Disclaimer>
<Disclaimer>Data is only available for zip {raceAndEthnicityZipLevelData.data[0].Geography}</Disclaimer>
}

{isZipLevelDataAvailable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class HealthInsuranceCoverage extends SectionColumns {
<SectionTitle>Health Insurance Coverage</SectionTitle>
<article>
{!isCoverageDataAvailableForCurrentGeography &&
<Disclaimer>Data is shown for {coverageData.data[0].Geography}</Disclaimer>
<Disclaimer>Data is only available for {coverageData.data[0].Geography}</Disclaimer>
}
<StatGroup
title={"most covered age groups by gender"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class ViolentAndPropertyCrimes extends SectionColumns {
<SectionTitle>Violent and Property Crimes</SectionTitle>
<article>
{!isPlaceDataAvailable &&
<Disclaimer>Data is shown for Wayne County</Disclaimer>
<Disclaimer>Data is only available for Wayne County</Disclaimer>
}
{/* Show stats and short paragraph for each type of crime. */}
<Stat
Expand Down
2 changes: 1 addition & 1 deletion app/pages/Profile/sections/economy/DistressScore.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DistressScore extends SectionColumns {
<SectionColumns>
<SectionTitle>Distress Score</SectionTitle>
<article>
<Disclaimer>Data is shown at the zip level</Disclaimer>
<Disclaimer>Data is only available at the zip level</Disclaimer>
<Stat
title="Zip code with highest Distress Score"
year={topDistressScoreData.Year}
Expand Down
2 changes: 1 addition & 1 deletion app/pages/Profile/sections/economy/EmploymentGrowth.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class EmploymentGrowth extends SectionColumns {
<SectionColumns>
<SectionTitle>Employment Growth</SectionTitle>
<article>
<Disclaimer>Data is shown at the zip level</Disclaimer>
<Disclaimer>Data is only available at the zip level</Disclaimer>
<Stat
title={"Zip Code with the largest employment growth"}
year={topEmploymentRateData.Year}
Expand Down
2 changes: 1 addition & 1 deletion app/pages/Profile/sections/economy/Unemployment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Unemployment extends SectionColumns {
<SectionTitle>Unemployment</SectionTitle>
<article>
{!isUnemploymentRateAvailableForCurrentLocation &&
<Disclaimer>Unemployment rate data is shown for {unemploymentRate.data[0].Geography}</Disclaimer>
<Disclaimer>Unemployment rate Data is only available for {unemploymentRate.data[0].Geography}</Disclaimer>
}
<StatGroup
title={"full-time employment by gender"}
Expand Down
2 changes: 1 addition & 1 deletion app/pages/Profile/sections/education/DropoutRate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DropoutRate extends SectionColumns {
<SectionColumns>
<SectionTitle>Dropout Rate</SectionTitle>
<article>
<Disclaimer>Data is shown at the zip level</Disclaimer>
<Disclaimer>Data is only available at the zip level</Disclaimer>
{/* Top stats about High School Dropout Rate. */}
<Stat
title="highest high school dropout rate"
Expand Down
4 changes: 2 additions & 2 deletions app/pages/Profile/sections/foodAccess/FoodAvailability.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class FoodAvailability extends SectionColumns {
}

render() {
const {meta, foodStores} = this.props;
const {foodStores} = this.props;
const isFoodStoreDataAvailableForCurrentGeography = foodStores.source[0].substitutions.length === 0;

const storeTypes = ["Farmers' markets", "Convenience stores", "Grocery stores", "Specialized food stores", "Supercenters and club stores"];
Expand Down Expand Up @@ -74,7 +74,7 @@ class FoodAvailability extends SectionColumns {
<SectionTitle>Food Availability</SectionTitle>
<article>
{!isFoodStoreDataAvailableForCurrentGeography &&
<Disclaimer>Data is shown for {topStore.Geography}</Disclaimer>
<Disclaimer>Data is only available for {topStore.Geography}</Disclaimer>
}
<Stat
title={"most common food store"}
Expand Down
2 changes: 1 addition & 1 deletion app/pages/Profile/sections/foodAccess/FoodInsecurity.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class FoodInsecurity extends SectionColumns {
<SectionTitle>Food Insecurity</SectionTitle>
<article>
{!isInsecurityRateDataAvailableForCurrentGeography &&
<Disclaimer>Data is shown for {location}</Disclaimer>
<Disclaimer>Data is only available for {location}</Disclaimer>
}
<Stat
title={"Child Insecurity"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class PublicFoodAssistance extends SectionColumns {
<SectionTitle>Public Food Assistance</SectionTitle>
<article>
{!isSnapWicDataAvailableForCurrentGeography &&
<Disclaimer>SNAP and WIC data is shown for {snapWicData.data[0].Geography}</Disclaimer>
<Disclaimer>SNAP and WIC Data is only available for {snapWicData.data[0].Geography}</Disclaimer>
}
<StatGroup
title="authorized stores by program"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class StoreAccessByDemographic extends SectionColumns {
</label>
{!isCurrentLocationDataAvailable &&
<Disclaimer>
Data is shown for { ageSelected ? foodAccessByAge.data[0].Geography : foodAccessByRace.data[0].Geography }
Data is only available for { ageSelected ? foodAccessByAge.data[0].Geography : foodAccessByRace.data[0].Geography }
</Disclaimer>
}
{/* Show top stats for Age and Race groups based on the drilldown value. */}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,16 @@ class PhysicalInactivity extends SectionColumns {

const {meta} = this.props;

const missingProfile = meta.level === "tract" && !isPhysicalInactivityBySexAvailableForCurrentlocation
? !physicalInactivity.data.find(d => d["ID Tract"] === meta.id)
: false;

return (
<SectionColumns>
<SectionTitle>Physical Inactivity</SectionTitle>
<article>
{!isPhysicalInactivityBySexAvailableForCurrentlocation
? <Disclaimer>Data is shown at the census tract level for four cities</Disclaimer>
? <Disclaimer>Data is only available at the census tract level for a subset of cities in Wayne County (Detroit, Dearborn, Livonia, and Westland).{missingProfile ? ` ${meta.name} (highlighted in green) is not included within those cities.` : ""}</Disclaimer>
: null
}
<Stat
Expand All @@ -74,7 +78,7 @@ class PhysicalInactivity extends SectionColumns {
/>


<Disclaimer>Data is shown for {physicalInactivityPrevalenceBySex.data[0].Geography}</Disclaimer>
<Disclaimer>Data is only available for {physicalInactivityPrevalenceBySex.data[0].Geography}</Disclaimer>
{/* Show top stats for the Male and Female Physical Inactivity data. */}
{/* And write short paragraphs explaining Barchart and top stats for the Physical Inactivity data. */}
<StatGroup
Expand Down Expand Up @@ -162,7 +166,7 @@ class PhysicalInactivity extends SectionColumns {
shapeConfig: {
Path: {
stroke(d, i) {
if (meta.level === "tract" && (d["ID Tract"] === meta.id || d.id === meta.id)) return styles["terra-cotta-dark"];
if (meta.level === "tract" && (d["ID Tract"] === meta.id || d.id === meta.id)) return styles["shamrock-dark"];
const c = typeof this._shapeConfig.Path.fill === "function" ? this._shapeConfig.Path.fill(d, i) : this._shapeConfig.Path.fill;
return color(c).darker();
},
Expand Down
8 changes: 6 additions & 2 deletions app/pages/Profile/sections/healthBehaviors/PreventiveCare.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ class PreventiveCare extends SectionColumns {

const {meta} = this.props;

const missingProfile = meta.level === "tract" && !isPreventativeCareWeightedValueSelected
? !preventiveCareData.find(d => d["ID Tract"] === meta.id)
: false;

return (
<SectionColumns>
<SectionTitle>Preventive Care</SectionTitle>
Expand All @@ -146,8 +150,8 @@ class PreventiveCare extends SectionColumns {
</label>

{isPreventativeCareWeightedValueSelected
? <Disclaimer>Data is shown at the zip region level</Disclaimer>
: <Disclaimer>Data is shown at the census tract level for four cities</Disclaimer>
? <Disclaimer>Data is only available at the zip region level.</Disclaimer>
: <Disclaimer>Data is only available at the census tract level for a subset of cities in Wayne County (Detroit, Dearborn, Livonia, and Westland).{missingProfile ? ` ${meta.name} (highlighted in yellow) is not included within those cities.` : ""}</Disclaimer>
}
{/* Show top stats for the dropdown selected. */}
<Stat
Expand Down
10 changes: 7 additions & 3 deletions app/pages/Profile/sections/healthBehaviors/RiskyBehaviors.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ class RiskyBehaviors extends SectionColumns {

const {meta} = this.props;

const missingProfile = meta.level === "tract" && !isSecondHandSmokeOrMonthlyAlcoholSelected
? !allTractSmokingDrinkingData.find(d => d["ID Tract"] === meta.id)
: false;

return (
<SectionColumns>
<SectionTitle>Risky Behaviors</SectionTitle>
Expand All @@ -101,8 +105,8 @@ class RiskyBehaviors extends SectionColumns {
</label>

{isSecondHandSmokeOrMonthlyAlcoholSelected
? <Disclaimer>Data is shown at the zip region level</Disclaimer>
: <Disclaimer>Data is shown at the census tract level for four cities</Disclaimer>
? <Disclaimer>Data is only available at the zip region level.</Disclaimer>
: <Disclaimer>Data is only available at the census tract level for a subset of cities in Wayne County (Detroit, Dearborn, Livonia, and Westland).{missingProfile ? ` ${meta.name} (highlighted in green) is not included within those cities.` : ""}</Disclaimer>
}
<Stat
title={isSecondHandSmokeOrMonthlyAlcoholSelected ? "Zip region with highest prevalence" : "Tract with highest prevalence"}
Expand Down Expand Up @@ -223,7 +227,7 @@ class RiskyBehaviors extends SectionColumns {
shapeConfig: {
Path: {
stroke(d, i) {
if (meta.level === "tract" && (d["ID Tract"] === meta.id || d.id === meta.id)) return styles["terra-cotta-dark"];
if (meta.level === "tract" && (d["ID Tract"] === meta.id || d.id === meta.id)) return styles["shamrock-dark"];
const c = typeof this._shapeConfig.Path.fill === "function" ? this._shapeConfig.Path.fill(d, i) : this._shapeConfig.Path.fill;
return color(c).darker();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ class ConditionsAndChronicDiseases extends SectionColumns {

const topDropdownWeightedData = healthConditionWeightedData.sort((a, b) => b[dropdownValue] - a[dropdownValue])[0];

const missingProfile = meta.level === "tract" && !isHealthConditionWeightedValueSelected
? !healthConditionData.find(d => d["ID Tract"] === meta.id)
: false;

return (
<SectionColumns>
<SectionTitle>Conditions and Chronic Diseases</SectionTitle>
Expand All @@ -132,8 +136,8 @@ class ConditionsAndChronicDiseases extends SectionColumns {
</label>

{isHealthConditionWeightedValueSelected
? <Disclaimer>Data is shown at the zip region level</Disclaimer>
: <Disclaimer>Data is shown at the census tract level for four cities</Disclaimer>
? <Disclaimer>Data is only available at the zip region level.</Disclaimer>
: <Disclaimer>Data is only available at the census tract level for a subset of cities in Wayne County (Detroit, Dearborn, Livonia, and Westland).{missingProfile ? ` ${meta.name} (highlighted in green) is not included within those cities.` : ""}</Disclaimer>
}
{/* Show top stats for the dropdown selected. */}
{ isHealthConditionWeightedValueSelected
Expand Down Expand Up @@ -223,7 +227,7 @@ class ConditionsAndChronicDiseases extends SectionColumns {
shapeConfig: {
Path: {
stroke(d, i) {
if (meta.level === "tract" && (d["ID Tract"] === meta.id || d.id === meta.id)) return styles["terra-cotta-dark"];
if (meta.level === "tract" && (d["ID Tract"] === meta.id || d.id === meta.id)) return styles["shamrock-dark"];
const c = typeof this._shapeConfig.Path.fill === "function" ? this._shapeConfig.Path.fill(d, i) : this._shapeConfig.Path.fill;
return color(c).darker();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ class ObesityAndDiabetes extends SectionColumns {
const topMaleData = isDiabetesSelected ? topDiabetesMaleData : topObesityMaleData;
const topFemaleData = isDiabetesSelected ? topDiabetesFemaleData : topObesityFemaleData;

const missingProfile = meta.level === "tract" && !isBMIWeightedDataValueSelected
? !obesityAndDibetesDataValue.find(d => d["ID Tract"] === meta.id)
: false;

return (
<SectionColumns>
<SectionTitle>Obesity and Diabetes</SectionTitle>
Expand All @@ -145,8 +149,8 @@ class ObesityAndDiabetes extends SectionColumns {
</label>

{isBMIWeightedDataValueSelected
? <Disclaimer>Data is shown at the zip region level</Disclaimer>
: <Disclaimer>Data is shown at the census tract level for four cities</Disclaimer>
? <Disclaimer>Data is only available at the zip region level.</Disclaimer>
: <Disclaimer>Data is only available at the census tract level for a subset of cities in Wayne County (Detroit, Dearborn, Livonia, and Westland).{missingProfile ? ` ${meta.name} (highlighted in green) is not included within those cities.` : ""}</Disclaimer>
}

{/* Show top stats for the dropdown selected. */}
Expand All @@ -165,7 +169,7 @@ class ObesityAndDiabetes extends SectionColumns {
/>
}

<Disclaimer>Data is shown for {topFemaleData.Geography}</Disclaimer>
<Disclaimer>Data is only available for {topFemaleData.Geography}.</Disclaimer>
{/* Show top stats for the Male and Female Diabetes/Obesity data. */}
<StatGroup
title={`${dropdownValue === "Diabetes" ? "diabetes" : "obesity"} prevalance by gender`}
Expand Down Expand Up @@ -311,7 +315,7 @@ class ObesityAndDiabetes extends SectionColumns {
shapeConfig: {
Path: {
stroke(d, i) {
if (meta.level === "tract" && (d["ID Tract"] === meta.id || d.id === meta.id)) return styles["terra-cotta-dark"];
if (meta.level === "tract" && (d["ID Tract"] === meta.id || d.id === meta.id)) return styles["shamrock-dark"];
const c = typeof this._shapeConfig.Path.fill === "function" ? this._shapeConfig.Path.fill(d, i) : this._shapeConfig.Path.fill;
return color(c).darker();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class AirQuality extends SectionColumns {
</label>

{!isAirQualityDaysAvailableForCurrentGeography &&
<Disclaimer>Data is shown for {airQualityDays.data[0].Geography}</Disclaimer>
<Disclaimer>Data is only available for {airQualityDays.data[0].Geography}</Disclaimer>
}
{dropdownValue === "Air Quality Days" &&
<div className="article-inner-container">
Expand Down
2 changes: 1 addition & 1 deletion app/pages/Profile/sections/specialPopulation/Homeless.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class Homeless extends SectionColumns {
<SectionTitle>Homeless</SectionTitle>
<article>
{!isHomelessDataAvailableForCurrentGeography &&
<Disclaimer>Data is shown for {topShelteredHomelessCategory.Geography}</Disclaimer>
<Disclaimer>Data is only available for {topShelteredHomelessCategory.Geography}</Disclaimer>
}
<Stat
title={"Homeless rate"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class Incarceration extends SectionColumns {
<SectionTitle>Incarceration</SectionTitle>
<article>
{!isIncarcerationDataAvailableForCurrentGeography &&
<Disclaimer>Data is shown for {incarcerationData.data[0].Geography}</Disclaimer>
<Disclaimer>Data is only available for {incarcerationData.data[0].Geography}</Disclaimer>
}
<Stat
title="Most common crime"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ class VisionAndAuditoryDisabilities extends SectionColumns {
shapeConfig: {
Path: {
stroke(d, i) {
if (meta.level === "tract" && (d["ID Geography"] === meta.id || d.id === meta.id)) return styles["terra-cotta-dark"];
if (meta.level === "tract" && (d["ID Geography"] === meta.id || d.id === meta.id)) return styles["shamrock-dark"];
const c = typeof this._shapeConfig.Path.fill === "function" ? this._shapeConfig.Path.fill(d, i) : this._shapeConfig.Path.fill;
return color(c).darker();
},
Expand Down

0 comments on commit d0eeaea

Please sign in to comment.