Public
Edited
Nov 4, 2022
Insert cell
Insert cell
// Plot it
Plot.plot({
width: 800,
marks: [Plot.dot(data, { x: "Date", y: "Close", fill: "steelblue" })]
})
Insert cell
// Create a new data set based on the first but with dates and numbers, rather than strings
data = {
let data = downloadDataIndex_us_sPUs_spx.map(function (o) {
let oo = {};
oo.Date = d3.utcParse("%m/%d/%Y")(o.Date);
oo.Close = parseFloat(o.Close.replace(",", ""));
return oo;
});
return data;
}
Insert cell
// Import the data set
import { downloadDataIndex_us_sPUs_spx } from "a79ae3a934f83d2c"
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