Skip to content

Commit

Permalink
Merge pull request #1206 from NYCPlanning/staging
Browse files Browse the repository at this point in the history
Staging to Master (PFF Data Updates)
  • Loading branch information
TylerMatteo authored May 23, 2024
2 parents 35d9751 + 0735a91 commit 7a415d2
Show file tree
Hide file tree
Showing 24 changed files with 1,433 additions and 294 deletions.
43 changes: 21 additions & 22 deletions app/choropleth-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,6 @@ const choroplethConfigs = [
'#e54444',
],
},
{
group: 'Demographic (ACS)',
id: 'pop65pl1',
label: '65 Years and Over',
tooltip: 'Population 65 years and over',
legendTitle: 'Population 65 years and over',
stops: [
'#f2f2a2',
4000,
'#efc68a',
8000,
'#e99963',
12000,
'#e56d44',
15000,
'#e54444',
],
},
{
group: 'Social (ACS)',
id: 'ea_bchdh',
Expand Down Expand Up @@ -84,7 +66,7 @@ const choroplethConfigs = [
legendTitle: 'Percent foreign-born population',
stops: [
'#f2f2a2',
25,
20,
'#efc68a',
35,
'#e99963',
Expand Down Expand Up @@ -139,13 +121,13 @@ const choroplethConfigs = [
label: 'Below Poverty (percent)',
tooltip: 'Percent of population whose income is below the poverty level',
legendTitle: 'Percent of population below poverty level',
stops: ['#f2f2a2', 12, '#efc68a', 20, '#e56d44', 40, '#e54444'],
stops: ['#f2f2a2', 15, '#efc68a', 30, '#e56d44', 40, '#e54444'],
},
{
group: 'Housing (ACS)',
id: 'mdgr',
label: 'Median Gross Rent',
tooltip: 'Median gross rent (in 2020 inflation-adjusted dollars)',
tooltip: 'Median gross rent (in 2022 inflation-adjusted dollars)',
legendTitle: 'Median Gross Rent',
stops: ['#f2f2a2', 1500, '#efc68a', 2000, '#e56d44', 2500, '#e54444'],
},
Expand Down Expand Up @@ -188,6 +170,24 @@ const choroplethConfigs = [
'#e54444',
],
},
{
group: 'Census',
id: 'pop65pl1',
label: '65 Years and Over',
tooltip: 'Population 65 years and over',
legendTitle: 'Population 65 years and over',
stops: [
'#f2f2a2',
4000,
'#efc68a',
6000,
'#e99963',
8000,
'#e56d44',
10000,
'#e54444',
],
},
{
group: 'Census',
id: 'wnh',
Expand Down Expand Up @@ -645,7 +645,6 @@ const MINIMUM_RACIAL_COUNT = 5000;
// For all other variables, or for racial group percent change when the count is above the minimum,
// fill color is simply determined by the "steps" array
const buildPaintFill = (id, minimum, stops) => {

const racialPercentChangeIds = ['wnh_pc', 'bnh_pc', 'anh_pc', 'hsp1_pc'];

return racialPercentChangeIds.includes(id)
Expand Down
2 changes: 1 addition & 1 deletion app/components/data-table-row-change.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default Component.extend({

noPriorData: computed('data.previous.sum', function() {
const { 'data.previous': previous } = this.getProperties('data.previous');
if (previous && (typeof previous.sum === 'undefined' || previous.sum === null)) {
if ((previous && (typeof previous.sum === 'undefined' || previous.sum === null)) || typeof previous === 'undefined') {
return true
}
return false
Expand Down
3 changes: 2 additions & 1 deletion app/components/data-table-row-previous.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default Component.extend({

noPriorData: computed('data.previous.sum', function() {
const { 'data.previous': previous } = this.getProperties('data.previous');
if (previous && (typeof previous.sum === 'undefined' || previous.sum === null)) {
if ((previous && (typeof previous.sum === 'undefined' || previous.sum === null)) || typeof previous === 'undefined') {
return true
}
return false
Expand All @@ -46,6 +46,7 @@ export default Component.extend({
},

click() {
console.log('click - data table', this);
this.set('isSelected', !this.isSelected);
},
});
2 changes: 1 addition & 1 deletion app/components/explorer/source-select-dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class SourceSelectDropdownComponent extends Component {
}

get showACS() {
if(['districts', 'blocks', 'ccds'].includes(this.args.geotype)) {
if(['districts', 'blocks'].includes(this.args.geotype)) {
return false;
}
return true;
Expand Down
4 changes: 2 additions & 2 deletions app/components/map-utility-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ export default Component.extend({
})
}

// Reset the source for geotypes that do not have ACS data
if ((['ccds', 'districts'].includes(type)) && (['acs-current', 'acs-previous', 'acs-change'].includes(queryParams['source']))) {
// Reset the source for geotypes that do not have ACS data.
if ((['districts'].includes(type)) && (['acs-current', 'acs-previous', 'acs-change'].includes(queryParams['source']))) {
queryParams['source'] = 'decennial-current';
}

Expand Down
Loading

0 comments on commit 7a415d2

Please sign in to comment.