Parties and mandates

Parties and mandates

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "title": "Рисков вот: Разлика мандати по партия",
  "data": {
    "values": [
      {"a": "БСП", "b": 3, "c": "#9c271c"},
      {"a": "ГЕРБ", "b": 2, "c": "#1c4d9c"},
      {"a": "ДБ", "b": 1, "c": "#9f0ce8"},
      {"a": "ДПС", "b": -7, "c": "#55c4e6"},
      {"a": "ИСМВ", "b": 0, "c": "#258a36"},
      {"a": "ИТН", "b": 1, "c": "#e6ba0b"}
    ]
  },
  "width": 600,
  "height": 400,
  "mark": "bar",
  "encoding": {
    "x": {
      "field": "a",
      "type": "nominal",
      "axis": {"labelAngle": 90},
      "title": "партия"
    },
    "y": {"field": "b", "type": "quantitative", "title": "мандати"},
    "color": {"field": "a", "scale": {"range": {"field": "c"}}},
    "tooltip": [
      {"field": "a", "type": "nominal", "title": "Партия"},
      {"field": "b", "type": "quantitative", "title": "Мандати"}
    ]
  },
  "config": {"legend": {"disable": true}}
}

Open the Chart in the Vega Editor

Candidate Preferences

The data is here

GERB

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {
    "url": "https://raw.githubusercontent.com/nikolatulechki/semanticElections/master/analysis/pref-viz/gerb_2021.csv"
  },
  "width": 1200,
  "height": 900,
  "mark": {
    "type": "circle",
    "opacity": 0.8,
    "stroke": "black",
    "strokeWidth": 1,
    "color":"#1c4d9c"
  },
  "encoding": {
    "x": {"field": "cand_number", "type": "ordinal", "axis": {"grid": false}},
    "y": {"field": "mir_norm", "type": "ordinal", "axis": {"title": ""}},
    "size": {
      "field": "pref_votes",
      "type": "quantitative",
      "scale": {"rangeMax": 5000}
    },
    "tooltip": [
      {"field": "mir_norm", "type": "ordinal", "title": "МИР"},
      {"field": "cand_number", "type": "ordinal", "title": "Номер"},
      {"field": "name", "type": "nominal", "title": "Кандидат"},
      {"field": "pref_votes", "type": "quantitative", "title": "Преференции"}
    ],
    "href" : {"field" : "link", "type": "nominal"}
  },
  "config": {"legend": {"disable": true}}
}

Open the Chart in the Vega Editor

fullscreen viz

DPS

Minor changes only

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {
    "url": "https://raw.githubusercontent.com/nikolatulechki/semanticElections/master/analysis/pref-viz/dps_2021.csv"
  },
  "width": 1200,
  "height": 900,
  "mark": {
    "type": "circle",
    "opacity": 0.8,
    "stroke": "black",
    "strokeWidth": 1,
    "color":"#55c4e6"
  },
  "encoding": {
    "x": {
      "field": "cand_number",
      "type": "ordinal",
      "axis": {"grid": false}
    },
    "y": {"field": "mir_norm", "type": "ordinal", "axis": {"title": ""}},
    "size": {
      "field": "pref_votes",
      "type": "quantitative",
      "scale": {"rangeMax": 5000}
    },
    "tooltip": [
      {"field": "mir_norm", "type": "ordinal", "title": "МИР"},
      {"field": "cand_number", "type": "ordinal", "title": "Номер"},
      {"field": "name", "type": "nominal", "title": "Кандидат"},
      {"field": "pref_votes", "type": "quantitative", "title": "Преференции"}

    ],
    "href" : {"field" : "link", "type": "nominal"}
  },
  "config": {"legend": {"disable": true}}
}

Open the Chart in the Vega Editor

Fullscreen viz

