Published
Edited
Oct 14, 2018
2 stars
Insert cell
Insert cell
Insert cell
spec = ({
$schema: 'https://vega.github.io/schema/vega-lite/v3.json',
data: {
url: 'https://vega.github.io/vega-datasets/data/seattle-weather.csv',
format: {
parse: {date: 'utc:"%Y/%m/%d"'}
}
},
transform: [
{filter: "datum.date <= utc(2012, 0, 7)"},
{
calculate: "utcFormat(datum.date, '%Y-%m-%d')",
as: "formattedDate"
}
],
mark: "point",
encoding: {
x: {field: "date", type: "temporal", scale: {type: "utc"}},
y: {field: "temp_max", type: "quantitative"},
tooltip: [
{field: "formattedDate", type: "nominal", title: "date"}
]
}
})
Insert cell
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