diff --git a/app/helpers/acs-cd-tooltip.js b/app/helpers/acs-cd-tooltip.js new file mode 100644 index 00000000..d44299cc --- /dev/null +++ b/app/helpers/acs-cd-tooltip.js @@ -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); diff --git a/app/helpers/acs-floodplain-tooltip.js b/app/helpers/acs-floodplain-tooltip.js index a59679e4..9082fe4b 100644 --- a/app/helpers/acs-floodplain-tooltip.js +++ b/app/helpers/acs-floodplain-tooltip.js @@ -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); diff --git a/app/helpers/acs-puma-cd-tooltip.js b/app/helpers/acs-puma-cd-tooltip.js deleted file mode 100644 index 79c2a139..00000000 --- a/app/helpers/acs-puma-cd-tooltip.js +++ /dev/null @@ -1,20 +0,0 @@ -import { helper } from '@ember/component/helper'; -import { tooltipText } from '../tooltips/tooltip-text'; - -export function buildTooltip(data) { - const { - puma, - cd_short_title, - shared_puma, - shared_puma_cd, - } = data[0]; - - const pumaTooltip = tooltipText.acs.puma(puma); - const cdApproximation = tooltipText.acs.cdApproximation(cd_short_title); - const cdApproximationShared = tooltipText.acs.cdApproximationShared(cd_short_title, shared_puma_cd); - - const concatenatedCdApproximation = shared_puma ? cdApproximationShared : cdApproximation; - return pumaTooltip.concat(concatenatedCdApproximation); -} - -export default helper(buildTooltip); diff --git a/app/templates/about.hbs b/app/templates/about.hbs index ffad4238..1b7edc64 100644 --- a/app/templates/about.hbs +++ b/app/templates/about.hbs @@ -15,7 +15,7 @@
-

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. Use this map 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.

+

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”).

diff --git a/app/templates/profile.hbs b/app/templates/profile.hbs index 2dafe8cb..b6404209 100644 --- a/app/templates/profile.hbs +++ b/app/templates/profile.hbs @@ -43,18 +43,13 @@
- {{#if d.shared_puma}} - N/A - {{else}} - {{numeral-format d.pop_acs '0.0a'}} - {{/if}} + {{numeral-format d.pop_acs '0.0a'}} - 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."}}
-

Population by Age {{info-tooltip tip=(acs-puma-cd-tooltip d)}}

+

Population by Age {{info-tooltip tip=(acs-cd-tooltip d)}}

{{age-pyramid data=agePopDist}}
@@ -82,7 +77,7 @@
-

Foreign-Born Population {{info-tooltip tip=(acs-puma-cd-tooltip d)}}

+

Foreign-Born Population {{info-tooltip tip=(acs-cd-tooltip d)}}

{{numeral-format d.pct_foreign_born '0.0'}}% @@ -93,7 +88,7 @@
-

Race & Hispanic Origin {{info-tooltip tip=(acs-puma-cd-tooltip d)}}

+

Race & Hispanic Origin {{info-tooltip tip=(acs-cd-tooltip d)}}

{{horizontal-bar data=racialProfile height=150 barLabel=false xMax=100}}
@@ -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 @@ -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 @@ -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 @@ -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}} @@ -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 @@ -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 @@ -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 diff --git a/app/tooltips/tooltip-text.js b/app/tooltips/tooltip-text.js index d27c1fb0..cdfd37e4 100644 --- a/app/tooltips/tooltip-text.js +++ b/app/tooltips/tooltip-text.js @@ -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: { diff --git a/tests/integration/helpers/acs-puma-cd-tooltip-test.js b/tests/integration/helpers/acs-cd-tooltip-test.js similarity index 51% rename from tests/integration/helpers/acs-puma-cd-tooltip-test.js rename to tests/integration/helpers/acs-cd-tooltip-test.js index 78cfa447..f251abb0 100644 --- a/tests/integration/helpers/acs-puma-cd-tooltip-test.js +++ b/tests/integration/helpers/acs-cd-tooltip-test.js @@ -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.'); }); diff --git a/tests/integration/helpers/acs-floodplain-tooltip-test.js b/tests/integration/helpers/acs-floodplain-tooltip-test.js index 434b3586..57bf2dc0 100644 --- a/tests/integration/helpers/acs-floodplain-tooltip-test.js +++ b/tests/integration/helpers/acs-floodplain-tooltip-test.js @@ -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.'); });