From 0bbc1dbcb673fdd21b40e2f4340f07dd744b905e Mon Sep 17 00:00:00 2001 From: Jakub Wajs Date: Sat, 15 Jun 2019 00:53:51 +0200 Subject: [PATCH] Some refactoring --- Server/Results.R | 6 +----- UI/BalanceComponent.R | 17 ----------------- UI/UI.R | 12 ++++++++---- app.R | 3 ++- 4 files changed, 11 insertions(+), 27 deletions(-) delete mode 100644 UI/BalanceComponent.R diff --git a/Server/Results.R b/Server/Results.R index 0eebea8..d74effc 100644 --- a/Server/Results.R +++ b/Server/Results.R @@ -86,11 +86,7 @@ balancePercentage <- function(input, output) { # Summary statistics summaryStatistics <- function(input, output) { output$summary_statistics <- renderTable( - formattable(result <- goalsOverallSummary(getFilteredResultsForTeam(input), input$team), - list( - Home = color_tile("white", "orange") - ) - ), + goalsOverallSummary(getFilteredResultsForTeam(input), input$team), width = '100%', rownames = TRUE ) diff --git a/UI/BalanceComponent.R b/UI/BalanceComponent.R deleted file mode 100644 index 17c4a7a..0000000 --- a/UI/BalanceComponent.R +++ /dev/null @@ -1,17 +0,0 @@ -# Balance component - -balanceComponent <- function() -{ - tabsetPanel( - tabPanel("Bar graph", - wellPanel( - plotOutput("balance") - ) - ), - tabPanel("Pie chart", - wellPanel( - plotOutput("balancePieChart") - ) - ) - ) -} \ No newline at end of file diff --git a/UI/UI.R b/UI/UI.R index 800e6d2..5590319 100644 --- a/UI/UI.R +++ b/UI/UI.R @@ -4,7 +4,6 @@ # Import files source("UI/SidebarPanel.R") -source("UI/BalanceComponent.R") # UI ui <- navbarPage( @@ -62,13 +61,18 @@ ui <- navbarPage( ), column(9, fluidRow( + h2("Matches balance charts"), column( 6, - h2("Matches balance charts"), - balanceComponent() + wellPanel( + plotOutput("balance") + ) ), column( - 6 + 6, + wellPanel( + plotOutput("balancePieChart") + ) ) ), fluidRow( diff --git a/app.R b/app.R index ea4700f..97564ab 100644 --- a/app.R +++ b/app.R @@ -6,6 +6,8 @@ # # http://shiny.rstudio.com/ # +# Credits: Jakub Wajs 2019 +# library(shiny) library(dplyr) @@ -17,7 +19,6 @@ library(scales) library(tmap) library(tmaptools) library(leaflet) -library(formattable) # Load files source("Data/Loader.R")