User:Pyb/sandbox
< User:Pyb
<graph>
{
"version": 2,
"width": 1,
"height": 1,
"data": [
{
"name": "highlights",
"values": [{"id":"CA","v":"blue"},{"id":"DE","v":"blue"},{"id":"PT","v":"blue"},{"id":"BE","v":"blue"},{"id":"UK","v":"blue"},{"id":"CH","v":"blue"},{"id":"GB","v":"blue"},{"id":"ES","v":"blue"},{"id":"CM","v":"blue"},{"id":"FR","v":"blue"},{"id":"TN","v":"blue"},{"id":"BJ","v":"blue"},{"id":"DZ","v":"blue"},{"id":"MA","v":"blue"},{"id":"NL","v":"blue"}]
},
{
"name": "countries",
"url": "wikiraw:///Extension:Graph/Demo/RawData:WorldMap-iso2-json",
"format": {"type": "topojson", "feature": "countries"},
"transform": [
{
"type": "geopath",
"value": "data",
"scale": 80,
"translate":[0,0],
"projection": "equirectangular"
},
{
"type": "lookup",
"keys": [ "id" ],
"on": "highlights",
"onKey": "id",
"as": [ "zipped" ],
"default": {
"v": "#C0C0C0"
}
}
]
}
],
"marks": [
{
"type": "path",
"from": {
"data": "countries"
},
"properties": {
"enter": {
"path": {
"field": "layout_path"
}
},
"update": {
"fill": {
"field": "zipped.v"
}
},
"hover": {
"fill": {
"value": "#989898"
}
}
}
}
]
}
</graph>