Public
Edited
Feb 6, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
targetColumns = Object.keys(studentresults[0]).filter((d) => d.startsWith('Q2'))
Insert cell
targetColumnsQ8 = Object.keys(studentresults[0]).filter((d) => d.startsWith('Q8'))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {Plot} from "@mkfreeman/plot-tooltip"
Insert cell
fontSize = 12
Insert cell
Plot.plot({
x: {
axis: null,
// domain: d3.sort(getCountsPerClass, d => d.classLevel).map(d => classes[d.classLevel])
},
y: {
grid: true,
tickFormat: "s"
},
color: {
// domain: classes,
// legend: true,
scheme: "plasma"
},
style: {
fontFamily: "Verdana",
fontSize: "12px"
},
fx: {
// tickFormat: (d,i) => String(d).substring(1),
transform: (d) => {
console.log(d);
return d ? Math.floor(d * 5) / 5 : ""
},
// transform: (d) => d ? Math.floor(d * 10) / 10 : "",
transform: (d) => d ? d % 20 : "",
tickSize: 6,
tickRotate: -45,
label: "",
},
facet: {
// How do you make the binX the facet? I want the number of hours bins to be each facet
data: cleanStudentResults ,
x: "Q4",
marginBottom: 200,
},
marks: [
// Plot.barY(cleanStudentResults, {x:"Q4"}),
// Plot.barY(cleanStudentResults, Plot.binX({y: "count"}, {x:"Q1"})),
Plot.barY(cleanStudentResults, Plot.groupX({y: "count"}, {x:"Q1"})),
Plot.ruleY[0]
],
height: 600,
marginLeft: 100,
})
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