Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Epa justice demographics #667

Merged
merged 33 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f111909
Compiles / pulls static placeholder data in
brucecrevensten May 16, 2024
180835a
Working chart for Age demographic
brucecrevensten May 17, 2024
23afe10
Improve word wrapping
brucecrevensten May 17, 2024
72990a1
Progress towards race/ethnicity chart
brucecrevensten May 17, 2024
55b41f7
interim commit: stacked horizontal bars for race/ethnicity + other mocks
brucecrevensten May 21, 2024
53b197d
Race & ethnicity chart/table are looking ok!
brucecrevensten May 21, 2024
4134783
disability + insurance is in place
brucecrevensten May 22, 2024
986a461
Health demographics table / viz implemented
brucecrevensten May 22, 2024
9564bc1
interim commit with debugging noise for map
brucecrevensten May 22, 2024
4a48359
Fix GeoJSON load/layer issue for Demographics minimap.
cstephen May 23, 2024
57d9a99
Load demographics GeoJSON layer based on selected community.
cstephen May 23, 2024
bef8467
Clear demographics data from store when report page is closed.
cstephen May 23, 2024
cd7305c
Remove x-axis from age chart.
cstephen May 23, 2024
438fd89
adjust code to make intro paragraph more grammar
brucecrevensten May 23, 2024
278a35b
Add missing demographics notification after TOC.
cstephen May 23, 2024
329a876
Hide health conditions section if the data is missing.
cstephen May 24, 2024
39c125c
add more guards for missing data
brucecrevensten May 24, 2024
9e1cb51
Modify intro text language
brucecrevensten May 24, 2024
1507546
Add initial docublurb for other demographics
brucecrevensten May 24, 2024
188fb6f
HTML repair
brucecrevensten May 24, 2024
741f3b6
Add data sources for demographic data
brucecrevensten May 29, 2024
efdccd7
Update years in text under demographics disability & insurance section.
cstephen Jun 25, 2024
de179ca
Tiny formatting changes
brucecrevensten Aug 28, 2024
19d6ae3
Update components/Report.vue
brucecrevensten Aug 30, 2024
b448565
Update assets/demographics.json
brucecrevensten Aug 30, 2024
f87b172
Update components/reports/demographics/DemographicsOther.vue
brucecrevensten Aug 30, 2024
03948d2
Update components/reports/demographics/DemographicsHealthChart.vue
brucecrevensten Aug 30, 2024
98c744e
Update components/reports/demographics/DemographicsHealthChart.vue
brucecrevensten Aug 30, 2024
0dd8973
Update components/reports/demographics/DemographicsHealthChart.vue
brucecrevensten Aug 30, 2024
2506d42
Update components/reports/demographics/DemographicsHealthChart.vue
brucecrevensten Aug 30, 2024
d5b3b59
Remove unused static demographics file
brucecrevensten Aug 30, 2024
34463d3
Revert "Remove unused static demographics file"
brucecrevensten Aug 30, 2024
5d04545
Properly wire in remote fetch of demographics data for all places
brucecrevensten Aug 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add more guards for missing data
  • Loading branch information
