viewof view = plot({
"$schema": "https://vega.github.io/schema/vega/v5.json",
"width": 730,
"height": 534,
"padding": 5,
"autosize": "pad",
"projections": [
{
"name": "projection",
"type": "miller",
"scale": 115,
"rotate": [0, 0, 0],
"center": [0, 0],
"translate": [
{"signal": "width / 2"},
{"signal": "height / 2"}
]
}
],
"data": [
{
"name": "lats",
"transform": [
{
"type": "sequence",
"start": -80,
"stop": 81,
"step": 10
}
]
},
{
"name": "lons",
"transform": [
{
"type": "sequence",
"start": -180,
"stop": 181,
"step": 90
}
]
},
{
"name": "sphere",
"values": [{"type": "Sphere"}]
},
{
"name": "world",
"url": "data/world-110m.json",
"format": {
"type": "topojson",
"feature": "land"
}
},
{
"name": "graticule",
"transform": [
{ "type": "graticule" }
]
}
],
"marks": [
{
"type": "shape",
"clip": true,
"from": {"data": "graticule"},
"encode": {
"enter": {
"strokeWidth": {"value": 1},
"stroke": {"value": "#ddd"},
"fill": {"value": null}
}
},
"transform": [
{ "type": "geoshape", "projection": "projection" }
]
},
{
"type": "shape",
"clip": true,
"from": {"data": "world"},
"encode": {
"enter": {
"fill": {"value": "#000"}
}
},
"transform": [
{ "type": "geoshape", "projection": "projection" }
]
},
{
"type": "shape",
"clip": true,
"from": {"data": "sphere"},
"encode": {
"update": {
"strokeWidth": {"value": 1},
"stroke": {"value": "#000"}
}
},
"transform": [
{ "type": "geoshape", "projection": "projection" }
]
},
{
"type": "text",
"from": {"data": "lats"},
"encode": {
"enter": {
"x": {"value": 0},
"align": {"value": "right"},
"baseline": {"value": "middle"},
"text": {"signal": "abs(datum.data) + '°' + (datum.data < 0 ? 'S' : 'N')"},
"fill": {"value": "#000"}
},
"update": {
"y": {"signal": "scale('projection', [0, datum.data])[1]"}
}
}
},
{
"type": "text",
"from": {"data": "lats"},
"encode": {
"enter": {
"x": {"signal": "width"},
"align": {"value": "left"},
"baseline": {"value": "middle"},
"text": {"signal": "abs(datum.data) + '°' + (datum.data < 0 ? 'S' : 'N')"},
"fill": {"value": "#000"}
},
"update": {
"y": {"signal": "scale('projection', [0, datum.data])[1]"}
}
}
},
{
"type": "text",
"from": {"data": "lons"},
"encode": {
"enter": {
"y": {"value": 0},
"align": {"value": "center"},
"baseline": {"value": "bottom"},
"text": {"signal": "abs(datum.data) + '°' + (datum.data < 0 ? 'W' : 'E')"},
"fill": {"value": "#000"}
},
"update": {
"x": {"signal": "scale('projection', [datum.data, 0])[0]"}
}
}
},
{
"type": "text",
"from": {"data": "lons"},
"encode": {
"enter": {
"y": {"signal": "height"},
"align": {"value": "center"},
"baseline": {"value": "top"},
"text": {"signal": "abs(datum.data) + '°' + (datum.data < 0 ? 'W' : 'E')"},
"fill": {"value": "#000"}
},
"update": {
"x": {"signal": "scale('projection', [datum.data, 0])[0]"}
}
}
}
]
})