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

Материал из wiki.energogroup.org
Перейти к навигации Перейти к поиску
 
(не показано 20 промежуточных версий этого же участника)
Строка 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>
 
{
 
{
"marks": [{
+
"version": 2,
"type": "symbol",
+
"width": 1,
"properties": {
+
"height": 1,
"enter": {
+
"data": [
"size": {"value": 5000},
+
{
"fill": {"value": "#000"},
+
"name": "highlights",
  +
"values": [{"id":"US","v":"blue"},{"id":"AU","v":"purple"},{"id":"CN","v":"red"},{"id":"BR","v":"pink"},{"id":"DZ","v":"green"}]
"shape": {
 
  +
},
"value": "M-0.5,0L0,-0.5 0.5,0 0.3,0 0.3,0.5 0.05,0.5 0.05,0.2 -0.05,0.2 -0.05,0.5 -0.3,0.5 -0.3,0 -0.5,0Z"
 
}
+
{
  +
"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>
"marks": [{
 
  +
"type": "symbol",
 
  +
<graph>
"properties": {
 
  +
{
"enter": {
 
"size": {"value": 40000},
+
"version": 2,
"fill": {"value": "#000"},
+
"width": 100,
"shape": {
+
"height": 100,
  +
"data": [
"value": "M0.3408,0.0984c0.0507,0,0.0919,0.0413,0.0919,0.0923c0,0.0262,-0.0109,0.0498,-0.0283,0.0666L0.256,0.4071L0.105,0.2546c-0.0158,-0.0166,-0.0256,-0.0391,-0.0256,-0.0639c0-0.051,0.0411,-0.0923,0.0919,-0.0923c0.0382,0,0.0709,0.0234,0.0848,0.0568C0.2698,0.1219,0.3026,0.0984,0.3408,0.0984 M0.3408,0.083z"
 
  +
{
  +
"name": "table",
  +
"values": [12,23,47,6,52,19],
  +
"transform": [{"type": "pie","field": "data"}]
  +
}
  +
],
  +
"scales": [
  +
{
  +
"name": "r",
  +
"type": "sqrt",
  +
"domain": {"data": "table","field": "data"},
  +
"range": [20,100]
  +
}
  +
],
  +
"marks": [
  +
{
  +
"type": "arc",
  +
"from": {"data": "table"},
  +
"properties": {
  +
"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"},
  +
"stroke": {"value": "#fff"}
  +
},
  +
"update": {"fill": {"value": "#ccc"} },
  +
"hover": {"fill": {"value": "pink"} }
  +
}
  +
},
  +
{
  +
"type": "text",
  +
"from": {"data": "table"},
  +
"properties": {
  +
"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"},
  +
"text": {"field": "data"}
  +
}
 
}
 
}
 
}
 
}
}
+
]
}]
 
 
 
}
 
}
 
</graph>
 
</graph>

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

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