Skip to content

Commit

Permalink
Hide habitats with no data in habitat widget
Browse files Browse the repository at this point in the history
  • Loading branch information
clementprdhomme committed Oct 11, 2024
1 parent 6579d51 commit 84c4524
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,12 @@ const HabitatWidget: FCWithMessages<HabitatWidgetProps> = ({ location }) => {
};
});

return parsedData.sort((d1, d2) => {
const keys = Object.keys(HABITAT_CHART_COLORS);
return keys.indexOf(d1.slug) - keys.indexOf(d2.slug);
});
return parsedData
.sort((d1, d2) => {
const keys = Object.keys(HABITAT_CHART_COLORS);
return keys.indexOf(d1.slug) - keys.indexOf(d2.slug);
})
.filter(({ totalArea }) => totalArea !== 0);
},
placeholderData: [],
refetchOnWindowFocus: false,
Expand Down

0 comments on commit 84c4524

Please sign in to comment.