Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephanie Wegscheidl
cocoVisR
Commits
062ef1dc
Commit
062ef1dc
authored
Oct 26, 2018
by
Stephanie Wegscheidl
Browse files
little changes in naming
parent
0ef40149
Pipeline
#443
failed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dashboard/server.R
View file @
062ef1dc
...
...
@@ -6,6 +6,7 @@ library(webshot)
library
(
knitr
)
library
(
leaflet
)
library
(
mapview
)
library
(
ggplot2
)
server
<-
function
(
input
,
output
,
session
)
{
...
...
@@ -167,10 +168,10 @@ server <- function(input, output, session) {
}
})
#Continue to
control
page
observeEvent
(
input
$
control
Si
d
e
,
{
#Continue to
view
page
observeEvent
(
input
$
view
Si
t
e
,
{
updateTabItems
(
session
,
"tabs"
,
selected
=
"
control
s"
)
updateTabItems
(
session
,
"tabs"
,
selected
=
"
view
s"
)
})
...
...
@@ -179,7 +180,7 @@ server <- function(input, output, session) {
#Title Input
output
$
text
<-
renderText
({
input
$
title
})
#
Histogram
#
barchart
output
$
input_hist_x
<-
renderUI
({
if
(
is.null
(
input
$
nut
))
...
...
@@ -228,7 +229,7 @@ server <- function(input, output, session) {
#})
#
L
ine
graph
#
l
ine
chart
output
$
input_line_x
<-
renderUI
({
if
(
is.null
(
input
$
nut
))
...
...
@@ -252,14 +253,40 @@ server <- function(input, output, session) {
#DASHBOARD PAGE
#
HISTOGRAM
#
barchart
output
$
hist_box
<-
renderUI
({
if
(
input
$
check_hist
)
box
(
title
=
"
Histogram
"
,
box
(
title
=
"
Barchart
"
,
status
=
"warning"
,
solidHeader
=
TRUE
,
collapsible
=
TRUE
,
plotOutput
(
"plot1"
,
height
=
250
))
plotOutput
(
"hist"
,
height
=
250
))
})
#HIS VIEW
output
$
hist
<-
renderPlot
({
print
(
"hist wird aufgerufen"
)
a
=
1
for
(
a
in
1
:
length
(
coconut.df
$
bluetooth.numOfBTDevices
)){
#g <-geom_bar(mapping = NULL, data = , stat = "count",
# position = "stack", width = NULL, binwidth = NULL, na.rm = FALSE,
# show.legend = NA, inherit.aes = TRUE)
g
<-
ggplot
(
coconut.df
,
aes
(
"timestamp"
,
"bluetooth"
))
#g + geom_bar()
a
=
a
+1
}
g
#hist(bluetooth)
})
...
...
@@ -283,50 +310,31 @@ server <- function(input, output, session) {
leafletOutput
(
"map"
,
height
=
250
))
})
#
actual plot
#
MAP VIEW
output
$
map
<-
renderLeaflet
({
print
(
"wird aufgerufen"
)
print
(
"
map
wird aufgerufen"
)
m
<<-
leaflet
()
x
=
1
m
<-
addTiles
(
m
)
for
(
x
in
1
:
length
(
coconut.df
$
gps.latitude
)){
m
<-
addMarkers
(
m
,
lng
=
as.numeric
(
longitude
[
x
]),
lat
=
as.numeric
(
latitude
[
x
]))
#addPolylines does not work
m
<-
add
Circle
Markers
(
m
,
lng
=
as.numeric
(
longitude
[
x
]),
lat
=
as.numeric
(
latitude
[
x
])
,
radius
=
1
,
color
=
"red"
)
#addPolylines does not work
x
=
x
+1
}
m
})
#
LINEGRAPH
#
linechart
output
$
line_box
<-
renderUI
({
if
(
input
$
check_line
)
box
(
title
=
"Line
graph
"
,
box
(
title
=
"Line
chart
"
,
status
=
"warning"
,
solidHeader
=
TRUE
,
collapsible
=
TRUE
,
plotOutput
(
"plot1"
,
height
=
250
))
})
# MAP
#function connectTheDots(data){
# c = []
# for(i in data._layers) {
# x = data._layers[i]._latlng.lat;
# y = data._layers[i]._latlng.lng;
# c.push([x, y]);
#}
#return c
#}
#pathCoords = connectTheDots(window.geojson);
#pathLine = L.polyline(pathCoords).addTo(m)
#DownloadButton
#TODO: MAKE IT WORK!
observeEvent
(
input
$
screenshot
,{
...
...
@@ -347,7 +355,7 @@ server <- function(input, output, session) {
#print(appdir)
#appshot(appdir, "01_hello.png")
leaflet.print
(
m
)
#
leaflet.print(m)
...
...
dashboard/ui.R
View file @
062ef1dc
...
...
@@ -14,7 +14,7 @@ ui <- dashboardPage(
id
=
"tabs"
,
menuItem
(
"Upload"
,
tabName
=
"upload"
,
icon
=
icon
(
"upload"
)),
menuItem
(
"Data"
,
tabName
=
"data"
,
icon
=
icon
(
"list"
)),
menuItem
(
"
Contol
s"
,
tabName
=
"
control
s"
,
icon
=
icon
(
"cog"
)),
menuItem
(
"
View
s"
,
tabName
=
"
view
s"
,
icon
=
icon
(
"cog"
)),
menuItem
(
"Dashboard"
,
tabName
=
"dashboard"
,
icon
=
icon
(
"dashboard"
)),
menuItem
(
"Help"
,
tabName
=
"help"
,
icon
=
icon
(
"book"
))
)
...
...
@@ -41,8 +41,7 @@ ui <- dashboardPage(
"text/json"
,
"text/comma-separated-values,text/plain"
,
".json"
)),
actionButton
(
"dataSite"
,
"next
"
)
actionButton
(
"dataSite"
,
"Go to Data"
)
),
...
...
@@ -58,19 +57,19 @@ ui <- dashboardPage(
h2
(
"CoCoQuest Data here:"
),
h4
(
"Last Loaded CoCoQuest Data: "
),
textOutput
(
"lastLoadedQuest"
),
h4
(
"Starttime: "
),
textOutput
(
"totalStarttime"
),
#
h4("Starttime: "),
#
textOutput("totalStarttime"),
dataTableOutput
(
"quest"
),
actionButton
(
"
control
Si
d
e"
,
"
next
"
)
actionButton
(
"
view
Si
t
e"
,
"
go to Views
"
)
),
# Controls tab content
tabItem
(
tabName
=
"
control
s"
,
h2
(
"
Control
s here:"
),
tabItem
(
tabName
=
"
view
s"
,
h2
(
"
View
s here:"
),
textInput
(
"title"
,
"Title"
,
" "
),
#
HISTOGRAM
checkboxInput
(
"check_hist"
,
"
Histogram
"
,
FALSE
),
#
Barchart
checkboxInput
(
"check_hist"
,
"
Barchart
"
,
FALSE
),
#uiOutput("check_hist"),
uiOutput
(
"input_hist_x"
),
uiOutput
(
"input_hist_y"
),
...
...
@@ -78,14 +77,14 @@ ui <- dashboardPage(
checkboxInput
(
"check_time"
,
"Timeline"
,
FALSE
),
uiOutput
(
"input_time_x"
),
uiOutput
(
"input_time_y"
),
#Linechart
checkboxInput
(
"check_line"
,
"Linechart"
,
FALSE
),
uiOutput
(
"input_line_x"
),
uiOutput
(
"input_line_y"
),
#MAP
checkboxInput
(
"check_map"
,
"Map"
,
TRUE
),
uiOutput
(
"input_map"
),
#uiOutput("input_map_y"),
#LINEGRAPH
checkboxInput
(
"check_line"
,
"Linegraph"
,
FALSE
),
uiOutput
(
"input_line_x"
),
uiOutput
(
"input_line_y"
),
actionButton
(
"dashboardSite"
,
"go to dashboard"
)
),
...
...
@@ -104,8 +103,8 @@ ui <- dashboardPage(
uiOutput
(
"hist_box"
),
uiOutput
(
"time_box"
),
uiOutput
(
"
map
_box"
),
uiOutput
(
"
line
_box"
)
uiOutput
(
"
line
_box"
),
uiOutput
(
"
map
_box"
)
),
actionButton
(
"screenshot"
,
"Download"
)
...
...
Write
Preview
Supports
Markdown
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