Created
July 27, 2023 12:11
-
-
Save mandel59/d0a1d6f9d0fb74281cba8ac99ae8fcf9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v5.json", | |
"width": 500, | |
"height": 300, | |
"data": { | |
"url": "https://geoshape.ex.nii.ac.jp/ka/topojson/2020/12/r2ka12207.topojson", | |
"format": { | |
"type": "topojson", | |
"feature": "town" | |
} | |
}, | |
"projection": { | |
"type": "mercator" | |
}, | |
"transform": [ | |
{ | |
"calculate": "datum.properties.JINKO", | |
"as": "population" | |
}, | |
{ | |
"calculate": "datum.properties.AREA / 1000000", | |
"as": "area" | |
}, | |
{ | |
"calculate": "datum.population / datum.area", | |
"as": "density" | |
} | |
], | |
"mark": { "type": "geoshape", "tooltip": { "content": "data" } }, | |
"encoding": { | |
"color": { | |
"field": "density", | |
"type": "quantitative" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment