Skip to content

Commit

Permalink
Merge pull request #20 from TheStanfordDaily/group-size-update
Browse files Browse the repository at this point in the history
allow for groups of 6, add 2019 housing data to _all file
  • Loading branch information
matthewr6 authored Apr 21, 2020
2 parents d0632a1 + 506f8e2 commit c867bff
Show file tree
Hide file tree
Showing 3 changed files with 3,815 additions and 7 deletions.
18 changes: 13 additions & 5 deletions src/calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const schema = {
},
applytype: {
title: "Group Size: ",
enum: [ "individual", "group_2", "group_3", "group_4" ],
enumNames: [ "Individual", "Group of 2", "Group of 3", "Group of 4" ]
enum: [ "individual", "group_2", "group_3", "group_4", 'group_5', 'group_6' ],
enumNames: [ "Individual", "Group of 2", "Group of 3", "Group of 4", 'Group of 5', 'Group of 6' ]
}
},
required: ["sex", "roomtype", "residence", "tiernumber", "applytype"],
Expand Down Expand Up @@ -119,7 +119,6 @@ function processTrends(gender, typeCol, resID, des_year) {
let item = currData[j];
if (item.year == prevYears[i] && (gender == "n" || item.sex == gender) && item.res_name_edited == resID) {
foundCutoff = true;

switch (typeCol) {
case "individual":
cutoffs.push(item.individual);
Expand All @@ -136,6 +135,15 @@ function processTrends(gender, typeCol, resID, des_year) {
case "group_4":
cutoffs.push(item.group_4);
cutoffsStr.push(item.group_4);
break;
case "group_5":
cutoffs.push(item.group_5);
cutoffsStr.push(item.group_5);
break;
case "group_6":
cutoffs.push(item.group_6);
cutoffsStr.push(item.group_6);
break;
}
if (cutoffs[cutoffs.length - 1] == "" || cutoffs[cutoffs.length - 1] == null) {
cutoffs.pop();
Expand Down Expand Up @@ -354,8 +362,8 @@ class Calculator extends React.Component {
},
applytype: {
title: "Group Size: ",
enum: [ "individual", "group_2", "group_3", "group_4" ],
enumNames: [ "Individual", "Group of 2", "Group of 3", "Group of 4" ]
enum: [ "individual", "group_2", "group_3", "group_4", 'group_5', 'group_6' ],
enumNames: [ "Individual", "Group of 2", "Group of 3", "Group of 4", 'Group of 5', 'Group of 6' ]
}
},
required: ["sex", "roomtype", "residence", "tiernumber", "applytype"],
Expand Down
Loading

0 comments on commit c867bff

Please sign in to comment.