Public
Edited
Oct 14, 2022
4 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data = await FileAttachment("data.csv").csv({typed:true})
Insert cell
Inputs.table(data)
Insert cell
Insert cell
// Your code here
Insert cell
Insert cell
Insert cell
// Your code here
Insert cell
Insert cell
Insert cell
// Your code here
Insert cell
Insert cell
Insert cell
// Your code here
Insert cell
Insert cell
Insert cell
viewof xFacet = Inputs.radio(["day", "month", "hour"], {value:"hour", label:"Select an X facet:"})
Insert cell
viewof yFacet = Inputs.radio(["day", "month", "hour"], {value:"month", label:"Select a Y facet:"})
Insert cell
// Your code here
Insert cell
Insert cell
Insert cell
Insert cell
domains = ({
month:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
day:["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
})

Insert cell
Insert cell
import {Q, A, styles} with {renderSnippetOverride as renderSnippet} from "@observablehq/plot-exploration-penguins";
Insert cell
styles
Insert cell
<style>
details ul {
max-width: 100%;
}
</style>
Insert cell
function renderSnippetOverride(str) {
try {
// TODO: if you want to support more variables in the solutions you add them as a string and pass them in here
const func = new Function("data", "Plot", "d3", "width", "domains", "xFacet", "yFacet", `return ${str}`)
return func(data, Plot, d3, width, domains, xFacet, yFacet);
}
catch(e) {
console.error(e)
}
}
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