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
5d69fcdb
Commit
5d69fcdb
authored
Aug 02, 2018
by
Stephanie Wegscheidl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
work around getting data
parent
592039b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
24 deletions
+83
-24
dashboard/server.R
dashboard/server.R
+83
-24
No files found.
dashboard/server.R
View file @
5d69fcdb
#
# This is the server logic of a Shiny web application. You can run the
# application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library
(
shiny
)
library
(
shiny
)
library
(
jsonlite
)
library
(
jsonlite
)
...
@@ -25,8 +17,62 @@ server <- function(input, output) {
...
@@ -25,8 +17,62 @@ server <- function(input, output) {
coconut.df
<<-
json_data_coco
[[
"data"
]]
coconut.df
<<-
json_data_coco
[[
"data"
]]
lastCoConUT
<<-
inFile
$
name
lastCoConUT
<<-
inFile
$
name
print
(
"coconut:"
)
print
(
coconut.df
)
if
(
is.null
(
coconut.df
$
timestamp
)){}
else
{
unixTime
<<-
coconut.df
$
timestamp
}
if
(
is.null
(
coconut.df
$
gps.latitude
)){}
else
{
latitude
<<-
coconut.df
$
gps.latitude
}
if
(
is.null
(
coconut.df
$
gps.longitude
)){}
else
{
longitude
<<-
coconut.df
$
gps.longitude
}
if
(
is.null
(
coconut.df
$
gps.speed
)){}
else
{
speed
<<-
coconut.df
$
gps.speed
}
if
(
is.null
(
coconut.df
$
gps.accuracy
)){}
else
{
gpsAcc
<<-
coconut.df
$
gps.accuracy
}
if
(
is.null
(
coconut.df
$
light.lux
)){}
else
{
lux
<<-
coconut.df
$
light.lux
}
if
(
is.null
(
coconut.df
$
acc.coordinates
)){}
else
{
accCoord
<<-
coconut.df
$
acc.coordinates
}
if
(
is.null
(
coconut.df
$
acc.accuracy
)){}
else
{
accAcc
<<-
coconut.df
$
acc.accuracy
}
if
(
is.null
(
coconut.df
$
bluetooth.numOfBTDevices
)){}
else
{
bluetooth
<<-
coconut.df
$
bluetooth.numOfBTDevices
}
if
(
is.null
(
coconut.df
$
ble.bpm
)){}
else
{
bleBpm
<<-
coconut.df
$
ble.bpm
}
if
(
is.null
(
coconut.df
$
ble.bpmlist
)){}
else
{
bleBpmList
<<-
coconut.df
$
ble.bpmlist
}
if
(
is.null
(
coconut.df
$
ble.hrv
)){}
else
{
bleHrv
<<-
coconut.df
$
ble.hrv
}
if
(
is.null
(
coconut.df
$
ble.hrvlist
)){}
else
{
bleHrvList
<<-
coconut.df
$
ble.hrvlist
}
if
(
is.null
(
coconut.df
$
activity.name
)){}
else
{
activityName
<<-
coconut.df
$
activity.name
}
if
(
is.null
(
coconut.df
$
activity.confidence
)){}
else
{
activityConf
<<-
coconut.df
$
activity.confidence
}
if
(
is.null
(
coconut.df
$
screen.status
)){}
else
{
screenstatus
<<-
coconut.df
$
screen.status
}
if
(
is.null
(
coconut.df
$
interaction.touch
)){}
else
{
touch
<<-
coconut.df
$
interaction.touch
}
# setting the table style
# setting the table style
datatable
(
datatable
(
cbind
(
coconut.df
),
cbind
(
coconut.df
),
...
@@ -41,6 +87,8 @@ server <- function(input, output) {
...
@@ -41,6 +87,8 @@ server <- function(input, output) {
class
=
'cell-border stripe'
class
=
'cell-border stripe'
)
)
)
)
})
})
output
$
lastLoadedNut
<-
renderText
({
output
$
lastLoadedNut
<-
renderText
({
...
@@ -59,8 +107,7 @@ server <- function(input, output) {
...
@@ -59,8 +107,7 @@ server <- function(input, output) {
#loading CoCoQuest data
#loading CoCoQuest data
json_data_quest
<<-
fromJSON
(
paste
(
inFile
$
datapath
,
sep
=
""
),
flatten
=
TRUE
)
json_data_quest
<<-
fromJSON
(
paste
(
inFile
$
datapath
,
sep
=
""
),
flatten
=
TRUE
)
#print("json_data_qest")
#print(json_data_quest)
lastCoCoQuest
<<-
inFile
$
name
lastCoCoQuest
<<-
inFile
$
name
json_data_quest
$
unix_starttime
<-
as.numeric
(
json_data_quest
$
startTime
)
/
1000
json_data_quest
$
unix_starttime
<-
as.numeric
(
json_data_quest
$
startTime
)
/
1000
...
@@ -70,7 +117,6 @@ server <- function(input, output) {
...
@@ -70,7 +117,6 @@ server <- function(input, output) {
#unix parsed
#unix parsed
dat
<-
do.call
(
rbind
,
json_data_quest
$
tasks
$
data
)
dat
<-
do.call
(
rbind
,
json_data_quest
$
tasks
$
data
)
endtimes
<<-
c
(
anytime
(
dat
$
endtime
/
1000
))
endtimes
<<-
c
(
anytime
(
dat
$
endtime
/
1000
))
...
@@ -97,12 +143,7 @@ server <- function(input, output) {
...
@@ -97,12 +143,7 @@ server <- function(input, output) {
cbind
(
tasks
,
endtimes
),
cbind
(
tasks
,
endtimes
),
options
=
list
(
options
=
list
(
searching
=
FALSE
,
searching
=
FALSE
,
#autoWidth = TRUE,
rownames
=
TRUE
,
rownames
=
TRUE
,
#scroller = TRUE,
#scrollX = TRUE,
# scrollY = "500px",
class
=
'cell-border stripe'
class
=
'cell-border stripe'
)
)
)
)
...
@@ -125,36 +166,54 @@ server <- function(input, output) {
...
@@ -125,36 +166,54 @@ server <- function(input, output) {
#TODO: Getting HEADER out of json to select it
#TODO: Getting HEADER out of json to select it
#Not sure if so smart but it should work that way
output
$
input_hist_x
<-
renderUI
({
output
$
input_hist_x
<-
renderUI
({
selectInput
(
"in1"
,
"x-axis:"
,
as.list
(
coconut.df
),
multiple
=
TRUE
,
selectize
=
TRUE
)
if
(
is.null
(
input
$
nut
))
return
(
NULL
)
selectInput
(
"in1"
,
"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_hist_y
<-
renderUI
({
output
$
input_hist_y
<-
renderUI
({
selectInput
(
"in1"
,
"y-axis:"
,
as.list
(
coconut.df
),
multiple
=
TRUE
,
selectize
=
TRUE
)
if
(
is.null
(
input
$
nut
))
return
(
NULL
)
selectInput
(
"in2"
,
"y-axis:"
,
as.list
(
coconut.df
),
multiple
=
TRUE
,
selectize
=
TRUE
)
})
})
output
$
input_time_x
<-
renderUI
({
output
$
input_time_x
<-
renderUI
({
selectInput
(
"in1"
,
"x-axis:"
,
as.list
(
coconut.df
),
multiple
=
TRUE
,
selectize
=
TRUE
)
if
(
is.null
(
input
$
nut
))
return
(
NULL
)
selectInput
(
"in3"
,
"x-axis:"
,
as.list
(
coconut.df
),
multiple
=
TRUE
,
selectize
=
TRUE
)
})
})
output
$
input_time_y
<-
renderUI
({
output
$
input_time_y
<-
renderUI
({
selectInput
(
"in1"
,
"y-axis:"
,
as.list
(
coconut.df
),
multiple
=
TRUE
,
selectize
=
TRUE
)
if
(
is.null
(
input
$
nut
))
return
(
NULL
)
selectInput
(
"in4"
,
"y-axis:"
,
as.list
(
coconut.df
),
multiple
=
TRUE
,
selectize
=
TRUE
)
})
})
output
$
input_map_x
<-
renderUI
({
output
$
input_map_x
<-
renderUI
({
selectInput
(
"in1"
,
"x-axis:"
,
as.list
(
coconut.df
),
multiple
=
TRUE
,
selectize
=
TRUE
)
if
(
is.null
(
input
$
nut
))
return
(
NULL
)
selectInput
(
"in5"
,
"x-axis:"
,
as.list
(
coconut.df
),
multiple
=
TRUE
,
selectize
=
TRUE
)
})
})
output
$
input_map_y
<-
renderUI
({
output
$
input_map_y
<-
renderUI
({
selectInput
(
"in1"
,
"y-axis:"
,
as.list
(
coconut.df
),
multiple
=
TRUE
,
selectize
=
TRUE
)
if
(
is.null
(
input
$
nut
))
return
(
NULL
)
selectInput
(
"in6"
,
"y-axis:"
,
as.list
(
coconut.df
),
multiple
=
TRUE
,
selectize
=
TRUE
)
})
})
output
$
input_line_x
<-
renderUI
({
output
$
input_line_x
<-
renderUI
({
selectInput
(
"in1"
,
"x-axis:"
,
as.list
(
coconut.df
),
multiple
=
TRUE
,
selectize
=
TRUE
)
if
(
is.null
(
input
$
nut
))
return
(
NULL
)
selectInput
(
"in7"
,
"x-axis:"
,
as.list
(
coconut.df
),
multiple
=
TRUE
,
selectize
=
TRUE
)
})
})
output
$
input_line_y
<-
renderUI
({
output
$
input_line_y
<-
renderUI
({
selectInput
(
"in1"
,
"y-axis:"
,
as.list
(
coconut.df
),
multiple
=
TRUE
,
selectize
=
TRUE
)
if
(
is.null
(
input
$
nut
))
return
(
NULL
)
selectInput
(
"in8"
,
"y-axis:"
,
as.list
(
coconut.df
),
multiple
=
TRUE
,
selectize
=
TRUE
)
})
})
...
...
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