DB

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {
    "url": "https://raw.githubusercontent.com/nikolatulechki/semanticElections/master/analysis/pref-viz/db_2021.csv"
  },
  "width": 1200,
  "height": 900,
  "mark": {
    "type": "circle",
    "opacity": 0.8,
    "stroke": "black",
    "strokeWidth": 1,
    "color": "#7c189e" 
  },
  "encoding": {
    "x": {"field": "cand_number", "type": "ordinal", "axis": {"grid": false}},
    "y": {"field": "mir_norm", "type": "ordinal", "axis": {"title": ""}},
    "size": {
      "field": "pref_votes",
      "type": "quantitative",
      "scale": {"rangeMax": 5000}
    },
    "tooltip": [
      {"field": "mir_norm", "type": "ordinal", "title": "МИР"},
      {"field": "cand_number", "type": "ordinal", "title": "Номер"},
      {"field": "name", "type": "nominal", "title": "Кандидат"},
      {"field": "pref_votes", "type": "quantitative", "title": "Преференции"}
    ],
    "href" : {"field" : "link", "type": "nominal"}
  },
  "config": {"legend": {"disable": true}}
}

Open the Chart in the Vega Editor

Fullscreen viz

BSP

Fullscreen viz

ITN

Fullscreen viz

2021_07

GERB

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "title": "ГЕРБ - Разпределение на преференициалния вот - 11.07.2021",
  "data": {
    "url": "https://raw.githubusercontent.com/nikolatulechki/semanticElections/master/analysis/pref-viz/gerb_2021_07.csv"
  },
  "width": 1200,
  "height": 900,
  "mark": {
    "type": "circle",
    "opacity": 0.8,
    "stroke": "black",
    "strokeWidth": 1,
    "color": "#1c4d9c"
  },
  "encoding": {
    "x": {"field": "cand_number", "type": "ordinal", "axis": {"grid": false, "title": "Кандидат номер"}},
    "y": {"field": "mir_norm", "type": "ordinal", "axis": {"title": "МИР"}},
    "size": {
      "field": "pref_votes",
      "type": "quantitative",
      "scale": {"rangeMax": 5000}
    },
    "tooltip": [
      {"field": "mir_norm", "type": "ordinal", "title": "МИР"},
      {"field": "cand_number", "type": "ordinal", "title": "Номер"},
      {"field": "name", "type": "nominal", "title": "Кандидат"},
      {"field": "pref_votes", "type": "quantitative", "title": "Преференции"}
    ],
    "href": {"field": "link", "type": "nominal"}
  },
  "config": {"legend": {"disable": true}}
}

viz

ITN

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "title": "ПП ИТН - Разпределение на преференициалния вот - 11.07.2021",
  "data": {
    "url": "https://raw.githubusercontent.com/nikolatulechki/semanticElections/master/analysis/pref-viz/itn_2021_07.csv"
  },
  "width": 1200,
  "height": 900,
  "mark": {
    "type": "circle",
    "opacity": 0.8,
    "stroke": "black",
    "strokeWidth": 1,
    "color": "#07abecc2"
  },
  "encoding": {
    "x": {"field": "cand_number", "type": "ordinal", "axis": {"grid": false, "title": "Кандидат номер"}},
    "y": {"field": "mir_norm", "type": "ordinal", "axis": {"title": "МИР"}},
    "size": {
      "field": "pref_votes",
      "type": "quantitative",
      "scale": {"rangeMax": 5000}
    },
    "tooltip": [
      {"field": "mir_norm", "type": "ordinal", "title": "МИР"},
      {"field": "cand_number", "type": "ordinal", "title": "Номер"},
      {"field": "name", "type": "nominal", "title": "Кандидат"},
      {"field": "pref_votes", "type": "quantitative", "title": "Преференции"}
    ],
    "href": {"field": "link", "type": "nominal"}
  },
  "config": {"legend": {"disable": true}}
}

viz

BSP

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "title": "БСП  - Разпределение на преференициалния вот - 11.07.2021",
  "data": {
    "url": "https://raw.githubusercontent.com/nikolatulechki/semanticElections/master/analysis/pref-viz/bsp_2021_07.csv"
  },
  "width": 1200,
  "height": 900,
  "mark": {
    "type": "circle",
    "opacity": 0.8,
    "stroke": "black",
    "strokeWidth": 1,
    "color": "#be0b0bc2"
  },
  "encoding": {
    "x": {"field": "cand_number", "type": "ordinal", "axis": {"grid": false, "title": "Кандидат номер"}},
    "y": {"field": "mir_norm", "type": "ordinal", "axis": {"title": "МИР"}},
    "size": {
      "field": "pref_votes",
      "type": "quantitative",
      "scale": {"rangeMax": 5000}
    },
    "tooltip": [
      {"field": "mir_norm", "type": "ordinal", "title": "МИР"},
      {"field": "cand_number", "type": "ordinal", "title": "Номер"},
      {"field": "name", "type": "nominal", "title": "Кандидат"},
      {"field": "pref_votes", "type": "quantitative", "title": "Преференции"}
    ],
    "href": {"field": "link", "type": "nominal"}
  },
  "config": {"legend": {"disable": true}}
}

