NREL / floorspace.js

Other
68 stars 36 forks source link

Support building types #397

Closed benfen closed 3 years ago

benfen commented 3 years ago

Resolves https://github.com/NREL/floorspace.js/issues/363

Adds in a select field for building types in the assignment section of the UI. There is a default list of building types provided for the project, but the user can modify the list however they want. There is also a freeform text input for template that has been added. The building_unit field of a space is used to bind spaces into the same building. Modifying the building type of a space that shares the same building unit as another space will change the building type of that space as well; conversely, modifying the building unit of a space will change that space's building type to match the building type of all spaces in that building unit.

In addition to this, the space types select now reacts to changes in building type and template to pre-generate a list of space types for recognized combinations of building type and template. These space types are always appended after user-defined space types.

The list of space types was pulled from here. I'm not sure what to do with the extra information stored there - I assume we can just drop it for now, but would appreciate clarification. Once I have that I can clean up the helpers.js file all that code got dumped into.