Карта мира: различия между версиями

Материал из wiki.energogroup.org
Перейти к навигации Перейти к поиску
 
(не показано 37 промежуточных версий этого же участника)
Строка 1: Строка 1:
  +
<graph>
  +
  +
"version": 2,
 
"width": 1,
  +
"height": 1,
 
"data": [
 
"values": [
  +
{"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}
 
]
 
},
 
"mark": "point",
  +
"encoding": {
 
"x": {"field": "a", "type": "nominal"},
  +
"y": {"field": "b", "type": "quantitative"}
  +
]
  +
</graph>
 
<graph>
 
<graph>
 
{
 
{
"version": 2,
+
"version": 2,
"width": 200,
+
"width": 1,
"height": 250,
+
"height": 1,
"padding": 12,
+
"data": [
"data": [
 
{
 
"name": "points",
 
"url": "wikidatasparql:///?query={{{query}}}",
 
"format": {
 
"type": "json"
 
},
 
"transform": [
 
 
{
 
{
"type": "geo",
+
"name": "highlights",
  +
"values": [{"id":"US","v":"blue"},{"id":"AU","v":"purple"},{"id":"CN","v":"red"},{"id":"BR","v":"pink"},{"id":"DZ","v":"green"}]
"projection": "mercator",
 
"scale": 450,
+
},
"center": [5,70],
+
{
"translate": [0,0],
+
"name": "countries",
"lon": "gps[0]",
+
"url": "wikiraw:///Extension:Graph/Demo/RawData:WorldMap-iso2-json",
"lat": "gps[1]"
+
"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": [
{
 
"name": "countries",
 
"url": "wikiraw://www.mediawiki.org/Extension:Graph/Demo/RawData:WorldMap-iso2-json",
 
"format": {"type": "topojson","feature": "countries"},
 
"transform": [
 
 
{
 
{
"type": "geopath",
+
"type": "path",
"value": "data",
+
"from": {
"scale": 450,
+
"data": "countries"
"center": [5,70],
+
},
"translate": [0,0],
+
"properties": {
"projection": "mercator"
+
"enter": {
  +
"path": {
  +
"field": "layout_path"
  +
}
  +
},
  +
"update": {
  +
"fill": {
  +
"field": "zipped.v"
  +
}
  +
},
  +
"hover": {
  +
"fill": {
  +
"value": "#989898"
  +
}
  +
}
  +
}
 
}
 
}
]
+
]
  +
}
  +
  +
</graph>
  +
  +
<graph>
  +
{
  +
"version": 2,
  +
"width": 100,
  +
"height": 100,
  +
"data": [
 
{
 
"name": "table",
  +
"values": [12,23,47,6,52,19],
 
"transform": [{"type": "pie","field": "data"}]
 
}
 
}
 
],
 
],
 
"scales": [
 
"scales": [
 
{
 
{
"name": "size",
+
"name": "r",
"type": "linear",
+
"type": "sqrt",
"domain": {"data": "points", "field": "size"},
+
"domain": {"data": "table","field": "data"},
"range": [5, 5]
+
"range": [20,100]
},
+
}
{
 
"name": "fill",
 
"type": "ordinal",
 
"domain": {"data": "points", "field": "fill"},
 
"range": "category20"
 
},
 
 
],
 
],
 
"marks": [
 
"marks": [
 
{
 
{
"name": "map",
+
"type": "arc",
"type": "path",
+
"from": {"data": "table"},
"from": {"data": "countries"},
 
 
"properties": {
 
"properties": {
 
"enter": {
 
"enter": {
"fill": {"value": "silver"},
+
"x": {"field": {"group": "width"},"mult": 0.5},
"stroke": {"value":"black" },
+
"y": {"field": {"group": "height"},"mult": 0.5},
"path": {"field": "layout_path"}
+
"startAngle": {"field": "layout_start"},
  +
"endAngle": {"field": "layout_end"},
}
 
  +
"innerRadius": {"value": 20},
  +
"outerRadius": {"scale": "r","field": "data"},
 
"stroke": {"value": "#fff"}
 
},
  +
"update": {"fill": {"value": "#ccc"} },
  +
"hover": {"fill": {"value": "pink"} }
 
}
 
}
 
},
 
},
 
{
 
{
"name": "circle",
+
"type": "text",
"type": "symbol",
+
"from": {"data": "table"},
"from": {"data": "points"},
 
 
"properties": {
 
"properties": {
 
"enter": {
 
"enter": {
"size": {"scale": "size", "value": "5"},
+
"x": {"field": {"group": "width"},"mult": 0.5},
"fill": {"scale": "fill", "field": "fill" },
+
"y": {"field": {"group": "height"},"mult": 0.5},
"fillOpacity": {"value": 1},
+
"radius": {"scale": "r","field": "data","offset": 8},
"stroke": {"scale": "fill", "field": "fill" },
+
"theta": {"field": "layout_mid"},
"strokeWidth": {"value": 1},
+
"fill": {"value": "#000"},
"x": {"field": "layout_x"},
+
"align": {"value": "center"},
"y": {"field": "layout_y"}
+
"baseline": {"value": "middle"},
 
"text": {"field": "data"}
 
}
 
}
 
}
 
}

Текущая версия от 17:24, 7 ноября 2022

Синтаксическая ошибка