Skip to content

Commit b52c527

Browse files
committed
ajout affichage sp statistiques
1 parent 081d514 commit b52c527

4 files changed

Lines changed: 61 additions & 1 deletion

File tree

src/app/rightpanel/content/localisation-info/localisation-info.component.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
margin-top: 0px;
3636
}
3737

38+
.fr-tables--infos-nomargin {
39+
margin-bottom: 0px !important;
40+
}
41+
3842
.td-right, .th-right, .th-right-sp {
3943
text-align: center;
4044
}

src/app/rightpanel/content/localisation-info/localisation-info.component.html

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ <h6 class="fr-h6">Données socio-économiques</h6>
331331

332332
<h6 class="fr-h6">Données administratives</h6>
333333

334-
<div class="fr-table fr-table--bordered fr-table--infos">
334+
<div class="fr-table fr-table--bordered fr-table--infos fr-tables--infos-nomargin">
335335
<div class="fr-table__wrapper fr-table-wrapper-cartosp">
336336
<div class="fr-table__container">
337337
<div class="fr-table__content">
@@ -367,6 +367,44 @@ <h6 class="fr-h6">Données administratives</h6>
367367
</div>
368368
</div>
369369
</div>
370+
@if(spStatistiques){
371+
<div class="fr-table fr-table--bordered fr-table--infos">
372+
<div class="fr-table__wrapper fr-table-wrapper-cartosp">
373+
<div class="fr-table__container">
374+
<div class="fr-table__content">
375+
<table>
376+
<thead>
377+
<tr>
378+
<th class="th-left th-left-sp">
379+
<div class="th-content">
380+
Nombre de points d'accueil pour 100 000 hts
381+
<button class="fr-btn--tooltip fr-btn" type="button" id="button-nbpa100000" aria-describedby="tooltip-nbpa100000">
382+
Source
383+
</button>
384+
<span class="fr-tooltip fr-placement" id="tooltip-nbpa100000" role="tooltip" aria-hidden="true">TODO <br> Insee, 2024</span>
385+
</div>
386+
</th>
387+
<th class="th-right-sp">{{ formatNumberReal(spStatistiques.sp_pour_100000_habitants || 0, '1.2-2') }}</th>
388+
</tr>
389+
</thead>
390+
<tr>
391+
<td class="td-left-sp">Val. nat.</td>
392+
<td class="td-right-sp">{{ formatNumberReal(spStatistiques.sp_pour_100000_habitants_moyenne_nationale || 0, '1.2-2') }}</td>
393+
</tr>
394+
<tr>
395+
<td class="td-left-sp">Min</td>
396+
<td class="td-right-sp">{{ formatNumberReal(spStatistiques.sp_pour_100000_habitants_min || 0, '1.2-2') }}</td>
397+
</tr>
398+
<tr>
399+
<td class="td-left-sp">Max</td>
400+
<td class="td-right-sp">{{ formatNumberReal(spStatistiques.sp_pour_100000_habitants_max || 0, '1.2-2') }}</td>
401+
</tr>
402+
</table>
403+
</div>
404+
</div>
405+
</div>
406+
</div>
407+
}
370408
</dsfr-tab>
371409
<!-- Onglet accès aux isochrones -->
372410
<dsfr-tab

src/app/rightpanel/content/localisation-info/localisation-info.component.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export class LocalisationInfoComponent implements OnInit, OnDestroy {
2828
nbitinerants?: number;
2929
nbpermanences?: number;
3030
nbtotal?: number;
31+
spStatistiques?: any;
3132
isochrones: any[] = [];
3233
private decimalPipe = inject(DecimalPipe);
3334
apidata = {
@@ -260,6 +261,16 @@ export class LocalisationInfoComponent implements OnInit, OnDestroy {
260261
},
261262
error : (error: any) => { console.error('Error fetching total count info:', error) }
262263
});
264+
265+
this.apicartospService.getSpStatistiques(totalOptions).subscribe({
266+
next : (response: any) => {
267+
this.spStatistiques = response;
268+
},
269+
error : (error: any) => {
270+
this.spStatistiques = null;
271+
console.error('Error fetching SP statistiques info:', error)
272+
}
273+
});
263274
}
264275

265276
onButtonBackLocationClic(){

src/app/services/apicartosp.service.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,11 @@ export class ApicartospService {
5959
params: options
6060
});
6161
}
62+
63+
// Get SP statistics by typologie and departement
64+
getSpStatistiques(options: any): Observable<any> {
65+
return this.http.get(this.apiUrl + "/services_publics/statistiques",{
66+
params: options
67+
});
68+
}
6269
}

0 commit comments

Comments
 (0)