Public
Edited
Dec 18, 2022
Insert cell
Insert cell
Insert cell
vega({
data: { values: wikipediatop20 },
height: 500,
padding: 50,
title: {
text: [
"Top 20 (word count) Wikipedia articles that mention 'Canada' and 'Christmas'"
],
subtitle: ["Includes only the first 10,000 'most relevant' results"],
fontSize: 22
},
hconcat: [
{
width: 300,
mark: { type: "bar", tooltip: true, fill: "green" },
encoding: {
y: {
field: "Title",
axis: {
labelFontSize: 14,
titleFontSize: 18,
labelLimit: 300,
title: false
},
sort: "-Words"
},
x: {
type: "quantitative",
field: "Christmas Mentions",
axis: { labelFontSize: 14, titleFontSize: 18 }
}
}
},

{
width: 300,
mark: { type: "bar", tooltip: true, fill: "red" },
encoding: {
y: {
field: "Title",
axis: false,
sort: "-Words"
},
x: {
type: "quantitative",
field: "Canada Mentions",
axis: { labelFontSize: 14, titleFontSize: 18 }
}
}
}
]
// width: 200,
//height: 600
})
Insert cell
WikipediaTop20@1.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
vega = require("vega-embed@6")
Insert cell
Wikipedia.csv
Type Table, 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