Public
Edited
Sep 17, 2024
1 fork
21 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
flights_url = 'https://vega.github.io/vega-datasets/data/flights-200k.arrow'
Insert cell
flights = aq.loadArrow(flights_url)
Insert cell
flights.view(10)
Insert cell
viewof counts = flights
.groupby({ delay: aq.bin('delay', { maxbins: 20 }) })
.count()
.view(10)
Insert cell
Insert cell
vl.markBar()
.data(counts)
.encode(
vl.x().fieldO('delay').axis({ labelAngle: 0 }),
vl.y().fieldQ('count')
)
.height(200)
.render()
Insert cell
Insert cell
scrabble_url = 'https://gist.githubusercontent.com/TheNeuralBit/64d8cc13050c9b5743281dcf66059de5/raw/c146baf28a8e78cfe982c6ab5015207c4cbd84e3/scrabble.arrow'
Insert cell
Insert cell
scrabble = aq.loadArrow(scrabble_url)
Insert cell
Insert cell
stats = timeIt(() =>
scrabble
.groupby('winnername')
.rollup({
score: ({ winnerscore: v }) => op.mean(v),
years: ({ year: v }) => [ op.min(v), op.max(v) ]
})
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof dt = aq.table({
w: ['a', 'b', 'a'],
x: [1, 2, 3],
y: [1.6181, 2.7182, 3.1415],
z: [true, true, false]
})
.view()
Insert cell
Insert cell
at = dt.toArrow()
Insert cell
Insert cell
at.getChild('w').type
Insert cell
at.getChild('x').type
Insert cell
Insert cell
fl = require('@uwdata/flechette')
Insert cell
dt.toArrow({ types: { x: fl.int32() } }).getChild('x').type
Insert cell
Insert cell
bytes = dt.toArrowIPC()
Insert cell
Insert cell
Insert cell
aq.fromArrow(bytes).view()
Insert cell
Insert cell
timeIt = fn => {
const t0 = Date.now();
const table = fn();
return { time: Date.now() - t0, table }
}
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more