Public
Edited
Nov 28, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
wb_tidy.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Plot.plot({
marks: [
Plot.frame(),
Plot.dot(worldbank, {
filter: (d) => d.year == 2010,
x: "gdp",
y: "co2",
r: "life_exp",
fill: "life_exp",
opacity: 0.5,
fy: "income_group"
}),
Plot.dot(worldbank, {
filter: (d) => d.year == 2010,
x: "gdp",
y: "co2",
r: "life_exp",
fill: "grey",
opacity: 0.1
})
],
color: { legend: true, scheme: "Sinebow" },
r: { domain: d3.extent(worldbank, (d) => d.life_exp), range: [1, 10] },
x: { type: "log" },
y: { type: "log" }
})

Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.lineY(stocks, { x: "Date", y: "Close", stroke: "symbol", opacity: 0.3 }),
Plot.lineY(
stocks,
Plot.windowY({ k: 20, anchor: "middle", reduce: "mean" }, { x: "Date", y: "Close", stroke: "symbol" })
),
Plot.text(stocks, Plot.selectLast(Plot.windowY({k: 20}, {x: "Date", y: "Close", text: "symbol", fill: "symbol", dx: 10})))
],
color: { legend: true }
})

Insert cell
Insert cell
Insert cell
Insert cell
Meteorite_Landings.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Plot.plot({
projection: "equal-earth",
marks: [
Plot.geo(land, { fill: "purple" }),
Plot.dot(meteorites, { x: "reclong", y: "reclat", fill: "green", opacity: 0.1})
]
})
Insert cell
Insert cell
Insert cell
Insert cell
viewof pickColor = Inputs.color({label: "Favorite color", value: "#4682b4"})
Insert cell
Insert cell
// Update the fill option to depend on the value of pickColor to make it interactive!
Plot.plot({
marks: [
Plot.dot(cars, {x: "power (hp)", y: "economy (mpg)", fill: pickColor})
]
})
Insert cell
Insert cell
Insert cell
Insert cell
aapl = FileAttachment("aaplStock.csv").csv({typed: true})
Insert cell
goog = FileAttachment("googStock.csv").csv({typed: true})
Insert cell
tsla = FileAttachment("tslaStock.csv").csv({typed: true})
Insert cell
dateParse = d3.timeParse("%m/%d/%y")
Insert cell
stocks = aapl.map(d => ({...d, symbol: "aapl"})).concat(goog.map(d => ({...d, symbol: "goog"})), tsla.map(d => ({...d, symbol: "tsla"}))).map(d => ({...d, Date: dateParse(d.Date)}))
Insert cell
import {land} from "@observablehq/plot-live-earthquake-map"
Insert cell
import { showMe } from "@observablehq/show-me"
Insert cell


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