{
const domain = [0, 6000];
const legend = {
title: `bla`,
format: "d",
orient: "none",
legendX: 10,
legendY: 10,
direction: "vertical",
tickCount: 5,
gradientLength: 240,
gradientThickness: 8,
width: width / 2,
titleFontSize: 12,
titleLimit: 300
};
return vl
.layer([
vl
.markGeoshape({ stroke: "AliceBlue", fill: "lightgrey" })
.data(geodata.features)
.project(vl.projection("mercator")),
vl
.markGeoshape({ stroke: "AliceBlue" })
.data(geodata.features)
.project(vl.projection("mercator"))
.transform(
vl
.lookup("properties.Postcode4")
.from(vl.data(dataExample).key("Postcode4").fields("value"))
)
.encode(
vl
.color()
.fieldQ("value")
.scale({
domain: domain,
scheme: "blues"
})
.legend(legend),
{
tooltip: [
{
field: "properties.Postcode4",
type: "nominal",
title: "Postcode"
},
{
field: "value",
type: "nominal",
title: "Value",
format: "d"
}
]
}
)
])
.width(450)
.height(400)
.render();
}