Public
Edited
Dec 9, 2023
Insert cell
Insert cell
Insert cell
vega(
{
$schema: "https://vega.github.io/schema/vega-lite/v4.json",
title: {
text: "Word count for Hansard entries containing the words 'Northwest Terrotiries' or spoken by the NWT MP",
subtitle: ["Based on a hansard search - 2002 to 2023"],
subtitleColor: "f4f4f4"
},
subtitle: "hello",
height: 500,
width: 850,
data: {
values: hansardnorthwestterritoritoriespos
.filter((d) => d.word !== "ii" && d.word !== "%")
.slice(0, 50)
},
mark: { type: "bar", tooltip: true },
encoding: {
x: {
field: "word",
type: "nominal",
sort: "-y",
axis: { labelAngle: -60 }
},
y: {
field: "count",
type: "quantitative"
},
color: {
field: "tag",
type: "nominal",
title: "Parts of speech tag"
}
}
},
{ theme: "carbong90" }
)
Insert cell
vega(
{
$schema: "https://vega.github.io/schema/vega-lite/v4.json",
title: {
text: "Word count for Hansard entries containing the word 'Nunavut' or spoken by the Nunavut MP",
subtitle: ["Based on a hansard search - 2002 to 2023"],
subtitleColor: "f4f4f4"
},
subtitle: "hello",
height: 500,
width: 850,
data: {
values: hansardnunavutpos.slice(0, 50)
},
mark: { type: "bar", tooltip: true },
encoding: {
x: {
field: "word",
type: "nominal",
sort: "-y",
axis: { labelAngle: -60 }
},
y: {
field: "count",
type: "quantitative"
},
color: {
field: "tag",
type: "nominal",
title: "Parts of speech tag"
}
}
},
{ theme: "carbong90" }
)
Insert cell
hansardnorthwestterritoritoriespos = FileAttachment("HansardNorthwestTerritoritoriesPOS.json").json()
Insert cell
hansardnunavutpos = FileAttachment("HansardNunavutPOS.json").json()
Insert cell
// load the Vega-Embed library
vega = require("vega-embed@6")
Insert cell
html`<link href="https://cdn.jsdelivr.net/npm/carbon-components@10.56.0/css/carbon-components.css " rel="stylesheet" />`
Insert cell
html`<link href="https://cdn.jsdelivr.net/npm/@carbon/charts@1.0.4/styles.css" rel="stylesheet" />`
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