viz

DB

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "title": "ДБ  - Разпределение на преференициалния вот - 11.07.2021",
  "data": {
    "url": "https://raw.githubusercontent.com/nikolatulechki/semanticElections/master/analysis/pref-viz/db_2021_07.csv"
  },
  "width": 1200,
  "height": 900,
  "mark": {
    "type": "circle",
    "opacity": 0.8,
    "stroke": "black",
    "strokeWidth": 1,
    "color": "#aa03f8"
  },
  "encoding": {
    "x": {"field": "cand_number", "type": "ordinal", "axis": {"grid": false, "title": "Кандидат номер"}},
    "y": {"field": "mir_norm", "type": "ordinal", "axis": {"title": "МИР"}},
    "size": {
      "field": "pref_votes",
      "type": "quantitative",
      "scale": {"rangeMax": 5000}
    },
    "tooltip": [
      {"field": "mir_norm", "type": "ordinal", "title": "МИР"},
      {"field": "cand_number", "type": "ordinal", "title": "Номер"},
      {"field": "name", "type": "nominal", "title": "Кандидат"},
      {"field": "pref_votes", "type": "quantitative", "title": "Преференции"}
    ],
    "href": {"field": "link", "type": "nominal"}
  },
  "config": {"legend": {"disable": true}}
}

viz

ДПС

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "title": " ДПС - Разпределение на преференициалния вот - 11.07.2021",
  "data": {
    "url": "https://raw.githubusercontent.com/nikolatulechki/semanticElections/master/analysis/pref-viz/dps_2021_07.csv"
  },
  "width": 1200,
  "height": 900,
  "mark": {
    "type": "circle",
    "opacity": 0.8,
    "stroke": "black",
    "strokeWidth": 1,
    "color": "#4f667c"
  },
  "encoding": {
    "x": {"field": "cand_number", "type": "ordinal", "axis": {"grid": false, "title": "Кандидат номер"}},
    "y": {"field": "mir_norm", "type": "ordinal", "axis": {"title": "МИР"}},
    "size": {
      "field": "pref_votes",
      "type": "quantitative",
      "scale": {"rangeMax": 5000}
    },
    "tooltip": [
      {"field": "mir_norm", "type": "ordinal", "title": "МИР"},
      {"field": "cand_number", "type": "ordinal", "title": "Номер"},
      {"field": "name", "type": "nominal", "title": "Кандидат"},
      {"field": "pref_votes", "type": "quantitative", "title": "Преференции"}
    ],
    "href": {"field": "link", "type": "nominal"}
  },
  "config": {"legend": {"disable": true}}
}

viz

ISMV

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "title": "ИСБГ  - Разпределение на преференициалния вот - 11.07.2021",
  "data": {
    "url": "https://raw.githubusercontent.com/nikolatulechki/semanticElections/master/analysis/pref-viz/ismv_2021_07.csv"
  },
  "width": 1200,
  "height": 900,
  "mark": {
    "type": "circle",
    "opacity": 0.8,
    "stroke": "black",
    "strokeWidth": 1,
    "color": "#028d25"
  },
  "encoding": {
    "x": {"field": "cand_number", "type": "ordinal", "axis": {"grid": false, "title": "Кандидат номер"}},
    "y": {"field": "mir_norm", "type": "ordinal", "axis": {"title": "МИР"}},
    "size": {
      "field": "pref_votes",
      "type": "quantitative",
      "scale": {"rangeMax": 5000}
    },
    "tooltip": [
      {"field": "mir_norm", "type": "ordinal", "title": "МИР"},
      {"field": "cand_number", "type": "ordinal", "title": "Номер"},
      {"field": "name", "type": "nominal", "title": "Кандидат"},
      {"field": "pref_votes", "type": "quantitative", "title": "Преференции"}
    ],
    "href": {"field": "link", "type": "nominal"}
  },
  "config": {"legend": {"disable": true}}
}

viz