Some refactoring

This commit is contained in:
Jakub Wajs 2019-06-15 00:53:51 +02:00
parent 93d8ab5e5a
commit 0bbc1dbcb6
4 changed files with 11 additions and 27 deletions

View File

@ -86,11 +86,7 @@ balancePercentage <- function(input, output) {
# Summary statistics # Summary statistics
summaryStatistics <- function(input, output) { summaryStatistics <- function(input, output) {
output$summary_statistics <- renderTable( output$summary_statistics <- renderTable(
formattable(result <- goalsOverallSummary(getFilteredResultsForTeam(input), input$team), goalsOverallSummary(getFilteredResultsForTeam(input), input$team),
list(
Home = color_tile("white", "orange")
)
),
width = '100%', width = '100%',
rownames = TRUE rownames = TRUE
) )

View File

@ -1,17 +0,0 @@
# Balance component
balanceComponent <- function()
{
tabsetPanel(
tabPanel("Bar graph",
wellPanel(
plotOutput("balance")
)
),
tabPanel("Pie chart",
wellPanel(
plotOutput("balancePieChart")
)
)
)
}

12
UI/UI.R
View File

@ -4,7 +4,6 @@
# Import files # Import files
source("UI/SidebarPanel.R") source("UI/SidebarPanel.R")
source("UI/BalanceComponent.R")
# UI # UI
ui <- navbarPage( ui <- navbarPage(
@ -62,13 +61,18 @@ ui <- navbarPage(
), ),
column(9, column(9,
fluidRow( fluidRow(
h2("Matches balance charts"),
column( column(
6, 6,
h2("Matches balance charts"), wellPanel(
balanceComponent() plotOutput("balance")
)
), ),
column( column(
6 6,
wellPanel(
plotOutput("balancePieChart")
)
) )
), ),
fluidRow( fluidRow(

3
app.R
View File

@ -6,6 +6,8 @@
# #
# http://shiny.rstudio.com/ # http://shiny.rstudio.com/
# #
# Credits: Jakub Wajs 2019
#
library(shiny) library(shiny)
library(dplyr) library(dplyr)
@ -17,7 +19,6 @@ library(scales)
library(tmap) library(tmap)
library(tmaptools) library(tmaptools)
library(leaflet) library(leaflet)
library(formattable)
# Load files # Load files
source("Data/Loader.R") source("Data/Loader.R")