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
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
)

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
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(

3
app.R
View File

@ -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")