Skip to content

Commit

Permalink
modifies text for some components as suggested in second pass feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rbaheti committed May 29, 2019
1 parent 0e35f36 commit ca7b333
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {updateSource} from "utils/helper";
import SourceGroup from "components/SourceGroup";
import Options from "components/Options";

const formatRaceNames = d => d.replace("Health Center Patients", "");
const formatRaceNames = d => d.replace("Health Center Patients", "").trim();
const lowerCaseRaceName = d => d.trim() === "Black" || d.trim() === "White" ? d.toLowerCase() : d;
const formatPercentage = d => `${formatAbbreviate(d * 100)}%`;

Expand Down Expand Up @@ -95,10 +95,10 @@ class HealthCenterDemographics extends SectionColumns {
qualifier={`${formatPercentage(topMostRaceData[topMostRaceData.RaceType])} of the population in Wayne County`}
/>

{isZipLevelDataAvailable ? <p>In {topZipLevelData.Year}, {lowerCaseRaceName(formatRaceNames(topZipLevelData.RaceType))} residents of {`zip ${topZipLevelData.Geography}`} visited health centers more than any other race/ethnicity group that utilizes services offered by health centers ({formatPercentage(topZipLevelData[topZipLevelData.RaceType])} of the health center population), as compared to the {lowerCaseRaceName(formatRaceNames(topMostRaceData.RaceType))} residents in Wayne County ({formatPercentage(topMostRaceData[topMostRaceData.RaceType])} of the health center population).</p>
: <p>In {topMostRaceData.Year}, {lowerCaseRaceName(formatRaceNames(topMostRaceData.RaceType))} residents of Wayne County visited health centers more than any other reported race/ethnicity group that utilizes services offered by health centers ({formatPercentage(topMostRaceData[topMostRaceData.RaceType])} of the health center population). This is followed by {lowerCaseRaceName(formatRaceNames(topSecondRaceData.RaceType))} residents ({formatPercentage(topSecondRaceData[topSecondRaceData.RaceType])}) and then {lowerCaseRaceName(formatRaceNames(topThirdRaceData.RaceType))} residents ({formatPercentage(topThirdRaceData[topThirdRaceData.RaceType])}).</p>}
{isZipLevelDataAvailable ? <p>In {topZipLevelData.Year}, {formatPercentage(topZipLevelData[topZipLevelData.RaceType])} of the health center visiting population in {`zip ${topZipLevelData.Geography}`} were {lowerCaseRaceName(formatRaceNames(topZipLevelData.RaceType))}, compared to {lowerCaseRaceName(formatRaceNames(topMostRaceData.RaceType))} residents in Wayne County ({formatPercentage(topMostRaceData[topMostRaceData.RaceType])}).</p>
: <p>In {topMostRaceData.Year}, {formatPercentage(topMostRaceData[topMostRaceData.RaceType])} of the health center visiting population in Wayne County were {lowerCaseRaceName(formatRaceNames(topMostRaceData.RaceType))}, followed by {lowerCaseRaceName(formatRaceNames(topSecondRaceData.RaceType))} ({formatPercentage(topSecondRaceData[topSecondRaceData.RaceType])}) and then {lowerCaseRaceName(formatRaceNames(topThirdRaceData.RaceType))} ({formatPercentage(topThirdRaceData[topThirdRaceData.RaceType])}).</p>}

<p> The following chart shows the health center visitors breakdown across all reported race/ethnicity groups in {isZipLevelDataAvailable ? topZipLevelData.Geography : "Wayne County"}.</p>
<p> The following chart shows the health center visitors breakdown across all reported racial groups in {isZipLevelDataAvailable ? topZipLevelData.Geography : "Wayne County"}.</p>

<SourceGroup sources={this.state.sources} />
<Contact slug={this.props.slug} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class ConditionsAndChronicDiseases extends SectionColumns {

return (
<SectionColumns>
<SectionTitle>Conditions & Chronic Diseases</SectionTitle>
<SectionTitle>Conditions and Chronic Diseases</SectionTitle>
<article>
{/* Create a dropdown for different types of health conditions. */}
<label className="pt-label pt-inline" htmlFor="health-conditions-dropdown">
Expand Down
27 changes: 16 additions & 11 deletions app/pages/Profile/sections/healthConditions/ObesityAndDiabetes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ class ObesityAndDiabetes extends SectionColumns {

{/* Write short paragraphs explaining Geomap and top stats for the dropdown value selected. */}
{isBMIWeightedDataValueSelected
? <p>In {topDropdownWeightedData["End Year"]}, {formatPercentage(topDropdownWeightedData[dropdownValue], true)} of the population of the {topDropdownWeightedData["Zip Region"]} <ZipRegionDefinition text="zip region" /> had {dropdownValue.toLowerCase()}, the highest {isHealthyWeightSelected ? "share" : "prevalence"} out of all zip regions in Wayne County.</p>
: <p>In {topDropdownValueTract.Year}, {formatPercentage(topDropdownValueTract[dropdownValue])} of the population of <CensusTractDefinition text={topDropdownValueTract.Tract} />{topTractPlace !== undefined ? `, ${topTractPlace}` : ""} had {dropdownValue.toLowerCase()}, the highest prevalence out of all tracts in Detroit, Livonia, Dearborn and Westland.</p>
? <p>In {topDropdownWeightedData["End Year"]}, {formatPercentage(topDropdownWeightedData[dropdownValue], true)} of the population of the {topDropdownWeightedData["Zip Region"]} <ZipRegionDefinition text="zip region" /> had a BMI indicating {dropdownValue.replace("BMI", "").toLowerCase().trim()}. This represents the highest {isHealthyWeightSelected ? "share" : "prevalence"} out of all zip regions in Wayne County.</p>
: <p>In {topDropdownValueTract.Year}, {formatPercentage(topDropdownValueTract[dropdownValue])} of the population of <CensusTractDefinition text={topDropdownValueTract.Tract} />{topTractPlace !== undefined ? ` in ${topTractPlace}` : ""} had {dropdownValue.toLowerCase()}. This is the highest prevalence out of all tracts in Detroit, Livonia, Dearborn and Westland.</p>
}

{/* Write short paragraphs explaining Barchart and top stats for the Diabetes/Obesity data. */}
Expand All @@ -202,9 +202,8 @@ class ObesityAndDiabetes extends SectionColumns {
{topMaleData.Geography} {isDiabetesSelected ? "had diabetes" : "were obese"}, compared to {isDiabetesSelected ? formatPercentage(stateLevelMaleDiabetes["Age-Adjusted Diabetes Prevalence"]) : formatPercentage(stateLevelMaleObesity["Age-Adjusted Obesity Prevalence"])} of the male {}
and {isDiabetesSelected ? formatPercentage(stateLevelFemaleDiabetes["Age-Adjusted Diabetes Prevalence"]) : formatPercentage(stateLevelFemaleObesity["Age-Adjusted Obesity Prevalence"])} of the female population in Michigan.</p>

{/* <Disclaimer>
{isBMIWeightedDataValueSelected ? "data is shown at the zip region level" : "data is shown at the census tract level" }
</Disclaimer> */}
{dropdownValue === "BMI Underweight" && <p>Estimates can only be reported for subgroups if they are based on a sample size of at least 50 respondents and/or have a relative standard error of 30 percent or less. Zip regions with too few cases of underweight therefore are not reported.</p>}

<SourceGroup sources={this.state.sources} />
<Contact slug={this.props.slug} />

Expand Down Expand Up @@ -266,12 +265,18 @@ class ObesityAndDiabetes extends SectionColumns {
colorScaleConfig: {
axisConfig: {tickFormat: d => formatPercentage(d, true)},
// having high disease prevalency is bad
color: [
styles["terra-cotta-white"],
styles["danger-light"],
styles["terra-cotta-medium"],
styles["danger-dark"]
]
color: dropdownValue !== "BMI Healthy Weight"
? [
styles["terra-cotta-white"],
styles["danger-light"],
styles["terra-cotta-medium"],
styles["danger-dark"]
] : [
styles["majorelle-white"],
styles["majorelle-light"],
styles["majorelle-medium"],
styles["majorelle-dark"]
]
},
label: d => d["Zip Region"],
time: "End Year",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ class AirQuality extends SectionColumns {
dataFormat={resp => {
this.setState({sources: updateSource(resp.source, this.state.sources)});
const data = resp.data.filter(d => d.Year !== "2018");
console.log(data);
return data;
}}
/>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class VisionAndAuditoryDisabilities extends SectionColumns {

return (
<SectionColumns>
<SectionTitle>Vision & Auditory Disabilities</SectionTitle>
<SectionTitle>Vision and Auditory Disabilities</SectionTitle>
<article>
{/* Create a dropdown for total immigrants and immigrants in poverty choices. */}
<label className="pt-label pt-inline" htmlFor="health-center-dropdown">
Expand Down

0 comments on commit ca7b333

Please sign in to comment.