Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jerem1508 committed Jun 19, 2024
1 parent 97def35 commit c9b3e8e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions client/src/pages/atlas/components/atlas-map/sub-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ export default function SubList() {
}
};

const maxValue = Math.max(
const maxValue: number = Math.max(
...dataHistoric.data.map(
(ter) =>
(ter: { data: { annee_universitaire: string; effectif: number }[] }) =>
ter.data.find((el) => el.annee_universitaire === currentYear)?.effectif
)
);
Expand All @@ -65,8 +65,14 @@ export default function SubList() {
</div>
</Row>
<ul style={{ overflow: "auto", listStyle: "none", padding: 0 }}>
{dataHistoric?.data.slice(0, 15).map((item) => {
const size = Math.round((item.data[0].effectif / maxValue) * 100);
{dataHistoric?.data.slice(0, 20).map((item) => {
const size = Math.round(
(item.data.find((el) => el.annee_universitaire === currentYear)
?.effectif *
100) /
maxValue
);

return (
<li>
<Row key={item.geo_nom} style={{ width: "100%" }}>
Expand Down

0 comments on commit c9b3e8e

Please sign in to comment.