Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cocoVisR
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stephanie Wegscheidl
cocoVisR
Commits
82d4e992
Commit
82d4e992
authored
Nov 24, 2018
by
Stephanie Wegscheidl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
multiple barcharts first try
parent
f5e5da56
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
51 deletions
+65
-51
dashboard/server.R
dashboard/server.R
+52
-35
dashboard/ui.R
dashboard/ui.R
+13
-16
No files found.
dashboard/server.R
View file @
82d4e992
...
...
@@ -11,8 +11,10 @@ library(timevis)
library
(
plotly
)
server
<-
function
(
input
,
output
,
session
)
{
set.seed
(
122
)
#Continue to data page
observeEvent
(
input
$
dataSite
,
{
...
...
@@ -186,9 +188,8 @@ server <- function(input, output, session) {
#Title Input
output
$
title
<-
renderText
({
input
$
title
})
#barchart
output
$
input_hist_x
<-
renderUI
({
if
(
is.null
(
input
$
nut
))
return
(
NULL
)
...
...
@@ -254,35 +255,43 @@ server <- function(input, output, session) {
#Continue to dashboard page
observeEvent
(
input
$
dashboardSite
,
{
updateTabItems
(
session
,
"tabs"
,
selected
=
"dashboard"
)
})
#DASHBOARD
#ADD BARCHART BUTTON
observeEvent
(
input
$
check_hist
,
{
insertUI
(
selector
=
"#viewpanel"
,
#wo will ichs hinhaben
ui
=
box
(
title
=
"Barchart"
,
status
=
"warning"
,
solidHeader
=
TRUE
,
collapsible
=
TRUE
,
selectInput
(
"bar_x"
,
"x-axis"
,
choices
=
colnames
(
coconut.df
)),
selectInput
(
"bar_y"
,
"y-axis"
,
choices
=
colnames
(
coconut.df
)),
plotOutput
(
"bar"
,
height
=
250
))
)
print
(
"InsertUI wird aufgerufen."
)
#barchart
output
$
hist_box
<-
renderUI
({
if
(
input
$
check_hist
)
box
(
title
=
"Barchart"
,
status
=
"warning"
,
solidHeader
=
TRUE
,
collapsible
=
TRUE
,
plotOutput
(
"bar"
,
height
=
250
))
})
})
#DASHBOARD
#BAR VIEW
#BAR VIEW
output
$
bar
<-
renderPlot
({
print
(
"BAR wird aufgerufen."
)
data
<-
structure
(
list
(
V1
=
as.numeric
(
coconut.df
[[
input
$
bar_y
]]),
V2
=
as.numeric
(
coconut.df
[[
input
$
bar_x
]])),
.Names
=
c
(
"V1"
,
"V2"
),
row.names
=
c
(
NA
,
6L
),
class
=
"data.frame"
)
#Neues Plot
barplot
(
data
$
V1
,
data
$
V2
,
ylab
=
input
$
bar_y
,
xlab
=
input
$
bar_x
)
output
$
bar
<-
renderPlot
({
data
<-
structure
(
list
(
V1
=
as.numeric
(
coconut.df
[[
input
$
bar_y
]]),
V2
=
as.numeric
(
coconut.df
[[
input
$
bar_x
]])),
.Names
=
c
(
"V1"
,
"V2"
),
row.names
=
c
(
NA
,
6L
),
class
=
"data.frame"
)
#Neues Plot
barplot
(
data
$
V1
,
data
$
V2
,
ylab
=
input
$
bar_y
,
xlab
=
input
$
bar_x
)
})
## ALTES PLOT
#a=1
...
...
@@ -299,7 +308,7 @@ server <- function(input, output, session) {
#g
#hist(bluetooth)
})
#TIMELINE
...
...
@@ -348,6 +357,9 @@ server <- function(input, output, session) {
status
=
"warning"
,
solidHeader
=
TRUE
,
collapsible
=
TRUE
,
selectInput
(
"line_x"
,
"x-axis"
,
choices
=
colnames
(
coconut.df
)),
selectInput
(
"line_y"
,
"y-axis"
,
choices
=
colnames
(
coconut.df
)),
#add_tooltip(data_tooltip, "hover"),
plotOutput
(
"line"
,
height
=
250
))
})
...
...
@@ -358,10 +370,7 @@ server <- function(input, output, session) {
V2
=
as.numeric
(
coconut.df
[[
input
$
line_y
]])),
.Names
=
c
(
"V1"
,
"V2"
),
row.names
=
c
(
NA
,
6L
),
class
=
"data.frame"
)
plot
(
data
$
V1
,
data
$
V2
,
type
=
"l"
,
ylab
=
input
$
line_y
,
xlab
=
input
$
line_x
)
})
# Scatterplot
...
...
@@ -371,6 +380,8 @@ server <- function(input, output, session) {
status
=
"warning"
,
solidHeader
=
TRUE
,
collapsible
=
TRUE
,
selectInput
(
"scat_x"
,
"x-axis"
,
choices
=
colnames
(
coconut.df
)),
selectInput
(
"scat_y"
,
"y-axis"
,
choices
=
colnames
(
coconut.df
)),
plotOutput
(
"scat"
,
height
=
250
))
})
...
...
@@ -381,7 +392,7 @@ server <- function(input, output, session) {
.Names
=
c
(
"V1"
,
"V2"
),
row.names
=
c
(
NA
,
6L
),
class
=
"data.frame"
)
print
(
"SCAT wird aufgerufen"
)
plot
(
data
$
V1
,
data
$
V2
,
type
=
"p"
,
labx
=
input
$
scat_x
,
laby
=
input
$
scat_y
)
plot
(
data
$
V1
,
data
$
V2
,
type
=
"p"
,
xlab
=
input
$
scat_x
,
ylab
=
input
$
scat_y
)
})
# Boxplot
...
...
@@ -391,6 +402,7 @@ server <- function(input, output, session) {
status
=
"warning"
,
solidHeader
=
TRUE
,
collapsible
=
TRUE
,
selectInput
(
"box_x"
,
"x-axis"
,
choices
=
colnames
(
coconut.df
)),
plotOutput
(
"box"
,
height
=
250
))
})
...
...
@@ -400,7 +412,7 @@ server <- function(input, output, session) {
data
<-
structure
(
list
(
V1
=
as.numeric
(
coconut.df
[[
input
$
box_x
]])),
.Names
=
c
(
"V1"
),
row.names
=
c
(
NA
,
6L
),
class
=
"data.frame"
)
boxplot
(
data
$
V1
,
type
=
"box"
,
labx
=
input
$
box_x
)
boxplot
(
data
$
V1
,
type
=
"box"
,
xlab
=
input
$
box_x
)
})
#MAP
...
...
@@ -410,6 +422,7 @@ server <- function(input, output, session) {
status
=
"warning"
,
solidHeader
=
TRUE
,
collapsible
=
TRUE
,
selectInput
(
"map_data"
,
"data"
,
choices
=
colnames
(
coconut.df
)),
leafletOutput
(
"map"
,
height
=
250
))
})
...
...
@@ -427,8 +440,12 @@ server <- function(input, output, session) {
# TOOLTIP
data_tooltip
<-
function
(
x
){
if
(
is.null
(
x
))
return
(
NULL
)
if
(
is.null
(
x
$
ID
))
return
(
NULL
)
paste0
(
coconut.df
[[
input
$
line_x
]])
}
#DownloadButton
#TODO: MAKE IT WORK!
...
...
dashboard/ui.R
View file @
82d4e992
...
...
@@ -75,15 +75,14 @@ ui <- dashboardPage(
tabsetPanel
(
tabPanel
(
"Barchart"
,
#Barchart
checkboxInput
(
"check_hist"
,
"Barchart"
,
FALSE
),
selectInput
(
"bar_x"
,
"x-axis"
,
choices
=
colnames
(
coconut.df
)),
selectInput
(
"bar_y"
,
"y-axis"
,
choices
=
colnames
(
coconut.df
))
actionButton
(
"check_hist"
,
"add Barchart"
)
#uiOutput("input_hist_x"),
#uiOutput("input_hist_y")
),
#TIMELINE
tabPanel
(
"Timeline"
,
checkboxInput
(
"check_time"
,
"Timeline"
,
FALSE
),
actionButton
(
"check_time"
,
"add Timeline"
),
textOutput
(
"texttimeline"
)
#selectInput("time_data", "data", choices=colnames(coconut.df))
#uiOutput("input_time_x"),
...
...
@@ -91,36 +90,34 @@ ui <- dashboardPage(
),
#Linechart
tabPanel
(
"Linechart"
,
checkboxInput
(
"check_line"
,
"Linechart"
,
FALSE
),
selectInput
(
"line_x"
,
"x-axis"
,
choices
=
colnames
(
coconut.df
)),
selectInput
(
"line_y"
,
"y-axis"
,
choices
=
colnames
(
coconut.df
))
actionButton
(
"check_line"
,
"add Linechart"
)
#uiOutput("input_line_x"),
#uiOutput("input_line_y")
),
#Scatterplot
tabPanel
(
"Scatterplot"
,
checkboxInput
(
"check_scat"
,
"Scatterplot"
,
FALSE
),
selectInput
(
"scat_x"
,
"x-axis"
,
choices
=
colnames
(
coconut.df
)),
selectInput
(
"scat_y"
,
"y-axis"
,
choices
=
colnames
(
coconut.df
))
actionButton
(
"check_scat"
,
" add Scatterplot"
)
),
#Boxplot
tabPanel
(
"Boxplot"
,
checkboxInput
(
"check_box"
,
"Boxplot"
,
FALSE
),
selectInput
(
"box_x"
,
"x-axis"
,
choices
=
colnames
(
coconut.df
))
#,
actionButton
(
"check_box"
,
"add Boxplot"
)
#selectInput("box_y", "y-axis", choices=colnames(coconut.df))
),
#MAP
tabPanel
(
"Map"
,
checkboxInput
(
"check_map"
,
"Map"
,
FALSE
),
selectInput
(
"map_data"
,
"data"
,
choices
=
colnames
(
coconut.df
))
actionButton
(
"check_map"
,
"add Map"
)
)
)
),
mainPanel
(
column
(
width
=
12
,
mainPanel
(
id
=
"viewpanel"
,
column
(
width
=
12
,
h2
(
textOutput
(
"title"
)),
uiOutput
(
"hist_box"
),
#
uiOutput("hist_box"),
uiOutput
(
"time_box"
),
#timevisOutput("time"),
uiOutput
(
"line_box"
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment