Skip to content

Commit

Permalink
818: update language for acs tooltips (remove puma references) and in…
Browse files Browse the repository at this point in the history
…dicators methodology
  • Loading branch information
trbmcginnis committed Jan 29, 2021
1 parent 32f96a7 commit 41bc531
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 59 deletions.
14 changes: 14 additions & 0 deletions app/helpers/acs-cd-tooltip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { helper } from '@ember/component/helper';
import { tooltipText } from '../tooltips/tooltip-text';

export function buildTooltip(data) {
const {
cd_short_title,
} = data[0];

const communityDistrictTooltip = tooltipText.acs.communityDistrict(cd_short_title);

return communityDistrictTooltip;
}

export default helper(buildTooltip);
6 changes: 2 additions & 4 deletions app/helpers/acs-floodplain-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { tooltipText } from '../tooltips/tooltip-text';

export function buildTooltip(data) {
const {
puma,
cd_short_title,
} = data[0];

const acsFloodplain = tooltipText.acs.acsFloodplain(puma);
const cdApproximation = tooltipText.acs.cdApproximation(cd_short_title);
const acsFloodplain = tooltipText.acs.acsFloodplain(cd_short_title);

return acsFloodplain.concat(cdApproximation);
return acsFloodplain;
}

export default helper(buildTooltip);
20 changes: 0 additions & 20 deletions app/helpers/acs-puma-cd-tooltip.js

This file was deleted.

2 changes: 1 addition & 1 deletion app/templates/about.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="grid-x grid-padding-x">
<div class="cell xlarge-7">

<p>Indicators were carefully selected to present a snapshot across a broad range of conditions related to city planning. The {{fa-icon "info-circle"}} icon reveals an indicator’s source. Indicators using data from the American Community Survey (ACS) are calculated at the Public Use Microdata Area (PUMA) level. PUMAs are geographic approximations of community districts, but their boundaries differ slightly. <a href="http://www1.nyc.gov/assets/planning/download/pdf/data-maps/nyc-population/census2010/puma_cd_map.pdf" target="_blank">Use this map</a> to compare PUMA and community district boundaries. Some community districts share a PUMA with another district, and will therefore display identical values for ACS indicators. These paired districts include: Manhattan 1 and 2; Manhattan 4 and 5; Bronx 1 and 2; and Bronx 3 and 6. ACS population estimates are not available for districts that share a PUMA because they cannot be reliably disaggregated to each individual district.</p>
<p>Indicators were carefully selected to present a snapshot across a broad range of conditions related to city planning. The [i] icon reveals an indicator’s source. Most indicators rely on data from the American Community Survey (ACS) or Decennial Census. Community districts are NYC-specific geographic bounds, so the Census Bureau does not report data at the community district level. Instead, we need to compute community district estimates by approximating them from smaller census geographies. To do this, we aggregate data from blocks and block-groups based on a geographic lookup relating each census block and tract to the community district it falls within. Using this lookup, we aggregate count data, then recompute rate estimates and margins of error. This methodology is used to compute the intercensal total number of persons within a community district, which serves as the denominator for some non-ACS rate indicators (such as “crimes per 1000”).</p>

