Public
Edited
Jan 22, 2023
1 fork
Insert cell
# EDT Etudiants
# 1 Chargement des données :
On commence tous d'abord par charger les données qui concerne
les emplois du temps d’un semestre de cours d’une matière (divisée en 3 AF) dans une école d’ingénieur.
Afin d'avoir une vision clair sur les données on va les affichées sous forme de tableau comme représenté dans la figure suivante. Chaque ligne de tableau représente une séance pour un groupe de TD ou un cours
Insert cell
data = FileAttachment("edt-matiere.csv").csv({typed: true})
Insert cell
Inputs.table(data)
Insert cell
Insert cell
Insert cell
types_AF =[...d3.group(data,d =>d["Code Cours"])].map(d=> d[0])
Insert cell
Insert cell
types_seances =[...d3.group(data,d =>d["Num séance"])].map(d=> d[0])
Insert cell
Insert cell
Insert cell
Periode =[...d3.group(data,d =>d["dateparse"])].map(d=> d[0])

Insert cell
Insert cell
Periode[0]
Insert cell
Insert cell
Periode[73]
Insert cell
Insert cell
timeParse =d3.timeParse("%m/%d/%Y")
Insert cell
raw= data.map((d,i) => {
d.dateparse=timeParse(d.Date)
d.index=i+1
return d
})
Insert cell
Insert cell
Insert cell
Plot.line(data,{x:"dateparse", y:"index"}).plot({ marginLeft: 100, grid: true,
marks: [
Plot.ruleY([0]),
]})
Insert cell
Insert cell
Plot.line(data,{x:"dateparse", y:"index"}).plot({
facet: {data,x: "Code Cours"},
grid: true,
marks: [
Plot.frame(),
]
})
Insert cell
Insert cell
Insert cell
Plot.dot(data,{x:"Date", y:"Groupe(s)", fill: "Code Cours"}).plot({grid: true, color :{legend :true}})
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.frame(),
Plot.dot(data, {
filter: d => ["A","B"].includes(d['Groupe(s)']) ,
x: "Date",
y: "Groupe(s)",
fill: "Code Cours"

}),
Plot.tickX(data, {
filter: d => d["Num séance"] >=5 && d["Num séance"] <=9 && ["A1a","A1b","A2b","A2a","B1a","B1b","B2b","B2a"].includes(d['Groupe(s)']) ,
x: "Date",
y: "Groupe(s)",
stroke: "Code Cours",
}),
Plot.tickY(data, {
filter: d => d["Num séance"] >=1 && d["Num séance"] <=5 && ["A1a","A1b","A2b","A2a","B1a","B1b","B2b","B2a"].includes(d['Groupe(s)']),
x: "Date",
y: "Groupe(s)",
stroke: "Code Cours"
})
],
marginLeft: 60,
color :{legend :true}
})
Insert cell
Insert cell
viewof Groupe = Inputs.checkbox(["A","B"], {label: "Groupe"})
Insert cell
Groupe
Insert cell
Insert cell
viewof Seance = Inputs.checkbox(["A1a", "A1b", "A2a", "A2b", "B1a", "B1b", "B2a", "B2b"], {label: "Séance"})
Insert cell
Plot.plot({
marks: [
Plot.frame(),
Plot.dot(data, {
filter: d => Groupe.includes(d['Groupe(s)']) ,
x: "Date",
y: "Groupe(s)",
fill: "Code Cours"

}),
Plot.tickX(data, {
filter: d => d["Num séance"] >=5 && d["Num séance"] <=9 && Seance.includes(d['Groupe(s)']) ,
x: "Date",
y: "Groupe(s)",
stroke: "Code Cours",
}),
Plot.tickY(data, {
filter: d => d["Num séance"] >=1 && d["Num séance"] <=5 && Seance.includes(d['Groupe(s)']),
x: "Date",
y: "Groupe(s)",
stroke: "Code Cours"
})
],
marginLeft: 60,
color :{legend :true}
})
Insert cell
Plot.plot({
marginLeft: 70,
x: {
line: true,
domain : ["lun","mar","mer","jeu","ven"]
},
y: {
line: true,
},
marks: [
Plot.tickX(
data,
{ y: "heure_debut",
x: "Jour",
strokeWidth: 60,
stroke: "Code Cours",
}),
],
color:{legend:true }
})
Insert cell
Insert cell
Insert cell

Plot.dot(data, Plot.group({r: "count"}, {x: "Jour", y: "heure_debut", stroke: "Groupe(s)" })).plot({
r: { range: [0, 15] },
marginLeft: 80,
height: 300,
color:{legend:true },
grid: true,
facet: {data,x: "Code Cours"},
marks: [Plot.frame(),]
})
Insert cell
raw= data.map(d => {
d.dateparse=timeParse(d.Date)
d.index=i+1
return d
})
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more