@@ -22,13 +22,13 @@ HCExportingData(Highcharts);
22
22
23
23
export default function StructureEtudiantsPage ( ) {
24
24
const { id, url } = useUrl ( 'keynumbers' ) ;
25
- const { data, error, isLoading } = useFetch ( `${ url } /population` ) ;
25
+ const { data, error, isLoading } = useFetch ( `${ url } /population?sort=annee ` ) ;
26
26
27
27
// eslint-disable-next-line no-nested-ternary
28
- const sortedData = data ?. data ?. sort ( ( a , b ) => ( ( b . annee > a . annee ) ? 1 : ( ( a . annee > b . annee ) ? - 1 : 0 ) ) ) || [ ] ;
29
- const lastData = sortedData ?. [ sortedData . length - 1 ] ;
28
+ const allData = data ?. data || [ ] ;
29
+ const lastData = allData ?. [ allData . length - 1 ] ;
30
30
const year = lastData ?. annee_universitaire || '' ;
31
- const categories = sortedData . map ( ( item ) => item . annee ) ;
31
+ const categories = allData . map ( ( item ) => item . annee ) ;
32
32
const commonOptions = {
33
33
credits : { enabled : false } ,
34
34
lang : {
@@ -243,7 +243,7 @@ export default function StructureEtudiantsPage() {
243
243
...commonOptions ,
244
244
series : [ {
245
245
name : lastData ?. etablissement_lib || 'Structure sans nom' ,
246
- data : sortedData . map ( ( item ) => item ?. effectif || 0 ) ,
246
+ data : allData . map ( ( item ) => item ?. effectif || 0 ) ,
247
247
} ] ,
248
248
title : { text : 'Evolution des effectifs' } ,
249
249
} ;
@@ -253,15 +253,15 @@ export default function StructureEtudiantsPage() {
253
253
series : [
254
254
{
255
255
name : 'Etudiants inscrits en 1er cycle' ,
256
- data : sortedData . map ( ( item ) => item ?. cursus_lmdl || 0 ) ,
256
+ data : allData . map ( ( item ) => item ?. cursus_lmdl || 0 ) ,
257
257
} ,
258
258
{
259
259
name : 'Etudiants inscrits en 2ème cycle' ,
260
- data : sortedData . map ( ( item ) => item ?. cursus_lmdm || 0 ) ,
260
+ data : allData . map ( ( item ) => item ?. cursus_lmdm || 0 ) ,
261
261
} ,
262
262
{
263
263
name : 'Etudiants inscrits en 3ème cycle' ,
264
- data : sortedData . map ( ( item ) => item ?. cursus_lmdd || 0 ) ,
264
+ data : allData . map ( ( item ) => item ?. cursus_lmdd || 0 ) ,
265
265
} ,
266
266
] ,
267
267
title : { text : 'Évolution des effectifs par cycle' } ,
@@ -272,23 +272,23 @@ export default function StructureEtudiantsPage() {
272
272
series : [
273
273
{
274
274
name : 'Etudiants inscrits en Droit, sciences économiques, AES' ,
275
- data : sortedData . map ( ( item ) => item ?. gd_discisciplinedsa || 0 ) ,
275
+ data : allData . map ( ( item ) => item ?. gd_discisciplinedsa || 0 ) ,
276
276
} ,
277
277
{
278
278
name : 'Etudiants inscrits en Lettres, langues et sciences humaines' ,
279
- data : sortedData . map ( ( item ) => item ?. gd_discisciplinellsh || 0 ) ,
279
+ data : allData . map ( ( item ) => item ?. gd_discisciplinellsh || 0 ) ,
280
280
} ,
281
281
{
282
282
name : 'Etudiants inscrits en Sciences et sciences de l\'ingénieur' ,
283
- data : sortedData . map ( ( item ) => item ?. gd_discisciplinesi || 0 ) ,
283
+ data : allData . map ( ( item ) => item ?. gd_discisciplinesi || 0 ) ,
284
284
} ,
285
285
{
286
286
name : 'Etudiants inscrits en STAPS' ,
287
- data : sortedData . map ( ( item ) => item ?. gd_discisciplinestaps || 0 ) ,
287
+ data : allData . map ( ( item ) => item ?. gd_discisciplinestaps || 0 ) ,
288
288
} ,
289
289
{
290
290
name : 'Etudiants inscrits en Santé' ,
291
- data : sortedData . map ( ( item ) => item ?. gd_discisciplinesante || 0 ) ,
291
+ data : allData . map ( ( item ) => item ?. gd_discisciplinesante || 0 ) ,
292
292
} ,
293
293
] ,
294
294
title : { text : 'Évolution des effectifs par discipline' } ,
@@ -299,23 +299,23 @@ export default function StructureEtudiantsPage() {
299
299
series : [
300
300
{
301
301
name : 'Etudiants inscrits préparant un diplôme universitaire de technologie' ,
302
- data : sortedData . map ( ( item ) => item ?. diplomedut || 0 ) ,
302
+ data : allData . map ( ( item ) => item ?. diplomedut || 0 ) ,
303
303
} ,
304
304
{
305
305
name : 'Etudiants inscrits en Licence' ,
306
- data : sortedData . map ( ( item ) => item ?. diplomelic_l_aut || 0 ) ,
306
+ data : allData . map ( ( item ) => item ?. diplomelic_l_aut || 0 ) ,
307
307
} ,
308
308
{
309
309
name : 'Etudiants inscrits en Master' ,
310
- data : sortedData . map ( ( item ) => ( item ?. diplomemast_m_autres || 0 ) + ( item ?. diplomemast_m_enseignement || 0 ) ) ,
310
+ data : allData . map ( ( item ) => ( item ?. diplomemast_m_autres || 0 ) + ( item ?. diplomemast_m_enseignement || 0 ) ) ,
311
311
} ,
312
312
{
313
313
name : 'Etudiants inscrits en formations d\'ingénieurs' ,
314
- data : sortedData . map ( ( item ) => item ?. diplomeing || 0 ) ,
314
+ data : allData . map ( ( item ) => item ?. diplomeing || 0 ) ,
315
315
} ,
316
316
{
317
317
name : 'Etudiants inscrits en Doctorat' ,
318
- data : sortedData . map ( ( item ) => item ?. diplomehdr || 0 ) ,
318
+ data : allData . map ( ( item ) => item ?. diplomehdr || 0 ) ,
319
319
} ,
320
320
] ,
321
321
title : { text : 'Évolution des effectifs dans les principaux diplômes' } ,
@@ -326,39 +326,39 @@ export default function StructureEtudiantsPage() {
326
326
series : [
327
327
{
328
328
name : 'Etudiants inscrits préparant un diplôme d\'accès aux études universitaires' ,
329
- data : sortedData . map ( ( item ) => item ?. diplomedaeu || 0 ) ,
329
+ data : allData . map ( ( item ) => item ?. diplomedaeu || 0 ) ,
330
330
} ,
331
331
{
332
332
name : 'Etudiants inscrits en Capacité en droit' ,
333
- data : sortedData . map ( ( item ) => item ?. diplomecapa || 0 ) ,
333
+ data : allData . map ( ( item ) => item ?. diplomecapa || 0 ) ,
334
334
} ,
335
335
{
336
336
name : 'Etudiants inscrits en Licence professionnelle' ,
337
- data : sortedData . map ( ( item ) => item ?. diplomelic_pro || 0 ) ,
337
+ data : allData . map ( ( item ) => item ?. diplomelic_pro || 0 ) ,
338
338
} ,
339
339
{
340
340
name : 'Etudiants inscrits en Master enseignement (dont)' ,
341
- data : sortedData . map ( ( item ) => item ?. diplomemast_m_enseignement || 0 ) ,
341
+ data : allData . map ( ( item ) => item ?. diplomemast_m_enseignement || 0 ) ,
342
342
} ,
343
343
{
344
344
name : 'Etudiants inscrits en PACES' ,
345
- data : sortedData . map ( ( item ) => item ?. diplomesante_paces || 0 ) ,
345
+ data : allData . map ( ( item ) => item ?. diplomesante_paces || 0 ) ,
346
346
} ,
347
347
{
348
348
name : 'Etudiants inscrits dans les formations paramédicales' ,
349
- data : sortedData . map ( ( item ) => item ?. diplomesante_paramedical || 0 ) ,
349
+ data : allData . map ( ( item ) => item ?. diplomesante_paramedical || 0 ) ,
350
350
} ,
351
351
{
352
352
name : 'Etudiants inscrits dans les autres formations de santé' ,
353
- data : sortedData . map ( ( item ) => item ?. diplomesante_autres_form || 0 ) ,
353
+ data : allData . map ( ( item ) => item ?. diplomesante_autres_form || 0 ) ,
354
354
} ,
355
355
{
356
356
name : 'Etudiants inscrits en HDR' ,
357
- data : sortedData . map ( ( item ) => item ?. diplomehdr || 0 ) ,
357
+ data : allData . map ( ( item ) => item ?. diplomehdr || 0 ) ,
358
358
} ,
359
359
{
360
360
name : 'Etudiants inscrits dans les diplômes d\'établissement' ,
361
- data : sortedData . map ( ( item ) => item ?. diplomeautres_form || 0 ) ,
361
+ data : allData . map ( ( item ) => item ?. diplomeautres_form || 0 ) ,
362
362
} ,
363
363
] ,
364
364
title : { text : 'Évolution des effectifs dans d\'autres types de diplômes' } ,
@@ -368,7 +368,7 @@ export default function StructureEtudiantsPage() {
368
368
...commonOptions ,
369
369
legend : { enabled : false } ,
370
370
series : [ {
371
- data : sortedData . map ( ( item ) => ( ( item ?. mobilite_internm || 0 ) / item . effectif ) * 100 ) ,
371
+ data : allData . map ( ( item ) => ( ( item ?. mobilite_internm || 0 ) / item . effectif ) * 100 ) ,
372
372
} ] ,
373
373
title : { text : 'Évolution de la part des étudiants inscrits en mobilité internationale (en %)' } ,
374
374
tooltip : {
@@ -382,13 +382,13 @@ export default function StructureEtudiantsPage() {
382
382
...commonOptions ,
383
383
series : [ {
384
384
name : 'Nouveaux bacheliers issus d\'un bac général' ,
385
- data : sortedData . map ( ( item ) => ( ( item ?. nbaca || 0 ) / item . nouv_bachelier ) * 100 ) ,
385
+ data : allData . map ( ( item ) => ( ( item ?. nbaca || 0 ) / item . nouv_bachelier ) * 100 ) ,
386
386
} , {
387
387
name : 'Nouveaux bacheliers issus d\'un bac technologique' ,
388
- data : sortedData . map ( ( item ) => ( ( ( item ?. nouv_bachelier || 0 ) - ( ( item ?. nbaca || 0 ) + ( item ?. nbac6 || 0 ) ) ) / item . nouv_bachelier ) * 100 ) ,
388
+ data : allData . map ( ( item ) => ( ( ( item ?. nouv_bachelier || 0 ) - ( ( item ?. nbaca || 0 ) + ( item ?. nbac6 || 0 ) ) ) / item . nouv_bachelier ) * 100 ) ,
389
389
} , {
390
390
name : 'Nouveaux bacheliers issus d\'un bac professionnel' ,
391
- data : sortedData . map ( ( item ) => ( ( item ?. nbac6 || 0 ) / item . nouv_bachelier ) * 100 ) ,
391
+ data : allData . map ( ( item ) => ( ( item ?. nbac6 || 0 ) / item . nouv_bachelier ) * 100 ) ,
392
392
} ] ,
393
393
title : { text : 'Répartitions des nouveaux bacheliers (en %)' } ,
394
394
tooltip : {
@@ -402,13 +402,13 @@ export default function StructureEtudiantsPage() {
402
402
...commonOptions ,
403
403
series : [ {
404
404
name : 'Nouveaux bacheliers en avance au bac d\'un an ou plus' ,
405
- data : sortedData . map ( ( item ) => ( ( item ?. nbac_ageavance || 0 ) / item . nouv_bachelier ) * 100 ) ,
405
+ data : allData . map ( ( item ) => ( ( item ?. nbac_ageavance || 0 ) / item . nouv_bachelier ) * 100 ) ,
406
406
} , {
407
407
name : 'Nouveaux bacheliers à l\'heure au bac' ,
408
- data : sortedData . map ( ( item ) => ( ( item ?. nbac_agea_l_heure || 0 ) / item . nouv_bachelier ) * 100 ) ,
408
+ data : allData . map ( ( item ) => ( ( item ?. nbac_agea_l_heure || 0 ) / item . nouv_bachelier ) * 100 ) ,
409
409
} , {
410
410
name : 'Nouveaux bacheliers en retard au bac d\'un an ou plus' ,
411
- data : sortedData . map ( ( item ) => ( ( item ?. nbac_ageretard || 0 ) / item . nouv_bachelier ) * 100 ) ,
411
+ data : allData . map ( ( item ) => ( ( item ?. nbac_ageretard || 0 ) / item . nouv_bachelier ) * 100 ) ,
412
412
} ] ,
413
413
title : { text : 'Âge au bac des nouveaux bacheliers (en %)' } ,
414
414
tooltip : {
0 commit comments