Published
Edited
Dec 2, 2021
Fork of Simple D3
Importers
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
width: width,
marks: [
Plot.areaY(objectInput, {x: "Distance", y: "Depth", fill: "lightblue"}),
Plot.line(objectInput, {x: "Distance", y: "Depth"}),
Plot.ruleY([0]),
]
})
Insert cell
Plot.plot({
width: width,
marks: [
Plot.tickX(objectInput, {
x: "Distance",
stroke: (d, i) => d.Increase ? "blue" : "red"})
]
})
Insert cell
Insert cell
Insert cell
Insert cell
objectInput = numberInput.map( (val, index, arr) => {
return {Distance: index, Depth: -val, Increase: val > arr[index-1]}
})
Insert cell
numberInput = textInput.map(parseFloat)
Insert cell
textInput = FileAttachment("01_input.txt").text().then( text => text.split("\n"))
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