Skip to content

Commit 94dc107

Browse files
committed
initial dashboard setup
1 parent 91c1e0e commit 94dc107

File tree

2 files changed

+31
-23
lines changed

2 files changed

+31
-23
lines changed

synoptic_dashboard/server.R

+10-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
#
99

1010
library(shiny)
11+
library(ggplot2)
12+
13+
theme_set(theme_bw())
1114

1215
# Define server logic required to draw a histogram
1316
shinyServer(function(input, output) {
@@ -16,10 +19,15 @@ shinyServer(function(input, output) {
1619

1720
# generate bins based on input$bins from ui.R
1821
x <- faithful[, 2]
19-
bins <- seq(min(x), max(x), length.out = input$bins + 1)
22+
bins <- seq(min(x), max(x), length.out = 6)
2023

24+
# This lets you stop the code and see what's in the environment
25+
#browser()
26+
2127
# draw the histogram with the specified number of bins
22-
hist(x, breaks = bins, col = 'darkgray', border = 'white')
28+
29+
ggplot(faithful, aes(eruptions)) +
30+
geom_histogram()
2331

2432
})
2533

synoptic_dashboard/ui.R

+21-21
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@
88
#
99

1010
library(shiny)
11+
library(shinydashboard)
1112

1213
# Define UI for application that draws a histogram
13-
shinyUI(fluidPage(
14-
15-
# Application title
16-
titlePanel("Old Faithful Geyser Data"),
17-
18-
# Sidebar with a slider input for number of bins
19-
sidebarLayout(
20-
sidebarPanel(
21-
sliderInput("bins",
22-
"Number of bins:",
23-
min = 1,
24-
max = 50,
25-
value = 30)
26-
),
27-
28-
# Show a plot of the generated distribution
29-
mainPanel(
30-
plotOutput("distPlot")
31-
)
32-
)
33-
))
14+
ui <- dashboardPage(
15+
16+
dashboardHeader(title = "COMPASS Synoptic"),
17+
dashboardSidebar(
18+
sidebarMenu(
19+
menuItem("Dashboard", tabName = "dashboard", icon = icon("compass")),
20+
menuItem("Sapflow", tabName = "sapflow", icon = icon("tree")),
21+
menuItem("TEROS", tabName = "teros", icon = icon("temperature-high")),
22+
menuItem("AquaTroll", tabName = "troll", icon = icon("water")),
23+
menuItem("Battery", tabName = "battery", icon = icon("car-battery")),
24+
menuItem("Alerts", tabName = "alerts", icon = icon("comment-dots"))
25+
)
26+
),
27+
dashboardBody(
28+
tabItem(tabName = "sapflow",
29+
plotOutput("distPlot"))
30+
),
31+
skin = "purple"
32+
33+
)

0 commit comments

Comments
 (0)