Skip to content

Commit

Permalink
Update app to include recent election results
Browse files Browse the repository at this point in the history
  • Loading branch information
stesiam committed Jun 9, 2024
1 parent 17a246d commit 2878744
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 53 deletions.
153 changes: 107 additions & 46 deletions app/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ ui <- add_cookie_handlers(
)
),
tags$th(i18n$t("New Democracy"),
tags$div(class = "party-orientation",
tags$div(class = "established",
tags$div(
icon("compass")
icon("user-tie")
),
tags$div(i18n$t("Center-right/Right"))
tags$div(
tags$p(i18n$t("Mitsotakis K.")))
),
tags$div(class = "established",
tags$div(
Expand All @@ -84,7 +85,7 @@ ui <- add_cookie_handlers(
tags$p("1974"))
)
),
tags$th(tags$input(id = "nd_pct", value =40.56, type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
tags$th(tags$input(id = "nd_pct", value =27.9, type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
tags$th(textOutput("nd_seats"))
),
tags$tr(
Expand All @@ -96,11 +97,12 @@ ui <- add_cookie_handlers(
)
),
tags$th(i18n$t("SYRIZA"),
tags$div(class = "party-orientation",
tags$div(class = "established",
tags$div(
icon("compass")
icon("user-tie")
),
tags$div(i18n$t("Center-left/Left"))
tags$div(
tags$p(i18n$t("Kasselakis S.")))
),
tags$div(class = "established",
tags$div(
Expand All @@ -109,7 +111,7 @@ ui <- add_cookie_handlers(
tags$div(
tags$p("2004"))
)),
tags$th(tags$input(id = "syriza_pct", value =17.83, type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
tags$th(tags$input(id = "syriza_pct", value =14.9, type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
tags$th(textOutput("syriza_seats"))
),
tags$tr(
Expand All @@ -121,11 +123,12 @@ ui <- add_cookie_handlers(
)
),
tags$th(i18n$t("PASOK"),
tags$div(class = "party-orientation",
tags$div(class = "established",
tags$div(
icon("compass")
icon("user-tie")
),
tags$div(i18n$t("Center-left"))
tags$div(
tags$p(i18n$t("Androulakis N.")))
),
tags$div(class = "established",
tags$div(
Expand All @@ -134,58 +137,60 @@ ui <- add_cookie_handlers(
tags$div(
tags$p("1974"))
)),
tags$th(tags$input(id = "pasok_pct", value =11.84, type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
tags$th(tags$input(id = "pasok_pct", value =12.89, type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
tags$th(textOutput("pasok_seats"))
),
tags$tr(
tags$th(
div(class="avatar",
div(class="mask mask-squircle w-12 h-12",
tags$img(src="kke_logo.png", alt="KKE logo"),
tags$img(src="ellisi_logo.png", alt="KKE logo"),
)
)
),
tags$th(i18n$t("KKE"),
tags$div(class = "party-orientation",
tags$th(i18n$t("Greek Solution"),
tags$div(class = "established",
tags$div(
icon("compass")
icon("user-tie")
),
tags$div(i18n$t("Far-left"))
tags$div(
tags$p(i18n$t("Velopoulos K.")))
),
tags$div(class = "established",
tags$div(
icon("calendar-days")
),
tags$div(
tags$p("1918"))
tags$p("2016"))
)),
tags$th(tags$input(id = "kke_pct", value =7.69, type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
tags$th(textOutput("kke_seats"))
tags$th(tags$input(id = "ellisi_pct", value =9.52, type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
tags$th(textOutput("ellisi_seats"))
),
tags$tr(
tags$th(
div(class="avatar",
div(class="mask mask-squircle w-12 h-12",
tags$img(src="ellisi_logo.png", alt="KKE logo"),
tags$img(src="kke_logo.png", alt="KKE logo"),
)
)
),
tags$th(i18n$t("Elliniki Lysi"),
tags$div(class = "party-orientation",
tags$th(i18n$t("KKE"),
tags$div(class = "established",
tags$div(
icon("compass")
icon("user-tie")
),
tags$div(i18n$t("Right/Far-right"))
tags$div(
tags$p(i18n$t("Koutsoumpas D.")))
),
tags$div(class = "established",
tags$div(
icon("calendar-days")
),
tags$div(
tags$p("2016"))
tags$p("1918"))
)),
tags$th(tags$input(id = "ellisi_pct", value =4.44, type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
tags$th(textOutput("ellisi_seats"))
tags$th(tags$input(id = "kke_pct", value =9.3, type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
tags$th(textOutput("kke_seats"))
),
tags$tr(
tags$th(
Expand All @@ -196,20 +201,22 @@ ui <- add_cookie_handlers(
)
),
tags$th(i18n$t("Niki"),
tags$div(class = "party-orientation",
tags$div(class = "established",
tags$div(
icon("compass")
icon("user-tie")
),
tags$div(i18n$t("Far-right"))
tags$div(
tags$p(i18n$t("Natsios D.")))
),
tags$div(class = "established",
tags$div(
icon("calendar-days")
),
tags$div(
tags$p("2019"))
)),
tags$th(tags$input(id = "niki_pct", value =3.7, type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
)
),
tags$th(tags$input(id = "niki_pct", value =4.43, type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
tags$th(textOutput("niki_seats"))
),
tags$tr(
Expand All @@ -220,12 +227,13 @@ ui <- add_cookie_handlers(
)
)
),
tags$th(i18n$t("Plefsi"),
tags$div(class = "party-orientation",
tags$th(i18n$t("Course of Freedom"),
tags$div(class = "established",
tags$div(
icon("compass")
icon("user-tie")
),
tags$div(i18n$t("Catch-all"))
tags$div(
tags$p(i18n$t("Konstantopoulou, Z.")))
),
tags$div(class = "established",
tags$div(
Expand All @@ -234,9 +242,34 @@ ui <- add_cookie_handlers(
tags$div(
tags$p("2016"))
)),
tags$th(tags$input(id = "plefsi_pct", value =3.17,type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
tags$th(tags$input(id = "plefsi_pct", value =3.42,type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
tags$th(textOutput("plefsi_seats"))
),
tags$tr(
tags$th(
div(class="avatar",
div(class="mask mask-squircle w-12 h-12"
)
)
),
tags$th(i18n$t("Foni Logikis"),
tags$div(class = "established",
tags$div(
icon("user-tie")
),
tags$div(
tags$p(i18n$t("Latinopoulou A.")))
),
tags$div(class = "established",
tags$div(
icon("calendar-days")
),
tags$div(
tags$p("2023"))
)),
tags$th(tags$input(id = "foni_pct", value =3.06, type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
tags$th(textOutput("foni_seats"))
),
tags$tr(
tags$th(
div(class="avatar",
Expand All @@ -246,22 +279,49 @@ ui <- add_cookie_handlers(
)
),
tags$th(i18n$t("MeRA25"),
tags$div(class = "party-orientation",
tags$div(class = "established",
tags$div(
icon("compass")
),
tags$div(i18n$t("Left"))
icon("user-tie")
),
tags$div(
tags$p(i18n$t("Varoufakis Y.")))
),
tags$div(class = "established",
tags$div(
icon("calendar-days")
),
tags$div(
tags$p("2018"))
)),
tags$th(tags$input(id = "mera25_pct", value =2.5, type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
tags$th(tags$input(id = "mera25_pct", value =2.46, type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
tags$th(textOutput("mera_seats"))
),
tags$tr(
tags$th(
div(class="avatar",
div(class="mask mask-squircle w-12 h-12",
tags$img(src="", alt="Nea Aristera logo"),
)
)
),
tags$th(i18n$t("New Left"),
tags$div(class = "established",
tags$div(
icon("user-tie")
),
tags$div(
tags$p(i18n$t("Haritsis A.")))
),
tags$div(class = "established",
tags$div(
icon("calendar-days")
),
tags$div(
tags$p("2024"))
)),
tags$th(tags$input(id = "nar_pct", value =2.41, type="text", placeholder="Type here", class="input input-bordered input-primary w-full max-w-xs")),
tags$th(textOutput("nar_seats"))
),
tags$tr(
tags$th(
div(class="avatar",
Expand Down Expand Up @@ -345,10 +405,10 @@ observeEvent(input$selected_language, {

data = reactive({
data.frame(
"Party" = c("ND", "SYRIZA", "PASOK","KKE","Ellisi", "Niki", "Plefsi", "Mera", "Other1", "Other2"),
"Party" = c("ND", "SYRIZA", "PASOK","KKE","Ellisi", "Niki", "Plefsi", "Mera", "Other1", "Other2", "Foni Logikis", "Nea Aristera"),
"Perc" = c(input$nd_pct, input$syriza_pct, input$pasok_pct, input$kke_pct,
input$ellisi_pct, input$niki_pct, input$plefsi_pct, input$mera25_pct,
input$other1_pct, input$other2_pct)
input$other1_pct, input$other2_pct, input$foni_pct, input$nar_pct)
)
})

Expand Down Expand Up @@ -388,7 +448,8 @@ observeEvent(input$selected_language, {
output$mera_seats = renderText({ calc_seats()$IntSeats[[8]] })
output$other1_seats = renderText({ calc_seats()$IntSeats[[9]] })
output$other2_seats = renderText({ calc_seats()$IntSeats[[10]] })

output$foni_seats = renderText({ calc_seats()$IntSeats[[11]] })
output$nar_seats = renderText({ calc_seats()$IntSeats[[12]] })

observeEvent(input$selected_language, {
shiny.i18n::update_lang("el", session)
Expand Down
7 changes: 3 additions & 4 deletions app/www/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@ html{
display: flex;
flex-direction: row;
gap: 0.5em;
font-size: 0.8em;
font-size: 0.7em;
align-items: center;
font-family: Ubuntu;
font-weight: normal;
}

.established p{
font
}
18 changes: 15 additions & 3 deletions app/www/translations/translation_el.csv
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ en,el
"SYRIZA","ΣΥΡΙΖΑ"
"PASOK","ΠΑΣΟΚ"
"KKE","ΚΚΕ"
"Elliniki Lysi", "Ελληνική Λύση"
"Greek Solution", "Ελληνική Λύση"
"Niki", "Νίκη"
"Plefsi", "Πλεύση Ελευθερίας"
"Course of Freedom", "Πλεύση Ελευθερίας"
"Foni Logikis", "Φωνή Λογικής"
"MeRA25", "ΜέΡΑ25"
"New Left", "Νέα Αριστερά"
"Other Party #1", "Άλλο κόμμα #1"
"Other Party #2", "Άλλο κόμμα #2"
"Choose Electoral System: ", "Εκλογικό σύστημα: "
Expand All @@ -28,4 +30,14 @@ en,el
"Far-right", "Ακροδεξιά"
"Catch-all", "Πολυσυλλεκτικό"
"Far-left", "Ακροαριστερά"
"Left", "Αριστερά"
"Left", "Αριστερά"
"Mitsotakis K.", "Μητσοτάκης Κ."
"Kasselakis S.", "Κασσελάκης Σ."
"Androulakis N.", "Ανδρουλάκης Ν."
"Velopoulos K.", "Βελόπουλος Κ."
"Koutsoumpas D.", "Κουτσούμπας Δ."
"Natsios D.", "Νατσιός Δ."
"Konstantopoulou Z.", "Κωνσταντοπούλου Ζ."
"Latinopoulou A.", "Λατινοπούλου Α."
"Varoufakis Y.", "Βαρουφάκης Γ."
"Haritsis A.", "Χαρίτσης Α."

0 comments on commit 2878744

Please sign in to comment.