-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp2.R
112 lines (95 loc) · 2.96 KB
/
app2.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
library(shiny)
library(shinydashboard)
library(maps)
library(mapproj)
source("helpers.R")
counties <- readRDS("data/counties.rds")
ui <- dashboardPage(
dashboardHeader(title = "Basic dashboard"),
dashboardSidebar(
sidebarMenu(
menuItem("Dashboard", tabName="dashboard", icon=icon("dashboard")),
menuItem("Widgets", tabName="widgets", icon=icon("th"))
)
),
dashboardBody(
tabItems(
tabItem(
tabName = "dashboard",
fluidRow(
valueBox(
10 * 2,
"New Orders",
icon = icon("credit-card"),
width="2"
),
valueBoxOutput("progressBoxValue", width="2"),
valueBoxOutput("approvalBoxValue", width="2"),
box(
infoBox("New Orders", 10*2, icon=icon("credit-card")),
infoBoxOutput("progressBox"),
infoBoxOutput("approvalBox")
),
box(
title="Histogram",
background="maroon",
solidHeader=TRUE,
plotOutput("plot1", height = 250)
),
box(
title="Controls",
background="navy",
solidHeader=TRUE,
"Box content here", br(), "More box content",
sliderInput("slider", "Number of observations:", 1, 100, 50)
),
box(
title="Map",
background="navy",
width=12,
#percent_map(counties$white, "darkgreen", "% White")
)
)
),
tabItem(
tabName = "widgets",
h2("Widgets tab content")
)
)
)
)
server <- function(input, output) {
output$progressBoxValue <- renderValueBox({
valueBox(
paste0(25 , "%"),
"Progress",
icon=icon("list"),
color="purple"
)
})
output$approvalBoxValue <- renderValueBox({
valueBox(
"80%", "Approval", icon=icon("list"),
color="yellow"
)
})
output$progressBox <- renderInfoBox({
infoBox(
"Progress", paste0(25 , "%"), icon=icon("list"),
color="purple"
)
})
output$approvalBox <- renderInfoBox({
infoBox(
"Approval", "80%", icon=icon("thumbs-up", lib="glyphicon"),
color="yellow"
)
})
set.seed(122)
histdata <- rnorm(500)
output$plot1 <- renderPlot({
data <- histdata[seq_len(input$slider)]
hist(data)
})
}
shinyApp(ui, server)