Карта мира: различия между версиями
Перейти к навигации
Перейти к поиску
(не показано 37 промежуточных версий этого же участника) | |||
Строка 1: | Строка 1: | ||
+ | <graph> |
||
+ | |||
+ | "version": 2, |
||
⚫ | |||
+ | "height": 1, |
||
⚫ | |||
⚫ | |||
+ | {"a": "C", "b": 2}, {"a": "C", "b": 7}, {"a": "C", "b": 4}, |
||
+ | {"a": "D", "b": 1}, {"a": "D", "b": 2}, {"a": "D", "b": 6}, |
||
+ | {"a": "E", "b": 8}, {"a": "E", "b": 4}, {"a": "E", "b": 7} |
||
⚫ | |||
⚫ | |||
⚫ | |||
+ | "encoding": { |
||
⚫ | |||
+ | "y": {"field": "b", "type": "quantitative"} |
||
+ | ] |
||
+ | </graph> |
||
<graph> |
<graph> |
||
{ |
{ |
||
− | "version": 2, |
+ | "version": 2, |
− | "width": |
+ | "width": 1, |
− | "height": |
+ | "height": 1, |
− | " |
+ | "data": [ |
⚫ | |||
⚫ | |||
⚫ | |||
− | "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", |
||
+ | "value": "data", |
||
+ | "scale": 80, |
||
+ | "translate":[0,0], |
||
⚫ | |||
+ | }, |
||
+ | { |
||
⚫ | |||
+ | "keys": [ "id" ], |
||
+ | "on": "highlights", |
||
+ | "onKey": "id", |
||
+ | "as": [ "zipped" ], |
||
+ | "default": { |
||
+ | "v": "#C0C0C0" |
||
+ | } |
||
+ | } |
||
+ | ] |
||
} |
} |
||
− | + | ], |
|
− | + | "marks": [ |
|
⚫ | |||
− | "name": "countries", |
||
− | "url": "wikiraw://www.mediawiki.org/Extension:Graph/Demo/RawData:WorldMap-iso2-json", |
||
⚫ | |||
⚫ | |||
{ |
{ |
||
− | "type": " |
+ | "type": "path", |
− | " |
+ | "from": { |
− | " |
+ | "data": "countries" |
− | + | }, |
|
− | " |
+ | "properties": { |
− | " |
+ | "enter": { |
+ | "path": { |
||
+ | "field": "layout_path" |
||
+ | } |
||
+ | }, |
||
+ | "update": { |
||
+ | "fill": { |
||
+ | "field": "zipped.v" |
||
+ | } |
||
+ | }, |
||
+ | "hover": { |
||
+ | "fill": { |
||
+ | "value": "#989898" |
||
+ | } |
||
+ | } |
||
+ | } |
||
} |
} |
||
− | + | ] |
|
+ | } |
||
+ | |||
+ | </graph> |
||
+ | |||
+ | <graph> |
||
+ | { |
||
+ | "version": 2, |
||
+ | "width": 100, |
||
+ | "height": 100, |
||
+ | "data": [ |
||
⚫ | |||
⚫ | |||
+ | "values": [12,23,47,6,52,19], |
||
⚫ | |||
} |
} |
||
], |
], |
||
"scales": [ |
"scales": [ |
||
{ |
{ |
||
− | "name": " |
+ | "name": "r", |
− | "type": " |
+ | "type": "sqrt", |
− | "domain": {"data": " |
+ | "domain": {"data": "table","field": "data"}, |
− | "range": [ |
+ | "range": [20,100] |
− | } |
+ | } |
− | { |
||
⚫ | |||
⚫ | |||
⚫ | |||
− | "range": "category20" |
||
⚫ | |||
], |
], |
||
"marks": [ |
"marks": [ |
||
{ |
{ |
||
− | " |
+ | "type": "arc", |
− | " |
+ | "from": {"data": "table"}, |
⚫ | |||
"properties": { |
"properties": { |
||
"enter": { |
"enter": { |
||
− | " |
+ | "x": {"field": {"group": "width"},"mult": 0.5}, |
− | " |
+ | "y": {"field": {"group": "height"},"mult": 0.5}, |
− | " |
+ | "startAngle": {"field": "layout_start"}, |
+ | "endAngle": {"field": "layout_end"}, |
||
⚫ | |||
+ | "innerRadius": {"value": 20}, |
||
+ | "outerRadius": {"scale": "r","field": "data"}, |
||
⚫ | |||
⚫ | |||
+ | "update": {"fill": {"value": "#ccc"} }, |
||
+ | "hover": {"fill": {"value": "pink"} } |
||
} |
} |
||
}, |
}, |
||
{ |
{ |
||
− | " |
+ | "type": "text", |
− | " |
+ | "from": {"data": "table"}, |
⚫ | |||
"properties": { |
"properties": { |
||
"enter": { |
"enter": { |
||
− | " |
+ | "x": {"field": {"group": "width"},"mult": 0.5}, |
− | " |
+ | "y": {"field": {"group": "height"},"mult": 0.5}, |
− | " |
+ | "radius": {"scale": "r","field": "data","offset": 8}, |
− | " |
+ | "theta": {"field": "layout_mid"}, |
− | " |
+ | "fill": {"value": "#000"}, |
− | " |
+ | "align": {"value": "center"}, |
− | " |
+ | "baseline": {"value": "middle"}, |
⚫ | |||
} |
} |
||
} |
} |
Текущая версия от 17:24, 7 ноября 2022
Синтаксическая ошибка