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
0ef40149
Commit
0ef40149
authored
Aug 26, 2018
by
Stephanie Wegscheidl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
map first real approach
parent
82ee30ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
40 deletions
+55
-40
dashboard/server.R
dashboard/server.R
+52
-37
dashboard/ui.R
dashboard/ui.R
+3
-3
No files found.
dashboard/server.R
View file @
0ef40149
...
...
@@ -5,6 +5,7 @@ library(DT)
library
(
webshot
)
library
(
knitr
)
library
(
leaflet
)
library
(
mapview
)
server
<-
function
(
input
,
output
,
session
)
{
...
...
@@ -18,12 +19,7 @@ server <- function(input, output, session) {
})
#DATA PAGE
#last coconut_name
output
$
lastLoadedNut
<-
renderText
({
if
(
is.null
(
input
$
nut
))
return
(
NULL
)
else
lastCoConUT
})
#CoConUT Data import
output
$
nut
<-
renderDataTable
({
...
...
@@ -37,11 +33,11 @@ server <- function(input, output, session) {
lastCoConUT
<<-
inFile
$
name
print
(
"coconut:"
)
#
print("coconut:")
#coconut.df$timestamp <- format(coconut.df$timestamp, format="%d-%B-%Y %H:%M:%S")
print
(
coconut.df
)
#
print(coconut.df)
if
(
is.null
(
coconut.df
$
timestamp
)){}
else
{
unixTime
<<-
coconut.df
$
timestamp
}
...
...
@@ -109,7 +105,13 @@ server <- function(input, output, session) {
)
)
})
#last coconut_name
output
$
lastLoadedNut
<-
renderText
({
if
(
is.null
(
input
$
nut
))
return
(
NULL
)
else
lastCoConUT
})
#CoCoQuest Data import
output
$
quest
<-
renderDataTable
({
inFile
<-
input
$
quest
...
...
@@ -120,15 +122,8 @@ server <- function(input, output, session) {
json_data_quest
<<-
fromJSON
(
paste
(
inFile
$
datapath
,
sep
=
""
),
flatten
=
TRUE
)
lastCoCoQuest
<<-
inFile
$
name
#json_data_quest$unix_starttime <- as.numeric(json_data_quest$startTime)/1000
#json_data_quest$unix_endtime <- as.numeric(json_data_quest$endTime)/1000
#totalStarttime <<- anytime(c(json_data_quest$unix_starttime))
#totalEndtime <<- anytime(json_data_quest$unix_endtime)
#json_data_quest$unix_starttime <- format(json_data_quest$unix_starttime, format="%d-%B-%Y %H:%M:%S")
totalST
<<-
c
(
anytime
(
as.numeric
(
json_data_quest
$
startTime
)
/
1000
))
#unix parsed
dat
<-
do.call
(
rbind
,
json_data_quest
$
tasks
$
data
)
...
...
@@ -167,7 +162,7 @@ server <- function(input, output, session) {
if
(
is.null
(
input
$
quest
))
return
(
NULL
)
else
{
format
(
totalS
tarttime
,
format
=
"%d-%B-%Y %H:%M:%S"
)
format
(
totalS
T
,
format
=
"%d-%B-%Y %H:%M:%S"
)
}
})
...
...
@@ -215,18 +210,22 @@ server <- function(input, output, session) {
#Map
output
$
input_map_x
<-
renderUI
({
if
(
is.null
(
input
$
nut
))
return
(
NULL
)
selectInput
(
"in5"
,
"x-axis:"
,
cbind
(
"unixTime"
,
"longitude"
,
"latitude"
,
"speed"
,
"gps.acc"
,
"lux"
,
"light.acc"
,
"acc.coordinates"
,
"acc.acc"
,
"bluetooth"
,
"ble.bpm"
,
"ble.bpmlist"
,
"ble.hrv"
,
"ble.hrvlist"
,
"activity.name"
,
"acctivity.confidence"
,
"screen.status"
,
"touch"
),
multiple
=
TRUE
,
selectize
=
TRUE
)
})
output
$
input_map
<-
renderUI
({
if
(
is.null
(
input
$
nut
))
return
(
NULL
)
selectInput
(
"in5"
,
"Data:"
,
cbind
(
"unixTime"
,
"speed"
,
"gps.acc"
,
"lux"
,
"light.acc"
,
"acc.coordinates"
,
"acc.acc"
,
"bluetooth"
,
"ble.bpm"
,
"ble.bpmlist"
,
"ble.hrv"
,
"ble.hrvlist"
,
"activity.name"
,
"acctivity.confidence"
,
"screen.status"
,
"touch"
),
multiple
=
TRUE
,
selectize
=
TRUE
)
})
#output$input_map_x <- renderUI({
# if (is.null(input$nut))
# return(NULL)
# selectInput("in5", "x-axis:", cbind("unixTime", "longitude", "latitude", "speed", "gps.acc","lux", "light.acc","acc.coordinates", "acc.acc","bluetooth","ble.bpm","ble.bpmlist","ble.hrv","ble.hrvlist","activity.name", "acctivity.confidence","screen.status" ,"touch"),multiple=TRUE, selectize=TRUE)
#})
output
$
input_map_y
<-
renderUI
({
if
(
is.null
(
input
$
nut
))
return
(
NULL
)
selectInput
(
"in6"
,
"y-axis:"
,
cbind
(
"unixTime"
,
"longitude"
,
"latitude"
,
"speed"
,
"gps.acc"
,
"lux"
,
"light.acc"
,
"acc.coordinates"
,
"acc.acc"
,
"bluetooth"
,
"ble.bpm"
,
"ble.bpmlist"
,
"ble.hrv"
,
"ble.hrvlist"
,
"activity.name"
,
"acctivity.confidence"
,
"screen.status"
,
"touch"
),
multiple
=
TRUE
,
selectize
=
TRUE
)
})
#
output$input_map_y <- renderUI({
#
if (is.null(input$nut))
#
return(NULL)
#
selectInput("in6", "y-axis:", cbind("unixTime", "longitude", "latitude", "speed", "gps.acc","lux", "light.acc","acc.coordinates", "acc.acc","bluetooth","ble.bpm","ble.bpmlist","ble.hrv","ble.hrvlist","activity.name", "acctivity.confidence","screen.status" ,"touch"),multiple=TRUE, selectize=TRUE)
#
})
#Linegraph
...
...
@@ -281,15 +280,17 @@ server <- function(input, output, session) {
status
=
"warning"
,
solidHeader
=
TRUE
,
collapsible
=
TRUE
,
plo
tOutput
(
"map"
,
height
=
250
))
leafle
tOutput
(
"map"
,
height
=
250
))
})
output
$
map
<-
renderPlot
({
m
<-
leaflet
()
# actual plot
output
$
map
<-
renderLeaflet
({
print
(
"wird aufgerufen"
)
m
<<-
leaflet
()
x
=
1
m
<-
addTiles
(
m
)
for
(
x
in
1
:
length
(
coconut.df
)){
m
<-
addMarkers
(
m
,
lng
=
in5
[
x
],
lat
=
in6
[
x
]
)
#addPolylines does not work
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
x
=
x
+1
}
m
})
...
...
@@ -335,10 +336,24 @@ server <- function(input, output, session) {
print
(
url
)
#URL <- "http://rstudio.github.io/leaflet/"
#appshot("cocoVisR/", file = "dashboard.png", port = getOption("shiny.port"), envvars = NULL)
#webshot(
URL, "dashboard.png"
,delay = 5.0)
#webshot(
url
,delay = 5.0)
#knit("dashboard.png")
port
<-
cdat
$
url_port
#port <- cdat$url_port
#mapshot(m, file="~/Rplot.png")
#webshot(url, "dashboard.png", delay = 20.0) # does NOT WORK
#appdir <- system.file("examples", "01_hello", package="shiny")
#print("appdir")
#print(appdir)
#appshot(appdir, "01_hello.png")
leaflet.print
(
m
)
})
# url <- paste0(cdat$url_protocol,"//",cdat$url_hostname,":", cdat$url_port, cdat$url_pathname,cdat$url_search)
...
...
dashboard/ui.R
View file @
0ef40149
...
...
@@ -79,9 +79,9 @@ ui <- dashboardPage(
uiOutput
(
"input_time_x"
),
uiOutput
(
"input_time_y"
),
#MAP
checkboxInput
(
"check_map"
,
"Map"
,
FALS
E
),
uiOutput
(
"input_map
_x
"
),
uiOutput
(
"input_map_y"
),
checkboxInput
(
"check_map"
,
"Map"
,
TRU
E
),
uiOutput
(
"input_map"
),
#
uiOutput("input_map_y"),
#LINEGRAPH
checkboxInput
(
"check_line"
,
"Linegraph"
,
FALSE
),
uiOutput
(
"input_line_x"
),
...
...
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