Skip to content

Commit

Permalink
Merge pull request #230 from pph-collective/fix-hotspot-chart
Browse files Browse the repository at this point in the history
fix: hotspot chart domain
  • Loading branch information
eldu authored Apr 18, 2024
2 parents 25f8b63 + a8b3ba0 commit fe58003
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/components/dashboard/HotspotCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<HotspotChart
:active-stats="activeStats"
:field-data="fieldData"
:domain-max="maxInclAll?.rate * 1.35"
:domain-max="maxRate * 1.35"
/>
</div>
<div class="centered">
Expand Down Expand Up @@ -213,13 +213,9 @@ const maxRace = computed(() => {
return activeStats.value.find(({ name }) => name === "All Residents");
});
const maxInclAll = computed(() => {
for (const activeStat of activeStats.value) {
if (!isNaN(activeStat.rate)) {
return activeStat;
}
}
return activeStats.value[0];
const maxRate = computed(() => {
const rates = activeStats.value.map((stat) => isNaN(stat.rate) ? 0 : stat.rate)
return Math.max(...rates)
});
const activeFocusStats = computed(() => {
Expand Down

0 comments on commit fe58003

Please sign in to comment.