brucecrevensten committed May 24, 2024
commit 39c125cc779ec2e0c951e1855e09a00701f6fe77
115 changes: 76 additions & 39 deletions components/reports/demographics/DemographicsHealthChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,58 @@
<div>
<div class="block">
<h5 class="title is-5">Disability &amp; insurance</h5>
<div class="content is-size-5">
<p>
Data in this section taken from Census ACS 5-year Year 2023.
<strong> Values are estimated</strong>; margin of error is shown in
parenthesis for each value.
</p>
<div v-if="disabilityInsurancePresent">
<div class="content is-size-5">
<p>
Data in this section taken from Census ACS 5-year Year 2023.
<strong> Values are estimated</strong>; margin of error is shown in
parenthesis for each value.
brucecrevensten marked this conversation as resolved.
Show resolved Hide resolved
</p>
</div>
<table class="table">
<caption>
Disability &amp; insurance
</caption>
<thead>
<th scope="col">Condition</th>
<th scope="col">{{ placeName }}</th>
<th scope="col">Alaska</th>
<th scope="col">U.S.</th>
</thead>
<tbody>
<tr v-for="(name, key) in acs">
<th scope="row" v-html="name"></th>
<td>
{{ demographics['place'][key] }}% ({{
demographics['place']['moe_' + key]
}}%)
</td>
<td>
{{ demographics['alaska'][key] }}% ({{
demographics['alaska']['moe_' + key]
}}%)
</td>
<td>
{{ demographics['us'][key] }}% ({{
demographics['us']['moe_' + key]
}}%)
</td>
</tr>
</tbody>
</table>
</div>
<div v-else>
<div class="content is-size-5">
<p>
Demographic information for insurance status and people with a
disability are not available for this location.
</p>
</div>
</div>
<table class="table">
<caption>
Disability &amp; insurance
</caption>
<thead>
<th scope="col">Condition</th>
<th scope="col">{{ placeName }}</th>
<th scope="col">Alaska</th>
<th scope="col">U.S.</th>
</thead>
<tbody>
<tr v-for="(name, key) in acs">
<th scope="row" v-html="name"></th>
<td>
{{ demographics['place'][key] }}% ({{
demographics['place']['moe_' + key]
}}%)
</td>
<td>
{{ demographics['alaska'][key] }}% ({{
demographics['alaska']['moe_' + key]
}}%)
</td>
<td>
{{ demographics['us'][key] }}% ({{
demographics['us']['moe_' + key]
}}%)
</td>
</tr>
</tbody>
</table>
</div>
<!-- If pct_asthma is missing/blank, the other conditions are as well. -->
<div class="block" v-if="demographics['place']['pct_asthma']">
<h5 class="title is-5">Health conditions</h5>
<h5 class="title is-5">Health conditions</h5>
<div class="block" v-if="healthConditionsPresent">
<div class="content is-size-5">
<p>Data in this section taken from CDC PLACES Year 2023.</p>
brucecrevensten marked this conversation as resolved.
Show resolved Hide resolved
</div>
Expand All @@ -63,6 +73,15 @@
</tbody>
</table>
</div>
<div v-else>
<div class="content is-size-5">
<p>
Demographic information health conditions (asthma, COPD, heart
brucecrevensten marked this conversation as resolved.
Show resolved Hide resolved
disease, stroke, chronic kidney disease) are not available for this
location.
</p>
</div>
</div>
</div>
</template>

Expand Down Expand Up @@ -105,6 +124,24 @@ export default {
}
},
computed: {
healthConditionsPresent() {
if (this.demographics) {
let sum = 0
Object.keys(this.conditions).forEach(k => {
sum += this.demographics['place'][k]
})
return sum > 0
}
},
disabilityInsurancePresent() {
if (this.demographics) {
let sum = 0
Object.keys(this.acs).forEach(k => {
sum += this.demographics['place'][k]
})
return sum > 0
}
},
...mapGetters({
demographics: 'demographics/demographicsData',
placeName: 'place/name',
Expand Down
61 changes: 42 additions & 19 deletions components/reports/demographics/DemographicsOther.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
<template>
<table class="table">
<caption>
Additional demographics
</caption>
<thead>
<th scope="col">Demographic</th>
<th scope="col">{{ placeName }}</th>
</thead>
<tbody>
<tr v-for="(name, key) in otherDemographics">
<th scope="row">{{ name }}</th>
<td>{{ demographics['place'][key] }}%</td>
</tr>
</tbody>
</table>
<div>
<div class="block" v-if="otherPresent">
<table class="table">
<caption>
Additional demographics
</caption>
<thead>
<th scope="col">Demographic</th>
<th scope="col">{{ placeName }}</th>
</thead>
<tbody>
<tr v-for="(name, key) in otherDemographics">
<th scope="row">{{ name }}</th>
<td>{{ demographics['place'][key] }}%</td>
</tr>
</tbody>
</table>
</div>
<div v-else>
<div class="content is-size-5">
<p>
Additional demographics (minority status, high school diploma, living
below 150% of poverty line, and broadband) are not available for this
location.
</p>
</div>
</div>
</div>
</template>

<style lang="scss" scoped>
Expand All @@ -31,6 +44,15 @@ import { formatting } from '~/mixins/formatting'
export default {
mixins: [formatting],
computed: {
otherPresent() {
if (this.demographics) {
let sum = 0
Object.keys(this.otherDemographics).forEach(k => {
sum += this.demographics['place'][k]
})
return sum > 0
}
},
...mapGetters({
demographics: 'demographics/demographicsData',
placeName: 'place/name',
Expand All @@ -39,10 +61,11 @@ export default {
data() {
return {
otherDemographics: {
pct_minority: "Persons of racial or ethnic minority status",
pct_no_hsdiploma: "No high school diploma among adults aged 25 years or older",
pct_below_150pov: "Persons living below 150% of the poverty level",
pct_no_bband: "No broadband internet subscription among households",
pct_minority: 'Persons of racial or ethnic minority status',
pct_no_hsdiploma:
'No high school diploma among adults aged 25 years or older',
pct_below_150pov: 'Persons living below 150% of the poverty level',
pct_no_bband: 'No broadband internet subscription among households',
},
}
},
Expand Down