</div>
<div class="cell xlarge-5">
Expand Down
27 changes: 11 additions & 16 deletions app/templates/profile.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,13 @@
</div>
<div class="cell small-12 large-4 text-center cell-divider--population">
<span class="lead">
{{#if d.shared_puma}}
N/A
{{else}}
{{numeral-format d.pop_acs '0.0a'}}
{{/if}}
{{numeral-format d.pop_acs '0.0a'}}
</span>
<small class="stat-footer">2014-2018 Estimate {{info-tooltip tip="American Community Survey 5-year Estimates. Population estimate is N/A for districts that share a PUMA; data cannot be reliably disaggregated."}}</small>
</div>
</div>
</div>

<h4 class="subsection-header"><strong>Population by Age {{info-tooltip tip=(acs-puma-cd-tooltip d)}}</strong></h4>
<h4 class="subsection-header"><strong>Population by Age {{info-tooltip tip=(acs-cd-tooltip d)}}</strong></h4>
<div class="callout">
{{age-pyramid data=agePopDist}}
</div>
Expand Down Expand Up @@ -82,7 +77,7 @@
</div>
<div class="cell large-6 xlarge-8">

<h4 class="subsection-header"><strong>Foreign-Born Population {{info-tooltip tip=(acs-puma-cd-tooltip d)}}</strong></h4>
<h4 class="subsection-header"><strong>Foreign-Born Population {{info-tooltip tip=(acs-cd-tooltip d)}}</strong></h4>
<div class="callout text-center">
<span class="stat">
{{numeral-format d.pct_foreign_born '0.0'}}%
Expand All @@ -93,7 +88,7 @@
</div>
<div class="cell xlarge-10">

<h4 class="subsection-header"><strong>Race &amp; Hispanic Origin {{info-tooltip tip=(acs-puma-cd-tooltip d)}}</strong></h4>
<h4 class="subsection-header"><strong>Race &amp; Hispanic Origin {{info-tooltip tip=(acs-cd-tooltip d)}}</strong></h4>
<div class="callout">
{{horizontal-bar data=racialProfile height=150 barLabel=false xMax=100}}
</div>
Expand Down Expand Up @@ -132,7 +127,7 @@
{{#data.indicator class="indicator" name='Age Under 18'
column='under18_rate'
moe='moe_under18_rate'
tip=(acs-puma-cd-tooltip d)
tip=(acs-cd-tooltip d)
unit='%'
cd_stat=d.under18_rate
boro_stat=d.under18_rate_boro
Expand All @@ -142,7 +137,7 @@
{{#data.indicator class="indicator" name='Age 65 & Over'
column='over65_rate'
moe='moe_over65_rate'
tip=(acs-puma-cd-tooltip d)
tip=(acs-cd-tooltip d)
unit='%'
cd_stat=d.over65_rate
boro_stat=d.over65_rate_boro
Expand All @@ -152,7 +147,7 @@
{{#data.indicator class="indicator" name='Rent Burden'
column='pct_hh_rent_burd'
moe='moe_hh_rent_burd'
tip=(acs-puma-cd-tooltip d)
tip=(acs-cd-tooltip d)
unit='%'
cd_stat=d.pct_hh_rent_burd
boro_stat=d.pct_hh_rent_burd_boro
Expand All @@ -169,7 +164,7 @@
{{#data.indicator class="indicator" name='Mean Commute to Work'
column='mean_commute'
moe='moe_mean_commute'
tip=(acs-puma-cd-tooltip d)
tip=(acs-cd-tooltip d)
cd_stat=d.mean_commute
boro_stat=d.mean_commute_boro
city_stat=d.mean_commute_nyc}}
Expand All @@ -196,7 +191,7 @@
{{#data.indicator class="indicator" name='Educational Attainment'
column='pct_bach_deg'
moe='moe_bach_deg'
tip=(acs-puma-cd-tooltip d)
tip=(acs-cd-tooltip d)
unit='%'
cd_stat=d.pct_bach_deg
boro_stat=d.pct_bach_deg_boro
Expand All @@ -206,7 +201,7 @@
{{#data.indicator class="indicator" name='Limited English Proficiency'
column='lep_rate'
moe='moe_lep_rate'
tip=(acs-puma-cd-tooltip d)
tip=(acs-cd-tooltip d)
unit='%'
cd_stat=d.lep_rate
boro_stat=d.lep_rate_boro
Expand All @@ -216,7 +211,7 @@
{{#data.indicator class="indicator" name='Unemployment'
column='unemployment'
moe='moe_unemployment'
tip=(acs-puma-cd-tooltip d)
tip=(acs-cd-tooltip d)
unit='%'
cd_stat=d.unemployment
boro_stat=d.unemployment_boro
Expand Down
14 changes: 4 additions & 10 deletions app/tooltips/tooltip-text.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
export const tooltipText = {
acs: {
puma(puma) {
return `American Community Survey 2014-2018 5-Year Estimates for PUMA ${puma}, `;
communityDistrict(cd_short_title) {
return `American Community Survey 2014-2018 5-Year Estimates for ${cd_short_title}, approximated by aggregating data from blocks and block-groups.`;
},
cdApproximation(cd_short_title) {
return `which is an approximation of ${cd_short_title}.`;
},
cdApproximationShared(cd_short_title, shared_puma_cd) {
return `which is an approximation of both ${cd_short_title} and ${shared_puma_cd}.`;
},
acsFloodplain(puma) {
return `American Community Survey (ACS) 2013-2017 5-year estimates for floodplain area within PUMA ${puma}, `; // which is an approximation of ${cd_short_title}
acsFloodplain(cd_short_title) {
return `American Community Survey (ACS) 2014-2018 5-Year Estimates for floodplain area within ${cd_short_title}, approximated by aggregating data from blocks and block-groups.`;
},
},
census: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@

import { moduleForComponent, test } from 'ember-qunit';
import { buildTooltip } from '../../../helpers/acs-puma-cd-tooltip';
import { buildTooltip } from '../../../helpers/acs-cd-tooltip';

moduleForComponent('acs-puma-cd-tooltip', 'helper:acs-puma-cd-tooltip', {
moduleForComponent('acs-cd-tooltip', 'helper:acs-cd-tooltip', {
integration: true,
});

// Replace this with your real tests.
test('returns tooltip correctly', function(assert) {
const data = [{
puma: 444,
cd_short_title: 'Manhattan CD 2',
shared_puma: true,
shared_puma_cd: 'Manhattan CD 3',
}];

const tooltip = buildTooltip(data);

assert.equal(tooltip, 'American Community Survey 2014-2018 5-Year Estimates for PUMA 444, which is an approximation of both Manhattan CD 2 and Manhattan CD 3.');
assert.equal(tooltip, 'American Community Survey 2014-2018 5-Year Estimates for Manhattan CD 2, approximated by aggregating data from blocks and block-groups.');
});
3 changes: 1 addition & 2 deletions tests/integration/helpers/acs-floodplain-tooltip-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ moduleForComponent('acs-floodplain-tooltip', 'helper:acs-floodplain-tooltip', {

test('returns tooltip correctly', function(assert) {
const data = [{
puma: 444,
cd_short_title: 'Manhattan CD 2',
}];

const tooltip = buildTooltip(data);

assert.equal(tooltip, 'American Community Survey (ACS) 2013-2017 5-year estimates for floodplain area within PUMA 444, which is an approximation of Manhattan CD 2.');
assert.equal(tooltip, 'American Community Survey (ACS) 2014-2018 5-Year Estimates for floodplain area within Manhattan CD 2, approximated by aggregating data from blocks and block-groups.');
});

0 comments on commit 41bc531

Please sign in to comment.