Skip to content

Commit

Permalink
added some infotabs, ggplot graph still to come
Browse files Browse the repository at this point in the history
  • Loading branch information
zkuralt committed Oct 6, 2017
1 parent 833e404 commit a59f9ac
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ sidebar <- dashboardSidebar(
sidebarMenu(
menuItem("Explore data", tabName = "explore", icon = icon("paw")),
menuItemOutput(outputId = "menu_data"),
menuItem("Dataset overview", tabName = "overview", icon = icon("database")),
br(),
uiOutput("parent_opacity"),
uiOutput("offspring_opacity"),
Expand Down Expand Up @@ -73,6 +74,10 @@ body <- dashboardBody(
br(),
br(),
uiOutput("view_parentage")
),
tabItem(tabName = "overview",
h3("Quick statistics of dataset"),
uiOutput("stats")
)
)
)
Expand Down
32 changes: 32 additions & 0 deletions dynamic_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,35 @@ observe({
})
}
})

observe({
xy <- allData()
par <- inputFileParentage()

if(nrow(xy) > 0) {
ani <- length(unique(xy$animal))
male <- length(xy$sex[xy$sex == "M"])
female <- length(xy$sex[xy$sex == "F"])
clusters <- length(unique(par$cluster))
sam <- nrow(xy)
daterange <- paste(format(min(xy$date), "%d.%m.%Y" ), "-", format(max(xy$date), "%d.%m.%Y"), sep = " ")
} else {
ani <- 0
male <- 0
female <- 0
clusters <- 0
sam <- 0
daterange <- 0
}

output$stats <- renderUI({
fluidRow(
infoBox(title = "Animals", value = ani, icon = icon("paw"), color = "olive", width = 3),
infoBox(title = "Males", value = male, icon = icon("mars"), color = "light-blue", width = 3),
infoBox(title = "Females", value = female, icon = icon("venus"), color = "orange", width = 3),
infoBox(title = "Clusters", value = clusters, icon = icon("group"), color = "red", width = 3),
infoBox(title = "Samples", value = sam, icon = icon("flask"), color = "yellow", width = 3),
infoBox(title = "Date range", value = daterange, icon = icon("calendar"), color = "purple", width = 3)
)
})
})

0 comments on commit a59f9ac

Please sign in to comment.