Skip to content
Snippets Groups Projects
Commit f9b018cf authored by Benoît Courty's avatar Benoît Courty Committed by benoit-cty
Browse files

Plot IPS

parent 64fd5597
No related branches found
No related tags found
1 merge request!6Ajout de la section Education
......@@ -274,6 +274,10 @@
</NoteDeLecture>
</div>
{:else}
<p>
A noter que les ministères ne publient pas la liste des établissements
privés hors contrats.
</p>
<section id="effectifs" class="mb-5 flex flex-col justify-center">
<div class="flex flex-col">
<h2 class="mb-2 mt-10 text-xl font-bold">
......@@ -452,6 +456,16 @@
>
Enseignement supérieur public
</h3>
{#if !dataEducation.etablissements_superieur}
<p>
Les données concernant les établissements d'enseignement supérieur
public de cette circonscription sont indisponibles.
</p>
{:else}
<p>
Le ministère de l'enseignement supérieur et de la recherche ne
publie pas la liste des établissements privés.
</p>
<div class="max-h-96 overflow-auto overscroll-contain shadow-inner">
<table
class="w-full table-auto border-collapse border font-sans text-sm"
......@@ -474,6 +488,7 @@
</tbody>
</table>
</div>
{/if}
<h3 id="liste-etablissements-autres" class="my-4 font-serif font-bold">
Autres établissements
</h3>
......
......@@ -89,42 +89,28 @@
var data = [
{
type: "histogram",
//orientation = "h",
// x: Array(
// customdata.ips_premier_et_second_public_circo_list.length,
// ).fill("Circo"),
y: customdata.ips_premier_et_second_public_circo_list,
legendgroup: "Public",
scalegroup: "Public",
name: "Public",
side: "negative",
line: {
opacity: 0.5,
marker: {
color: "blue",
width: 2,
},
meanline: {
visible: true,
},
},
{
type: "histogram",
// histfunc: "sum",
// x: Array(customdata.ips_premier_et_second_prive_circo_list.length).fill(
// -1,
// ),
histfunc: "sum",
orientation: "h",
marker: {
color: "red",
},
opacity: 0.5,
x: Array(customdata.ips_premier_et_second_prive_circo_list.length).fill(
-1,
),
yaxis_autorange: "reversed",
y: customdata.ips_premier_et_second_prive_circo_list,
legendgroup: "Privé",
scalegroup: "Privé",
name: "Privé",
side: "positive",
line: {
color: "green",
width: 2,
},
meanline: {
visible: true,
},
},
]
let ips_premier_et_second_prive_france = [
......@@ -142,23 +128,23 @@
type: "line",
x0: 0,
y0: ips,
x1: 0.5,
x1: -10,
y1: ips,
line: {
color: "green",
width: 4,
color: "red",
width: 2,
dash: "dot",
},
}),
)
let annotations_prive_france = ips_premier_et_second_prive_france.map(
(ips) => ({
x: 0.4,
x: -10,
y: ips,
xref: "x",
yref: "y",
ax: 0,
ay: 10,
ay: -10,
text: ips_premier_et_second_france_labels[
ips_premier_et_second_prive_france.indexOf(ips)
],
......@@ -174,43 +160,102 @@
let shapes_ips_public_france = ips_premier_et_second_public_france.map(
(ips) => ({
type: "line",
x0: -0.8,
x0: 15,
y0: ips,
x1: 0,
y1: ips,
line: {
color: "blue",
width: 4,
width: 2,
dash: "dot",
},
}),
)
let annotations_public_france = ips_premier_et_second_public_france.map(
(ips) => ({
x: -0.25,
x: 15,
y: ips,
xref: "x",
yref: "y",
ax: 0,
ay: 10,
ay: -10,
text: ips_premier_et_second_france_labels[
ips_premier_et_second_public_france.indexOf(ips)
],
}),
)
let shape_ips_public_circo = {
type: "line",
x0: 15,
y0: customdata.ips_premier_et_second_public_circo,
x1: 0,
y1: customdata.ips_premier_et_second_public_circo,
line: {
color: "blue",
width: 2,
dash: "dash",
},
}
let shape_ips_prive_circo = {
type: "line",
x0: 0,
y0: customdata.ips_premier_et_second_prive_circo,
x1: -10,
y1: customdata.ips_premier_et_second_prive_circo,
line: {
color: "red",
width: 2,
dash: "dash",
},
}
let annotations_prive_circo = {
x: -10,
y: customdata.ips_premier_et_second_prive_circo,
xref: "x",
yref: "y",
ax: 0,
ay: -10,
text: "Moyenne circonscription",
}
let annotations_public_circo = {
x: 10,
y: customdata.ips_premier_et_second_public_circo,
xref: "x",
yref: "y",
ax: 0,
ay: -10,
text: "Moyenne circonscription",
}
var layout = {
// title: "Répartition des établissements par IPS",
title: "Répartition des établissements par IPS",
width: 600,
height: 400,
paper_bgcolor: "rgba(0,0,0,0)",
barmode: "overlay",
bargap: 0.0,
bargroupgap: 0.0,
xaxis: {
title: "Nombre d'établissements",
tickvals: [-20, -15, -10, -5, 0, 5, 10, 15, 20],
ticktext: [20, 15, 10, 5, 0, 5, 10, 15, 20],
},
yaxis: {
title: "IPS",
zeroline: false,
},
violingap: 0,
violingroupgap: 0,
violinmode: "overlay",
shapes: [...shapes_ips_public_france, ...shapes_ips_prive_france],
annotations: [...annotations_prive_france, ...annotations_public_france],
shapes: [
...shapes_ips_public_france,
shape_ips_public_circo,
shape_ips_prive_circo,
...shapes_ips_prive_france,
],
annotations: [
...annotations_prive_france,
annotations_public_circo,
annotations_prive_circo,
...annotations_public_france,
],
}
// if ($Plotly !== undefined) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment