layered_map_choropleth = {
const places_circles = vl
.markCircle({ size: 20, color: "orange" })
.data(maharashtra_districts_centroid.features)
.encode(
vl.longitude().fieldQ("properties.long"),
vl.latitude().fieldQ("properties.lat")
);
const places_text = vl
.markText({ dy: -10 })
.data(maharashtra_districts_centroid.features)
.encode(
vl.longitude().fieldQ("properties.long"),
vl.latitude().fieldQ("properties.lat"),
vl.text().fieldN("properties.distname")
);
const districts = vl
.markGeoshape({ fill: null, stroke: "#757575", strokeWidth: 0.5 })
.data(maharashtra_districts_centroid.features);
const choropleth = vl
.markGeoshape({
stroke: "#757575",
strokeWidth: 0.5
})
.data(hh_scheduled_tribe_2011_districts_merged)
.encode({
fill: {
field: "properties.value",
type: "quantitative",
scale: { scheme: "blues" }
},
tooltip: [
{ field: "properties.distname", type: "nominal" },
{ field: "properties.value", type: "quantitative" }
]
});
return vl
.layer(districts, choropleth, places_text, places_circles)
.height(400)
.width(800)
.view({ stroke: "transparent" })
.render({ renderer: "svg" });
}