Format: Diaspora/Graf: Diferență între versiuni

De la alegeri.md
Salt la: navigare, căutare
 
(Nu s-au afișat 16 versiuni intermediare efectuate de același utilizator)
Linia 1: Linia 1:
 +
<div class="hidden-xs hidden-sm">
 
<graph>{
 
<graph>{
"version": 2,
+
"version":2,
"description": "Votarea peste hotarele Republicii Moldova",
+
"description":"Votarea peste hotarele Republicii Moldova",
"height": 200,
+
"height":200,
"width": 800,
+
"width":850,
// "viewport": [945,230],
 
// "padding": 5,
 
//"padding": {"top": 15, "left": 33, "bottom": 25, "right": 1},
 
 
//
 
//
 
"data": [
 
"data": [
 
{
 
{
"name": "table",
+
"name":"table",
 
"values": [
 
"values": [
{"year": " 1994 ", "stations": 6, "voters": 1948},
+
{"year":" 1994 ", "stations":6, "voters":1948},
{"year": " 1996 ", "stations": 14, "voters": 3072},
+
{"year":" 1996 ", "stations":14, "voters":3072},
{"year": " 1998 ", "stations": 20, "voters": 3234},
+
{"year":" 1996 ", "stations":14, "voters":4295},
{"year": " 2001 ", "stations": 20, "voters": 3804},
+
{"year":" 1998 ", "stations":20, "voters":3234},
{"year": " 2005 ", "stations": 23, "voters": 10018},
+
{"year":" 2001 ", "stations":20, "voters":3804},
{"year": "apr 2009", "stations": 33, "voters": 16914},
+
{"year":" 2005 ", "stations":23, "voters":10018},
{"year": "iul 2009", "stations": 33, "voters": 17544},
+
{"year":"apr 2009", "stations":33, "voters":16914},
{"year": " 2010 ", "stations": 75, "voters": 64199},
+
{"year":"iul 2009", "stations":33, "voters":17544},
{"year": " 2014 ", "stations": 95, "voters": 73311},
+
{"year":" 2010 ", "stations":75, "voters":64199},
{"year": " 2016 ", "stations": 100, "voters": 67205},
+
{"year":" 2014 ", "stations":95, "voters":73311},
{"year": " 2019 ", "stations": 123, "voters": 76583},
+
{"year":" 2016 ", "stations":100, "voters":67205},
 +
{"year":" 2016 ", "stations":100, "voters":138720},
 +
{"year":" 2019 ", "stations":123, "voters":76583},
 +
{"year":" 2020 ", "stations":139, "voters":150022},
 +
{"year":" 2020 ", "stations":139, "voters":263177},
 +
{"year":" 2021 ", "stations":150, "voters":212434},
 +
]
 +
},
 +
{
 +
"name":"table2",
 +
"values": [
 +
{"year":" 1994 ", "stations":6, "voters":1948},
 +
{"year":" 1996 ", "stations":14, "voters":3072},
 +
{"year":" 1996 ", "stations":14, "voters":4295},
 +
{"year":" 1998 ", "stations":20, "voters":3234},
 +
{"year":" 2001 ", "stations":20, "voters":3804},
 +
{"year":" 2005 ", "stations":23, "voters":10018},
 +
{"year":"apr 2009", "stations":33, "voters":16914},
 +
{"year":"iul 2009", "stations":33, "voters":17544},
 +
{"year":" 2010 ", "stations":75, "voters":64199},
 +
{"year":" 2014 ", "stations":95, "voters":73311},
 +
{"year":" 2016 ", "stations":100, "voters":67205},
 +
{"year":" 2016 ", "stations":100, "voters":138720},
 +
{"year":" 2019 ", "stations":123, "voters":76583},
 +
{"year":" 2020 ", "stations":139, "voters":150022},
 +
{"year":" 2020 ", "stations":139, "voters":263177},
 +
{"year":" 2021 ", "stations":150, "voters":212434},
 
]
 
]
 
}
 
}
Linia 29: Linia 53:
 
"signals": [
 
"signals": [
 
{
 
{
"name": "tooltip",
+
"name":"tooltip",
 
"init": {},
 
"init": {},
 
"streams": [
 
"streams": [
{"type": "rect:mouseover", "expr": "datum"},
+
{"type":"rect:mouseover", "expr":"datum"},
{"type": "rect:mouseout", "expr": "{}"}
+
{"type":"rect:mouseout", "expr":"{}"}
 
]
 
]
 
}
 
}
Linia 40: Linia 64:
 
"predicates": [
 
"predicates": [
 
{
 
{
"name": "tooltip", "type": "==",  
+
"name":"tooltip", "type":"==",  
"operands": [{"signal": "tooltip._id"}, {"arg": "id"}]
+
"operands": [{"signal":"tooltip._id"}, {"arg":"id"}]
 
}
 
}
 
],
 
],
Linia 47: Linia 71:
 
"scales": [
 
"scales": [
 
{
 
{
"name": "x",
+
"name":"x",
"type": "ordinal",
+
"type":"ordinal",
"range": "width",
+
"range":"width",
//"width": {"value":10},
+
"padding":0.74,
"padding": 0.8,
+
// "round":true,
// "round": true,
+
"domain": {"data":"table", "field":"year"}
"domain": {"data": "table", "field": "year"}
 
 
},
 
},
 
{
 
{
"name": "y",
+
"name":"y",
"type": "linear",
+
"type":"linear",
"range": "height",
+
"range":"height",
"nice": true,
+
"nice":true,
"domain": {"data": "table", "field": "stations"}
+
"domain": {"data":"table", "field":"stations"}
 
},
 
},
 
{
 
{
"name": "y2",
+
"name":"y2",
"type": "linear",
+
"type":"linear",
"range": "height",
+
"range":"height",
"nice": true,
+
"nice":true,
"domain": {"data": "table", "field": "voters"}
+
"domain": {"data":"table", "field":"voters"}
 
}
 
}
 
],
 
],
Linia 73: Linia 96:
 
"axes": [
 
"axes": [
 
{
 
{
"type": "x",
+
"type":"x",
"scale": "x",
+
"scale":"x",
// "grid": true,
 
//"values": ["7 mar", "31 iul"],
 
 
"properties":
 
"properties":
 
{
 
{
"ticks": {"stroke": {"value": "#aaa"}},
+
"ticks": {"stroke": {"value":"#aaa"}},
"labels": {"fill": {"value": "#666"}, "fontSize": {"value": 12}},
+
"labels": {"fill": {"value":"#666"}, "fontSize": {"value":12}},
"axis": {"stroke": {"value": "#ccc"}}
+
"axis": {"stroke": {"value":"#ccc"}}
 
}
 
}
 
},
 
},
 
{
 
{
"type": "y",
+
"type":"y",
"scale": "y",
+
"scale":"y",
"ticks": 6, // кол-во значений на оси y
+
"ticks":6,
"orient": "right",
+
"orient":"right",
"title": "Secțiile de votare",
+
"title":"Secții de votare",
//"grid": true,
 
 
"properties":
 
"properties":
 
{
 
{
"ticks": {"stroke": {"value": "#d9d9d9"}},
+
"ticks": {"stroke": {"value":"#d9d9d9"}},
"labels": {"fill": {"value": "#666"}, "fontSize": {"value": 12}},
+
"labels": {"fill": {"value":"#666"}, "fontSize":{"value":12}},
"axis": {"stroke": {"value": "#ccc"}}
+
"axis": {"stroke": {"value":"#ccc"}},
 +
"title": {"fill": {"value":"#999"}, "fontSize": {"value":12}, "fontWeight": {"value":"italic"}, "x": {"value":-12}}
 
}
 
}
 
},
 
},
 
{
 
{
"type": "y",
+
"type":"y",
"scale": "y2",
+
"scale":"y2",
"title": "Alegători",
+
"ticks":5,
"grid": true,
+
//"values": [10000,50000,100000,150000,200000,263177],
 +
"title":"Alegători",
 +
"grid":true,
 
"properties":
 
"properties":
 
{
 
{
"ticks": {"stroke": {"value": "#d9d9d9"}},
+
"ticks": {"stroke": {"value":"#d9d9d9"}},
"labels": {"fill": {"value": "#666"}, "fontSize": {"value": 12}},
+
"labels": {"fill": {"value":"#666"}, "fontSize": {"value": 12}},
"axis": {"stroke": {"value": "#ccc"}}
+
"axis": {"stroke": {"value":"#ccc"}},
 +
"title": {"fill": {"value":"#a6c26b"}, "fontSize": {"value":12}, "fontWeight": {"value":"italic"}, "x": {"value":12}}
 
}
 
}
 
}
 
}
Linia 114: Linia 138:
 
"marks": [
 
"marks": [
 
{
 
{
"type": "rect",
+
"type":"rect",
"from": {"data": "table"},
+
"from": {"data":"table"},
 
"properties": {
 
"properties": {
 
"enter": {
 
"enter": {
"x": {"scale": "x", "field": "year"},
+
"x": {"scale":"x", "field":"year"},
"width": {"scale": "x", "band": 1, "offset": 0},
+
"width": {"scale":"x", "band":true, "offset":0},
"y": {"scale": "y", "field": "stations"},
+
"y": {"scale":"y", "field":"stations"},
"y2": {"scale": "y", "value": 0},
+
"y2": {"scale":"y", "value":0},
 
},
 
},
"update": {"fill": {"value": "#ccc"}},
+
"update": {"fill": {"value":"#ccc"}},
"hover": {"fill": {"value": "#999"}},
+
"hover": {"fill": {"value":"#999"}},
 
}
 
}
 
},
 
},
 
{
 
{
 
"type":"line",
 
"type":"line",
 +
"from": {"data":"table2"},
 +
"properties": {
 +
"enter": {
 +
"x": {"scale":"x", "field":"year", "offset":9},
 +
"y": {"scale":"y2", "field":"voters"},
 +
"stroke": {"value":"#9bbb59"},
 +
"strokeWidth": {"value":2},
 +
//"interpolate": {"value":"linear"}
 +
}
 +
}
 +
},
 +
    {
 +
      "type":"symbol",
 +
      "from": {"data":"table2"},
 +
      "properties": {
 +
        "enter": {
 +
          "x": {"scale":"x", "field":"year", "offset":9},
 +
          "y": {"scale":"y2", "field":"voters"},
 +
          "stroke": {"value":"#9bbb59"},
 +
          "fill": {"value":"white"},
 +
          "size": {"value":20}
 +
        }
 +
      }
 +
    },
 +
{
 +
"type":"text",
 +
"properties": {
 +
"enter": {
 +
"align": {"value":"center"},
 +
"fill": {"value":"#666"},
 +
},
 +
"update": {
 +
"x": {"scale":"x", "signal":"tooltip.year"},
 +
"dx": {"scale":"x", "mult":0.5, "band":true},
 +
"y": {"scale":"y", "offset":-4, "signal":"tooltip.stations"},
 +
"text": {"signal":"tooltip.stations"},
 +
"fontSize": {"value":12},
 +
"fillOpacity": {
 +
"rule": [
 +
{
 +
"predicate": {"name":"tooltip", "id": {"value":null}},
 +
"value":0
 +
},
 +
{"value":1}
 +
]
 +
}
 +
}
 +
}
 +
},
 +
{
 +
"type":"text",
 +
"properties": {
 +
"enter": {
 +
"x": {"signal":"width", "mult":0.5},
 +
"y": {"value":-10},
 +
"text": {"template":"Votarea în străinătate în perioada 1994–2021"},
 +
"fill": {"value":"#336"},
 +
"fontSize": {"value":15},
 +
"align": {"value":"center"},
 +
"fontWeight": {"value":"bold"}
 +
}
 +
}
 +
}
 +
]
 +
}</graph>
 +
</div>
 +
<div class="hidden-md hidden-lg">
 +
<graph>{
 +
"version":2,
 +
"description":"Votarea peste hotarele Republicii Moldova",
 +
"height":200,
 +
"width":450,
 +
//
 +
"data": [
 +
{
 +
"name":"table",
 +
"values": [
 +
{"year":" 1994 ", "stations":6, "voters":1948},
 +
{"year":" 1996 ", "stations":14, "voters":3072},
 +
{"year":" 1996 ", "stations":14, "voters":4295},
 +
{"year":" 1998 ", "stations":20, "voters":3234},
 +
{"year":" 2001 ", "stations":20, "voters":3804},
 +
{"year":" 2005 ", "stations":23, "voters":10018},
 +
{"year":" 04/09 ", "stations":33, "voters":16914},
 +
{"year":" 07/09 ", "stations":33, "voters":17544},
 +
{"year":" 2010 ", "stations":75, "voters":64199},
 +
{"year":" 2014 ", "stations":95, "voters":73311},
 +
{"year":" 2016 ", "stations":100, "voters":67205},
 +
{"year":" 2016 ", "stations":100, "voters":138720},
 +
{"year":" 2019 ", "stations":123, "voters":76583},
 +
{"year":" 2020 ", "stations":139, "voters":150022},
 +
{"year":" 2020 ", "stations":139, "voters":263177},
 +
{"year":" 2021 ", "stations":150, "voters":212434},
 +
]
 +
},
 +
{
 +
"name":"table2",
 +
"values": [
 +
{"year":" 1994 ", "stations":6, "voters":1948},
 +
{"year":" 1996 ", "stations":14, "voters":3072},
 +
{"year":" 1996 ", "stations":14, "voters":4295},
 +
{"year":" 1998 ", "stations":20, "voters":3234},
 +
{"year":" 2001 ", "stations":20, "voters":3804},
 +
{"year":" 2005 ", "stations":23, "voters":10018},
 +
{"year":" 04/09 ", "stations":33, "voters":16914},
 +
{"year":" 07/09 ", "stations":33, "voters":17544},
 +
{"year":" 2010 ", "stations":75, "voters":64199},
 +
{"year":" 2014 ", "stations":95, "voters":73311},
 +
{"year":" 2016 ", "stations":100, "voters":67205},
 +
{"year":" 2016 ", "stations":100, "voters":138720},
 +
{"year":" 2019 ", "stations":123, "voters":76583},
 +
{"year":" 2020 ", "stations":139, "voters":150022},
 +
{"year":" 2020 ", "stations":139, "voters":263177},
 +
{"year":" 2021 ", "stations":150, "voters":212434},
 +
]
 +
}
 +
],
 +
//
 +
"signals": [
 +
{
 +
"name":"tooltip",
 +
"init": {},
 +
"streams": [
 +
{"type":"rect:mouseover", "expr":"datum"},
 +
{"type":"rect:mouseout", "expr":"{}"}
 +
]
 +
}
 +
],
 +
//
 +
"predicates": [
 +
{
 +
"name":"tooltip", "type":"==",
 +
"operands": [{"signal":"tooltip._id"}, {"arg":"id"}]
 +
}
 +
],
 +
//
 +
"scales": [
 +
{
 +
"name":"x",
 +
"type":"ordinal",
 +
"range":"width",
 +
"padding":0.64,
 +
// "round":true,
 +
"domain": {"data":"table", "field":"year"}
 +
},
 +
{
 +
"name":"y",
 +
"type":"linear",
 +
"range":"height",
 +
"nice":true,
 +
"domain": {"data":"table", "field":"stations"}
 +
},
 +
{
 +
"name":"y2",
 +
"type":"linear",
 +
"range":"height",
 +
"nice":true,
 +
"domain": {"data":"table", "field":"voters"}
 +
}
 +
],
 +
//
 +
"axes": [
 +
{
 +
"type":"x",
 +
"scale":"x",
 +
"properties":
 +
{
 +
"ticks": {"stroke": {"value":"#aaa"}},
 +
"labels": {"fill": {"value":"#666"}, "fontSize": {"value":12}},
 +
"axis": {"stroke": {"value":"#ccc"}}
 +
}
 +
},
 +
{
 +
"type":"y",
 +
"scale":"y",
 +
"ticks":6,
 +
"orient":"right",
 +
"title":"Secții de votare",
 +
"properties":
 +
{
 +
"ticks": {"stroke": {"value":"#d9d9d9"}},
 +
"labels": {"fill": {"value":"#666"}, "fontSize":{"value":12}},
 +
"axis": {"stroke": {"value":"#ccc"}},
 +
"title": {"fill": {"value":"#999"}, "fontSize": {"value":12}, "fontWeight": {"value":"italic"}, "x": {"value":-12}}
 +
}
 +
},
 +
{
 +
"type":"y",
 +
"scale":"y2",
 +
"title":"Alegători",
 +
"ticks":5,
 +
"format":"s",
 +
"grid":true,
 +
"properties":
 +
{
 +
"ticks": {"stroke": {"value":"#d9d9d9"}},
 +
"labels": {"fill": {"value":"#666"}, "fontSize": {"value": 12}},
 +
"axis": {"stroke": {"value":"#ccc"}},
 +
"title": {"fill": {"value":"#a6c26b"}, "fontSize": {"value":12}, "fontWeight": {"value":"italic"}, "x": {"value":12}}
 +
}
 +
}
 +
],
 +
//
 +
"marks": [
 +
{
 +
"type":"rect",
 
"from": {"data":"table"},
 
"from": {"data":"table"},
 
"properties": {
 
"properties": {
 
"enter": {
 
"enter": {
 
"x": {"scale":"x", "field":"year"},
 
"x": {"scale":"x", "field":"year"},
 +
"width": {"scale":"x", "band":true, "offset":0},
 +
"y": {"scale":"y", "field":"stations"},
 +
"y2": {"scale":"y", "value":0},
 +
},
 +
"update": {"fill": {"value":"#ccc"}},
 +
"hover": {"fill": {"value":"#999"}},
 +
}
 +
},
 +
{
 +
"type":"line",
 +
"from": {"data":"table2"},
 +
"properties": {
 +
"enter": {
 +
"x": {"scale":"x", "field":"year", "offset":7},
 
"y": {"scale":"y2", "field":"voters"},
 
"y": {"scale":"y2", "field":"voters"},
 
"stroke": {"value":"#9bbb59"},
 
"stroke": {"value":"#9bbb59"},
 
"strokeWidth": {"value":2},
 
"strokeWidth": {"value":2},
//"interpolate": {"value":"step-after"}
+
//"interpolate": {"value":"linear"}
 
}
 
}
 
}
 
}
 
},
 
},
 
    {
 
    {
      "type": "symbol",
+
      "type":"symbol",
      "from": {"data": "table"},
+
      "from": {"data":"table2"},
 
      "properties": {
 
      "properties": {
 
        "enter": {
 
        "enter": {
          "x": {"scale": "x","field": "year"},
+
          "x": {"scale":"x", "field":"year", "offset":7},
          "y": {"scale": "y2","field": "voters"},
+
          "y": {"scale":"y2", "field":"voters"},
          "stroke": {"value": "#9bbb59"},
+
          "stroke": {"value":"#9bbb59"},
          "fill": {"value": "white"},
+
          "fill": {"value":"white"},
          "size": {"value": 20}
+
          "size": {"value":20}
 
        }
 
        }
 
      }
 
      }
 
    },
 
    },
 
{
 
{
"type": "text",
+
"type":"text",
 
"properties": {
 
"properties": {
 
"enter": {
 
"enter": {
"align": {"value": "center"},
+
"align": {"value":"center"},
"fill": {"value": "#666"},
+
"fill": {"value":"#666"},
 
},
 
},
 
"update": {
 
"update": {
"x": {"scale": "x", "signal": "tooltip.year"},
+
"x": {"scale":"x", "signal":"tooltip.year"},
"dx": {"scale": "x", "mult": 0.5, "band": true},
+
"dx": {"scale":"x", "mult":0.5, "band":true},
"y": {"scale": "y", "offset": -4, "signal": "tooltip.stations"},
+
"y": {"scale":"y", "offset":-4, "signal":"tooltip.stations"},
"text": {"signal": "tooltip.stations"},
+
"text": {"signal":"tooltip.stations"},
"fontSize": {"value": 12},
+
"fontSize": {"value":12},
 
"fillOpacity": {
 
"fillOpacity": {
 
"rule": [
 
"rule": [
 
{
 
{
"predicate": {"name": "tooltip", "id": {"value": null}},
+
"predicate": {"name":"tooltip", "id": {"value":null}},
"value": 0
+
"value":0
 
},
 
},
{"value": 1}
+
{"value":1}
 
]
 
]
 
}
 
}
Linia 183: Linia 427:
 
"enter": {
 
"enter": {
 
"x": {"signal":"width", "mult":0.5},
 
"x": {"signal":"width", "mult":0.5},
"y": {"value": -10},
+
"y": {"value":-10},
"text": {"template":"Votarea în străinătate în perioada 1994–2019"},
+
"text": {"template":"Votarea în străinătate în perioada 1994–2021"},
 
"fill": {"value":"#336"},
 
"fill": {"value":"#336"},
 
"fontSize": {"value":15},
 
"fontSize": {"value":15},
Linia 194: Linia 438:
 
]
 
]
 
}</graph>
 
}</graph>
 +
</div>

Versiunea curentă din 9 octombrie 2021 12:00