Published unlisted
Edited
Nov 16, 2019
Fork of A4 Avant
Insert cell
Insert cell
vl.markPoint()
.data(a4)
.encode(
vl.x().fieldT('date'),
vl.y().fieldQ('odometer'),
vl.color().fieldQ('price')
)
.render()
Insert cell
a4 = d3.tsvParse(await FileAttachment("data.tsv").text(), d3.autoType)
Insert cell
d3.pairs(
a4.filter(d => d.type === "fuel")
.sort((a, b) => d3.ascending(a.date, b.date)),
(a, b) => ({
...b,
odometer_delta: b.odometer - a.odometer
})
)
Insert cell
import {vl} from '@vega/vega-lite-api'
Insert cell
d3 = require("d3@^5.13")
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