Public
Edited
Aug 21, 2023
Insert cell
Insert cell
Insert cell
ufo = FileAttachment("UFO.json").json()
Insert cell
Insert cell
import {Wrangler, op} from "@observablehq/data-wrangler"
Insert cell
Wrangler(ufo)
Insert cell
UFO = aq.from(ufo)
.groupby('state', 'shape') //group data by state and shape
.count() //get count of rows by state and shape
.orderby("state")
.objects() // return an array of objects

Insert cell
Insert cell
viewof selectedState = Inputs.select([...UFO.map(d => d.state)], {label: "Select one", sort: true, unique: true})
Insert cell
selectedState
Insert cell
filteredByState = UFO.filter(d => d.state == selectedState && d.count > 10)
Insert cell
filteredByState
X
shape
Y
sum
count
Color
shape
Size
Facet X
Facet Y
Mark
bar
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
viewof selectedShape = Inputs.select([...UFO.map(d => d.shape)], {label: "Select one", sort: true, unique: true})
Insert cell
filteredByShape = UFO.filter(d => d.shape == selectedShape && d.count > 10)
Insert cell
filteredByShape
X
state
Y
sum
count
Color
state
Size
Facet X
Facet Y
Mark
bar
Type Chart, then Shift-Enter. Ctrl-space for more options.

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