Public
Edited
Jan 30
Insert cell
Insert cell
States2020.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
data = FileAttachment("States2020.csv").csv({typed: true})
Insert cell
Plot.plot({
width: 1000,
color: {scheme: "Viridis", legend: true},
marks: [
Plot.barY(data, {x: "Abbrev", y: "MedianRent", sort: {x: "y", reverse: true}, fill:"PercentCollegeGrad"}),
Plot.ruleY([0])
]
})
Insert cell
data_col = ({
Abbrev: data.map(state=>state.Name),
Pop2020: data.map(state=>state.Pop2020)
})
Insert cell
Plot.plot({
marks: [
Plot.barY(data_col, {x: data_col.Abbrev, y: data_col.Pop2020}),
Plot.ruleY([0])
]
})
Insert cell
{
const data = {
x: [1, 2, 3],
y: [4, 5, 6]
};

return Plot.plot({
marks: [
Plot.line(data, { x: data.x, y: data.y })
]
});
}
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

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