vegalite({
$schema: "https://vega.github.io/schema/vega-lite/v4.json",
description: "A simple donut chart with embedded data.",
padding: { left: 55, top: 10, right: 10, bottom: 10 },
data: {
values: resources_list.meta.resourceTypes
},
layer: [
{
mark: {
type: "arc",
innerRadius: 68,
outerRadius: 90,
cursor: "pointer",
tooltip: true
},
encoding: {
theta: {
field: "count",
type: "quantitative",
sort: "descending"
},
color: {
field: "title",
type: "nominal",
title: "type",
legend: false,
scale: {
range: [
"#fccde5",
"#fdb462",
"#fb8072",
"#fb8072",
"#b3de69",
"#bc80bd",
"#fccde5",
"#8dd3c7",
"#ffed6f",
"#d9d9d9",
"#ffffb3",
"#bebada",
"#80b1d3",
"#ccebc5",
"#d9d9d9"
],
domain: [
"Audiovisual",
"Collection",
"Dataset",
"Data Paper",
"Event",
"Image",
"Interactive Resource",
"Model",
"Physical Object",
"Service",
"Sound",
"Software",
"Text",
"Workflow",
"Other"
]
}
}
}
},
{
mark: {
type: "text",
fill: "#767676",
align: "center",
baseline: "middle",
fontSize: 27
},
encoding: { text: { value: "32" } }
}
],
view: { stroke: null }
})