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

Merge user interview sign up banner to master #1114

Merged
merged 8 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You will need the following things properly installed on your computer.
- Clone this repo `https://github.com/NYCPlanning/labs-nyc-factfinder.git`
- Install Dependencies `yarn`
- Start the server `yarn run start`
- If running labs-factfinder-api and labs-layers-api locally, instead start the server with `yarn run local-api`
- If running labs-factfinder-api and labs-layers-api locally, instead start the server with `yarn run start:local-api`
- Run tests: `yarn test`

## Architecture
Expand Down
22 changes: 22 additions & 0 deletions app/chart-config/census/household-size.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export default [
{
property: 'hh1person',
label: '1-person household',
},
{
property: 'hh2ppl',
label: '2-person household',
},
{
property: 'hh3ppl',
label: '3-person household',
},
{
property: 'hh4ppl',
label: '4-person household',
},
{
property: 'hh5plppl',
label: '5-or-more person household',
},
];
10 changes: 10 additions & 0 deletions app/chart-config/census/household-type.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default [
{
property: 'fam',
label: 'Family households (families)',
},
{
property: 'nfamhh',
label: 'Nonfamily households',
},
];
10 changes: 10 additions & 0 deletions app/chart-config/census/housing-tenure.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default [
{
property: 'oochu_1',
label: 'Owner-occupied housing units',
},
{
property: 'rochu_1',
label: 'Renter-occupied housing units',
},
];
6 changes: 6 additions & 0 deletions app/chart-config/census/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import householdSize from './household-size';
import householdType from './household-type';
import housingTenure from './housing-tenure';
import raceGroup from './race-group';

export default {
householdSize,
householdType,
housingTenure,
raceGroup,
};
6 changes: 3 additions & 3 deletions app/choropleth-config/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const choroplethConfigs = [
{
group: 'Census',
id: 'popperacre',
id: 'popacre',
label: 'Population Density',
tooltip: 'Persons per acre',
legendTitle: 'Persons per Acre',
Expand Down Expand Up @@ -172,7 +172,7 @@ const choroplethConfigs = [
},
{
group: 'Census',
id: 'popu18_1',
id: 'popu18',
label: 'Under 18',
tooltip: 'Population under 18 years, 2020',
legendTitle: 'Under 18',
Expand Down Expand Up @@ -271,7 +271,7 @@ const choroplethConfigs = [
// Percent
{
group: 'Census',
id: 'popu18_1p',
id: 'popu18p',
label: 'Under 18 (percent)',
tooltip: 'Percent of the population under 18 years, 2020',
legendTitle: 'Under 18 (percent)',
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') {
if (previous && (typeof previous.sum === 'undefined' || previous.sum === null)) {
return true
}
return false
Expand Down
2 changes: 1 addition & 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') {
if (previous && (typeof previous.sum === 'undefined' || previous.sum === null)) {
return true
}
return false
Expand Down
8 changes: 6 additions & 2 deletions app/components/explorer/source-select-dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,17 @@ export default class SourceSelectDropdownComponent extends Component {
}

get showACS() {
if(['districts', 'blocks'].includes(this.args.geotype)) {
if(['districts', 'blocks', 'ccds'].includes(this.args.geotype)) {
return false;
}
return true;
}

get showDistrictACSWarning() {
return this.args.geotype === 'districts';
}
}

get showCCDACSWarning() {
return this.args.geotype === 'ccds';
}
}
2 changes: 1 addition & 1 deletion app/components/labs-ui/layer-group-toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default Component.extend({
eventAction: 'Toggle Thematic Map',
eventLabel: this.get('active'),
});
} else if (["Subways", "ZIP Codes", "Neighborhood Tabulation Areas (NTAs)", "Community Districts (CDs)", "Community District Tabulation Areas (CDTAs)", "NYC Council Districts"].includes(this.get('label'))){
} else if (["Subways", "ZIP Codes", "Neighborhood Tabulation Areas (NTAs)", "Community Districts (CDs)", "Community District Tabulation Areas (CDTAs)", "City Council Districts (CCDs)"].includes(this.get('label'))){
// Only count toggle on, not toggle off
if (this.get('active')) {
window.dataLayer.push({
Expand Down
2 changes: 1 addition & 1 deletion app/components/map-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default Component.extend({
mode: 'direct-select',
advanced: false,

choroplethMode: 'popperacre',
choroplethMode: 'popacre',

summaryLevel: alias('selection.summaryLevel'),

Expand Down
7 changes: 6 additions & 1 deletion app/components/map-utility-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default Component.extend({
mode: 'direct-select',
advanced: false,

choroplethMode: 'popperacre',
choroplethMode: 'popacre',

summaryLevel: alias('selection.summaryLevel'),

Expand Down Expand Up @@ -146,6 +146,11 @@ 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']))) {
queryParams['source'] = 'decennial-current';
}

if (geoids.length > 1) {
this.get('generateExplorerPageTask').perform(type, geoids, queryParams);
} else if (geoids.length === 1){
Expand Down
Loading
Loading