Public
Edited
Jan 22, 2023
1 fork
Insert cell
Insert cell
raw = FileAttachment("edt-matiere.csv").csv()
Insert cell
import {vl} from '@vega/vega-lite-api-v5'
Insert cell
import {printTable} from '@uwdata/data-utilities'
Insert cell
data= raw.map((row,i) => {
let parseDate = d3.timeParse("%m/%d/%Y");
row.date = parseDate(row.Date)
row.index =i
return row
})
Insert cell
Plot.line(data, {x:"date",y:"index"}).plot()
Insert cell
cours = d3.group(raw, d => d["Code Cours"])
Insert cell
cours.selection=Inputs.checkbox(cours)
Insert cell
Inputs.table(raw.map(d=>d["Code Cours"]))
Insert cell
Plot.dot(raw,{x:"date",y:"Code Cours", fill:"Code Cours"}).plot()
Insert cell
Plot.dot(raw,{x:"date",y:"Groupe(s)", fill:"Code Cours"}).plot({
tickoffset: 100
})
Insert cell
type_groups = [...d3.group(raw, d=>d["Groupe(s)"])].map(d=>d[0])
Insert cell
viewof checkboxes = Inputs.checkbox(type_groups, {label: "Select some", value: ["type_groups"]})
Insert cell
function addIndexCours()
{
var index1=1
var index2=1
var index3=1
for (const dat of data)
{
if (dat["Code Cours"]=="22_ING_S06_MATIERE_1")
{
data.indexCours=index1
index1++
}
if (dat["Code Cours"]=="22_ING_S06_MATIERE_2")
{
data.indexCours=index2
index2++
}
if (dat["Code Cours"]=="22_ING_S06_MATIERE_3")
{
data.indexCours=index3
index3++
}
}
return data
}

Insert cell
addIndexCours()
Insert cell
vl.markBar()
.data(data)
.encode(
vl.x().month('date'),
vl.y().fieldN('Heure') ,
vl.color().fieldN('Code Cours')
)
.render()
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