Карта мира: различия между версиями
Перейти к навигации
Перейти к поиску
Метка: визуальный редактор отключён |
|||
Строка 1: | Строка 1: | ||
<graph> |
<graph> |
||
{ |
{ |
||
− | "version": 2, |
+ | "version": 2, |
− | "width": |
+ | "width": 1, |
− | "height": |
+ | "height": 1, |
− | " |
+ | "data": [ |
− | "data": [ |
||
− | { |
||
− | "name": "points", |
||
− | "url": "wikidatasparql:///?query={{{query}}}", |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
{ |
{ |
||
− | " |
+ | "name": "highlights", |
+ | "values": [{"id":"US","v":"blue"},{"id":"AU","v":"purple"},{"id":"CN","v":"red"},{"id":"BR","v":"pink"},{"id":"DZ","v":"green"}] |
||
⚫ | |||
− | + | }, |
|
− | + | { |
|
− | " |
+ | "name": "countries", |
− | " |
+ | "url": "wikiraw:///Extension:Graph/Demo/RawData:WorldMap-iso2-json", |
− | " |
+ | "format": {"type": "topojson", "feature": "countries"}, |
⚫ | |||
⚫ | |||
+ | "type": "geopath", |
||
⚫ | |||
+ | "scale": 80, |
||
+ | "translate":[0,0], |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
+ | "keys": [ "id" ], |
||
+ | "on": "highlights", |
||
+ | "onKey": "id", |
||
+ | "as": [ "zipped" ], |
||
⚫ | |||
+ | "v": "#C0C0C0" |
||
+ | } |
||
⚫ | |||
⚫ | |||
} |
} |
||
− | + | ], |
|
− | + | "marks": [ |
|
− | { |
||
− | "name": "countries", |
||
− | "url": "wikiraw://www.mediawiki.org/Extension:Graph/Demo/RawData:WorldMap-iso2-json", |
||
− | "format": {"type": "topojson","feature": "countries"}, |
||
− | "transform": [ |
||
{ |
{ |
||
− | "type": " |
+ | "type": "path", |
− | " |
+ | "from": { |
− | " |
+ | "data": "countries" |
− | + | }, |
|
− | " |
+ | "properties": { |
− | " |
+ | "enter": { |
− | + | "path": { |
|
⚫ | |||
− | ] |
||
− | } |
+ | } |
+ | }, |
||
− | ], |
||
− | " |
+ | "update": { |
+ | "fill": { |
||
− | { |
||
− | " |
+ | "field": "zipped.v" |
− | + | } |
|
− | + | }, |
|
− | " |
+ | "hover": { |
+ | "fill": { |
||
− | }, |
||
+ | "value": "#989898" |
||
− | { |
||
− | + | } |
|
− | + | } |
|
− | + | } |
|
− | "range": "category20" |
||
− | }, |
||
− | ], |
||
− | "marks": [ |
||
− | { |
||
− | "name": "map", |
||
⚫ | |||
− | "from": {"data": "countries"}, |
||
− | "properties": { |
||
⚫ | |||
⚫ | |||
− | "stroke": {"value":"black" }, |
||
⚫ | |||
⚫ | |||
⚫ | |||
− | }, |
||
− | { |
||
− | "name": "circle", |
||
− | "type": "symbol", |
||
− | "from": {"data": "points"}, |
||
− | "properties": { |
||
⚫ | |||
− | "size": {"scale": "size", "value": "5"}, |
||
− | "fill": {"scale": "fill", "field": "fill" }, |
||
− | "fillOpacity": {"value": 1}, |
||
− | "stroke": {"scale": "fill", "field": "fill" }, |
||
− | "strokeWidth": {"value": 1}, |
||
− | "x": {"field": "layout_x"}, |
||
− | "y": {"field": "layout_y"} |
||
} |
} |
||
− | + | ] |
|
− | } |
||
− | ] |
||
} |
} |
||
</graph> |
</graph> |