map = function(projname) {
return plot({
"$schema": "https://vega.github.io/schema/vega/v3.json",
"width": 900,
"height": 500,
"autosize": "none",
"data": [
{
"name": "states",
"values": us,
"format": {
"type": "topojson",
"feature": "states"
}
},
{
"name": "counties",
"values": us,
"format": {
"type": "topojson",
"feature": "counties"
}
}
],
"projections": [
{
"name": "projection",
"type": projname
}
],
"marks": [
{
"type": "shape",
"from": {"data": "counties"},
"encode": {
"update": {
"stroke": {"value": "#aaa"},
"strokeWidth": {"value": "0.5"}
}
},
"transform": [
{ "type": "geoshape", "projection": "projection" }
]
},
{
"type": "shape",
"from": {"data": "states"},
"encode": {
"update": {
"stroke": {"value": "#000"},
"strokeWidth": {"value": "1"}
}
},
"transform": [
{ "type": "geoshape", "projection": "projection" }
]
}
]
}
);
}