Affichage de la nuance et du bloc dans le tableau des résultats
This commit is contained in:
		@@ -16,7 +16,7 @@ import {useEffect, useState} from "react"
 | 
			
		||||
 | 
			
		||||
highchartsItem(Highcharts)
 | 
			
		||||
 | 
			
		||||
function ResultatsTable({listes, resultats, siegesParListe}) {
 | 
			
		||||
function ResultatsTable({blocs, nuances, listes, resultats, siegesParListe}) {
 | 
			
		||||
  const voix_listes = resultats.voix_listes
 | 
			
		||||
  const listes_triees = listes.toSorted((l1, l2) => {
 | 
			
		||||
    return (voix_listes[l2.numero] || 0) - (voix_listes[l1.numero] || 0)
 | 
			
		||||
@@ -29,6 +29,8 @@ function ResultatsTable({listes, resultats, siegesParListe}) {
 | 
			
		||||
          <TableRow>
 | 
			
		||||
            <TableCell>Numéro</TableCell>
 | 
			
		||||
            <TableCell>Liste</TableCell>
 | 
			
		||||
            <TableCell colSpan={2}>Nuance</TableCell>
 | 
			
		||||
            <TableCell colSpan={2}>Bloc</TableCell>
 | 
			
		||||
            <TableCell>Voix</TableCell>
 | 
			
		||||
            <TableCell>% Inscrit⋅es</TableCell>
 | 
			
		||||
            <TableCell>% Exprimé⋅es</TableCell>
 | 
			
		||||
@@ -40,6 +42,10 @@ function ResultatsTable({listes, resultats, siegesParListe}) {
 | 
			
		||||
            <TableRow key={liste.numero}>
 | 
			
		||||
              <TableCell>{liste.numero}</TableCell>
 | 
			
		||||
              <TableCell>{liste.nom}</TableCell>
 | 
			
		||||
              <TableCell bgColor={nuances.filter(nuance => nuance.code === liste.nuance)[0].couleur} sx={{padding: "0.2em"}}></TableCell>
 | 
			
		||||
              <TableCell>{liste.nuance}</TableCell>
 | 
			
		||||
              <TableCell bgColor={blocs.filter(bloc => bloc.nom === liste.bloc)[0].couleur} sx={{padding: "0.2em"}}></TableCell>
 | 
			
		||||
              <TableCell>{liste.bloc}</TableCell>
 | 
			
		||||
              <TableCell>{voix_listes[liste.numero] || 0}</TableCell>
 | 
			
		||||
              <TableCell>{(100 * (voix_listes[liste.numero] || 0) / resultats.exprimes).toFixed(2)} %</TableCell>
 | 
			
		||||
              <TableCell>{(100 * (voix_listes[liste.numero] || 0) / resultats.inscrits).toFixed(2)} %</TableCell>
 | 
			
		||||
@@ -329,7 +335,7 @@ export default function Election2024({typeResultats = "france"}) {
 | 
			
		||||
      highcharts={Highcharts}
 | 
			
		||||
      options={compositonOptions}
 | 
			
		||||
    />
 | 
			
		||||
    <ResultatsTable listes={listes} resultats={resultats} siegesParListe={siegesParListe} />
 | 
			
		||||
    <ResultatsTable blocs={blocs} nuances={nuances} listes={listes} resultats={resultats} siegesParListe={siegesParListe} />
 | 
			
		||||
    <ParticipationTable resultats={resultats} />
 | 
			
		||||
  </>
 | 
			
		||||
};
 | 
			
		||||
		Reference in New Issue
	
	Block a user