Skip to content

Commit

Permalink
update district names in shiny app
Browse files Browse the repository at this point in the history
  • Loading branch information
polettif committed Aug 25, 2022
1 parent b9dd263 commit 9865ca8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/shinyapp.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,13 @@ run_app = function(votes_matrix = NULL, district_seats = NULL) {
run_biproporz = function() {
if(sum(input$votes_matrix) == 0) return(NULL)
if(sum(input$district_seats_matrix) == 0) return(NULL)
if(any(nchar(colnames(input$votes_matrix)) == 0)) return(NULL)

district_seats = input$district_seats_matrix
if(ncol(district_seats) > 1 && isTRUE(input$set_seats_per_district)) {
colnames(district_seats) <- colnames(input$votes_matrix)
shinyMatrix::updateMatrixInput(session, "district_seats_matrix", district_seats)
}
district_seats <- district_seats[1,]

bp = biproporz(input$votes_matrix, district_seats,
Expand Down

0 comments on commit 9865ca8

Please sign in to comment.