Format: Diaspora/Graf: Diferență între versiuni
De la alegeri.md
Oleg (Discuție | contribuții) |
Oleg (Discuție | contribuții) |
||
(Nu s-au afișat 9 versiuni intermediare efectuate de același utilizator) | |||
Linia 1: | Linia 1: | ||
+ | <div class="hidden-xs hidden-sm"> | ||
<graph>{ | <graph>{ | ||
"version":2, | "version":2, | ||
Linia 11: | Linia 12: | ||
{"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":" 1996 ", "stations":14, "voters":4295}, | ||
{"year":" 1998 ", "stations":20, "voters":3234}, | {"year":" 1998 ", "stations":20, "voters":3234}, | ||
{"year":" 2001 ", "stations":20, "voters":3804}, | {"year":" 2001 ", "stations":20, "voters":3804}, | ||
Linia 19: | Linia 21: | ||
{"year":" 2014 ", "stations":95, "voters":73311}, | {"year":" 2014 ", "stations":95, "voters":73311}, | ||
{"year":" 2016 ", "stations":100, "voters":67205}, | {"year":" 2016 ", "stations":100, "voters":67205}, | ||
+ | {"year":" 2016 ", "stations":100, "voters":138720}, | ||
{"year":" 2019 ", "stations":123, "voters":76583}, | {"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 89: | Linia 116: | ||
"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":- | + | "title": {"fill": {"value":"#999"}, "fontSize": {"value":12}, "fontWeight": {"value":"italic"}, "x": {"value":-12}} |
} | } | ||
}, | }, | ||
Linia 95: | Linia 122: | ||
"type":"y", | "type":"y", | ||
"scale":"y2", | "scale":"y2", | ||
+ | "ticks":5, | ||
+ | //"values": [10000,50000,100000,150000,200000,263177], | ||
"title":"Alegători", | "title":"Alegători", | ||
"grid":true, | "grid":true, | ||
Linia 102: | Linia 131: | ||
"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": | + | "title": {"fill": {"value":"#a6c26b"}, "fontSize": {"value":12}, "fontWeight": {"value":"italic"}, "x": {"value":12}} |
} | } | ||
} | } | ||
Linia 124: | Linia 153: | ||
{ | { | ||
"type":"line", | "type":"line", | ||
− | "from": {"data":" | + | "from": {"data":"table2"}, |
"properties": { | "properties": { | ||
"enter": { | "enter": { | ||
Linia 137: | Linia 166: | ||
{ | { | ||
"type":"symbol", | "type":"symbol", | ||
− | "from": {"data":" | + | "from": {"data":"table2"}, |
"properties": { | "properties": { | ||
"enter": { | "enter": { | ||
Linia 179: | Linia 208: | ||
"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 | + | "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"}, | ||
+ | "properties": { | ||
+ | "enter": { | ||
+ | "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"}, | ||
+ | "stroke": {"value":"#9bbb59"}, | ||
+ | "strokeWidth": {"value":2}, | ||
+ | //"interpolate": {"value":"linear"} | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | { | ||
+ | "type":"symbol", | ||
+ | "from": {"data":"table2"}, | ||
+ | "properties": { | ||
+ | "enter": { | ||
+ | "x": {"scale":"x", "field":"year", "offset":7}, | ||
+ | "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"}, | "fill": {"value":"#336"}, | ||
"fontSize": {"value":15}, | "fontSize": {"value":15}, | ||
Linia 189: | Linia 438: | ||
] | ] | ||
}</graph> | }</graph> | ||
+ | </div> |