Skip to content

Commit

Permalink
Merge pull request #59 from vkoves/issue-53-no-stats-bug
Browse files Browse the repository at this point in the history
Fix Buildings With Old Stats (like United Center) Not Rendering
  • Loading branch information
vkoves authored Dec 3, 2023
2 parents bb8723b + 319c60a commit 750232c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/StatTile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export default class StatTile extends Vue {
get isAboveMedian(): boolean {
return this.building[this.statKey] !== null &&
this.building[this.statKey] as number > this.stats[this.statKey].median;
this.building[this.statKey] as number > this.stats[this.statKey].median;
}
// Square footage isn't directly climate related, so we show stats but treat it as
Expand Down Expand Up @@ -294,6 +294,9 @@ export default class StatTile extends Vue {
}
get medianMultiplePropertyType(): string | null {
if (!this.BuildingStatsByPropertyType[this.propertyType]) {
return null;
}
const median = this.BuildingStatsByPropertyType[this.propertyType][this.statKey]?.median;
const statValueNum = parseFloat(this.building[this.statKey] as string);
Expand Down Expand Up @@ -330,6 +333,9 @@ export default class StatTile extends Vue {
get propertiesToAwardThisType(): number {
const properStatBlock = this.BuildingStatsByPropertyType[this.propertyType];
if (!properStatBlock) {
return 0;
}
const numBuildingsOfType = properStatBlock[this.statKey]?.count;
/**
Expand Down Expand Up @@ -376,6 +382,9 @@ export default class StatTile extends Vue {
*/
get propertyStatRankInverted(): number | null {
const properStatBlock = this.BuildingStatsByPropertyType[this.propertyType];
if (!properStatBlock) {
return null;
}
const numBuildingsOfType: number = properStatBlock[this.statKey]?.count;
const statRank = this.building[this.statKey + 'RankByPropertyType'] as string;
Expand Down

0 comments on commit 750232c

Please sign in to comment.