Public
Edited
Feb 16, 2023
26 forks
Importers
220 stars
Insert cell
Insert cell
Insert cell
Insert cell
flare = FileAttachment("flare.csv").csv()
Insert cell
Insert cell
flareGist = d3.csv("https://gist.githubusercontent.com/mbostock/4063570/raw/11847750012dfe5351ee1eb290d2a254a67051d0/flare.csv")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
client = DatabaseClient("Baby Names") // sample client for demonstration purposes
Insert cell
Insert cell
client
SELECT name
, gender
, year
, sum(number) AS number
FROM names
WHERE year > 1920
GROUP BY name, gender, year
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
primes = [2, 3, 5, 7, 11, 13]
Insert cell
Insert cell
mtcars = d3.csvParse(`name,mpg,cyl,disp,hp,drat,wt,qsec,vs,am,gear,carb
Mazda RX4,21,6,160,110,3.9,2.62,16.46,0,1,4,4
Mazda RX4 Wag,21,6,160,110,3.9,2.875,17.02,0,1,4,4
Datsun 710,22.8,4,108,93,3.85,2.32,18.61,1,1,4,1
Hornet 4 Drive,21.4,6,258,110,3.08,3.215,19.44,1,0,3,1
Hornet Sportabout,18.7,8,360,175,3.15,3.44,17.02,0,0,3,2
Valiant,18.1,6,225,105,2.76,3.46,20.22,1,0,3,1
Duster 360,14.3,8,360,245,3.21,3.57,15.84,0,0,3,4
Merc 240D,24.4,4,146.7,62,3.69,3.19,20,1,0,4,2
`)
Insert cell
Insert cell
md`The first prime is ${primes[0]}.`
Insert cell
md`The first car is a ${mtcars[0].name} with ${mtcars[0].hp} horsepower.`
Insert cell
medianMilesPerGallon = d3.median(mtcars, d => d.mpg)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
blob = new Blob([d3.csvFormat(flare)], {type: "text/csv"})
Insert cell
DOM.download(blob, "flare.csv")
Insert cell
Insert cell
Insert cell
import {note} from "@observablehq/callout-boxes"
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