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
9e6e4dbe
Commit
9e6e4dbe
authored
Dec 17, 2018
by
Stephanie Wegscheidl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes for Interviews
parent
710f350e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
204 deletions
+11
-204
dashboard/server.R
dashboard/server.R
+7
-202
dashboard/ui.R
dashboard/ui.R
+4
-2
No files found.
dashboard/server.R
View file @
9e6e4dbe
...
@@ -24,10 +24,8 @@ server <- function(input, output, session) {
...
@@ -24,10 +24,8 @@ server <- function(input, output, session) {
updateTabItems
(
session
,
"tabs"
,
selected
=
"data"
)
updateTabItems
(
session
,
"tabs"
,
selected
=
"data"
)
})
})
#DATA PAGE
#DATA PAGE
#CoConUT Data import
#CoConUT Data import
output
$
nut
<-
renderDataTable
({
output
$
nut
<-
renderDataTable
({
inFile
<-
input
$
nut
inFile
<-
input
$
nut
...
@@ -36,16 +34,9 @@ server <- function(input, output, session) {
...
@@ -36,16 +34,9 @@ server <- function(input, output, session) {
#loading CoConUT data
#loading CoConUT data
json_data_coco
<-
fromJSON
(
paste
(
inFile
$
datapath
,
sep
=
""
),
flatten
=
TRUE
)
json_data_coco
<-
fromJSON
(
paste
(
inFile
$
datapath
,
sep
=
""
),
flatten
=
TRUE
)
print
(
"1"
)
coconut.df
<<-
json_data_coco
[[
"data"
]]
coconut.df
<<-
json_data_coco
[[
"data"
]]
lastCoConUT
<<-
inFile
$
name
lastCoConUT
<<-
inFile
$
name
#print("coconut:")
#coconut.df$timestamp <- format(coconut.df$timestamp, format="%d-%B-%Y %H:%M:%S")
#print(coconut.df)
if
(
is.null
(
coconut.df
$
timestamp
)){}
if
(
is.null
(
coconut.df
$
timestamp
)){}
else
{
unixTime
<<-
coconut.df
$
timestamp
}
else
{
unixTime
<<-
coconut.df
$
timestamp
}
...
@@ -96,9 +87,7 @@ server <- function(input, output, session) {
...
@@ -96,9 +87,7 @@ server <- function(input, output, session) {
if
(
is.null
(
coconut.df
$
interaction.touch
)){}
if
(
is.null
(
coconut.df
$
interaction.touch
)){}
else
{
touch
<<-
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
),
...
@@ -114,6 +103,7 @@ server <- function(input, output, session) {
...
@@ -114,6 +103,7 @@ server <- function(input, output, session) {
)
)
)
)
})
})
#last coconut_name
#last coconut_name
output
$
lastLoadedNut
<-
renderText
({
output
$
lastLoadedNut
<-
renderText
({
if
(
is.null
(
input
$
nut
))
if
(
is.null
(
input
$
nut
))
...
@@ -129,27 +119,15 @@ server <- function(input, output, session) {
...
@@ -129,27 +119,15 @@ server <- function(input, output, session) {
#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
)
lastCoCoQuest
<<-
inFile
$
name
lastCoCoQuest
<<-
inFile
$
name
totalST
<<-
c
(
anytime
(
as.numeric
(
json_data_quest
$
startTime
)
/
1000
))
totalST
<<-
c
(
anytime
(
as.numeric
(
json_data_quest
$
startTime
)
/
1000
))
print
(
json_data_quest
)
#unix parsed
#unix parsed
dat
<-
do.call
(
rbind
,
json_data_quest
$
tasks
$
data
)
dat
<-
do.call
(
rbind
,
json_data_quest
$
tasks
$
data
)
endtimes
<<-
c
(
dat
$
endtime
)
endtimes
<<-
c
(
dat
$
endtime
)
parsedEndtimes
<<-
anytime
(
endtimes
/
1000
)
parsedEndtimes
<<-
anytime
(
endtimes
/
1000
)
#endtimes <<- format(dat$endtime, format="%d-%B-%Y %H:%M:%S")
print
(
"endtime quest"
)
print
(
parsedEndtimes
)
tasks
<-
rep
(
1
:
length
(
json_data_quest
$
tasks
$
data
),
sapply
(
json_data_quest
$
tasks
$
data
,
nrow
))
tasks
<-
rep
(
1
:
length
(
json_data_quest
$
tasks
$
data
),
sapply
(
json_data_quest
$
tasks
$
data
,
nrow
))
#questions
#print("Questions:", questions)
together
<<-
c
(
tasks
,
endtimes
)
together
<<-
c
(
tasks
,
endtimes
)
print
(
"together"
)
print
(
together
)
all
<-
rbind
(
together
)
all
<-
rbind
(
together
)
#setting the table style
#setting the table style
...
@@ -182,95 +160,13 @@ server <- function(input, output, session) {
...
@@ -182,95 +160,13 @@ server <- function(input, output, session) {
#Continue to view page
#Continue to view page
observeEvent
(
input
$
viewSite
,
{
observeEvent
(
input
$
viewSite
,
{
updateTabItems
(
session
,
"tabs"
,
selected
=
"views"
)
updateTabItems
(
session
,
"tabs"
,
selected
=
"views"
)
})
})
#View PAGE
#View PAGE
#Title Input
#Title Input
output
$
title
<-
renderText
({
input
$
title
})
output
$
title
<-
renderText
({
input
$
title
})
# #BARCHART selectinputs
# output$input_hist_x <- renderUI({
# if (is.null(input$nut))
# return(NULL)
# selectInput("bar_x", "x-axis:", choices = colnames(coconut.df))
# })
#
# output$input_hist_y <- renderUI({
# if (is.null(input$nut))
# return(NULL)
# selectInput("bar_y", "y-axis:", choices = colnames(coconut.df))
# })
#
#
# #TIMELINE selectinput--> do not need it
#
# # output$input_time_data <- renderUI({
# # if (is.null(input$nut))
# # return(NULL)
# # selectInput("input_time_data", "x-axis:", choices = colnames(coconut.df))
# # })
# #
# # output$input_time_y <- renderUI({
# # if (is.null(input$nut))
# # return(NULL)
# # selectInput("in4", "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)
# # })
#
# #LINECHART selectinput x
# output$input_line_x <- renderUI({
# if (is.null(input$nut))
# return(NULL)
# selectInput("line_x", "x-axis", choices=colnames(coconut.df))
# })
#
# #LINECHART selectinput y
# output$input_line_y <- renderUI({
# if (is.null(input$nut))
# return(NULL)
# selectInput("line_y", "y-axis", choices=colnames(coconut.df)) })
#
#
# #SCATTERPLOT selectinput x
# output$input_scat_x <- renderUI({
# if (is.null(input$nut))
# return(NULL)
# selectInput("scat_x", "x-axis", choices=colnames(coconut.df))
# })
#
# #SCATTERPLOT selectinput y
# output$input_scat_y <- renderUI({
# if (is.null(input$nut))
# return(NULL)
# selectInput("scat_y", "y-axis", choices=colnames(coconut.df))
# })
#
# #BOXPLOT selectinput x
# output$input_box_x <- renderUI({
# if (is.null(input$nut))
# return(NULL)
# selectInput("box_x", "data", choices=colnames(coconut.df))
# })
#
# #BOXPLOT selectinput y
# output$input_box_y <- renderUI({
# if (is.null(input$nut))
# return(NULL)
# selectInput("box_y", "y-axis", choices=colnames(coconut.df))
# })
#
#
# #MAP selectinput
# output$input_map <- renderUI({
# if (is.null(input$nut))
# return(NULL)
# selectInput("map_data", "data", choices=colnames(coconut.df))
# })
#Continue to dashboard page
#Continue to dashboard page
observeEvent
(
input
$
dashboardSite
,
{
observeEvent
(
input
$
dashboardSite
,
{
updateTabItems
(
session
,
"tabs"
,
selected
=
"dashboard"
)
updateTabItems
(
session
,
"tabs"
,
selected
=
"dashboard"
)
...
@@ -330,11 +226,6 @@ server <- function(input, output, session) {
...
@@ -330,11 +226,6 @@ server <- function(input, output, session) {
observeEvent
(
input
$
check_time
,
{
observeEvent
(
input
$
check_time
,
{
# plotname<<-paste("plot", plotCounter, sep="")
# plotCounter<<-plotCounter+1
# xplotname<<- paste("x",plotname,sep="")
# yplotname<<-paste("y",plotname, sep="")
insertUI
(
insertUI
(
#Inserting box and Chart
#Inserting box and Chart
selector
=
"#viewpanel"
,
#wo will ichs hinhaben
selector
=
"#viewpanel"
,
#wo will ichs hinhaben
...
@@ -378,16 +269,6 @@ server <- function(input, output, session) {
...
@@ -378,16 +269,6 @@ server <- function(input, output, session) {
#
#
# #TIMELINE view
# #TIMELINE view
# output$time <- renderTimevis({
# output$time <- renderTimevis({
# print("TIME wird aufgerufen")
#
# print("Length:")
# print(length(parsedEndtimes))
# print("combined")
# print( c(anytime(totalST), head(parsedEndtimes, -1)))
# print("endtimes")
# print(parsedEndtimes)
#
#
# data <- data.frame(
# data <- data.frame(
# id = 1:length(parsedEndtimes),
# id = 1:length(parsedEndtimes),
# content= c(1:length(parsedEndtimes)),
# content= c(1:length(parsedEndtimes)),
...
@@ -432,7 +313,7 @@ server <- function(input, output, session) {
...
@@ -432,7 +313,7 @@ server <- function(input, output, session) {
V2
=
as.numeric
(
coconut.df
[[
input
[[
yplotname
]]]])),
V2
=
as.numeric
(
coconut.df
[[
input
[[
yplotname
]]]])),
.Names
=
c
(
"V1"
,
"V2"
),
row.names
=
c
(
NA
,
10L
),
class
=
"data.frame"
)
.Names
=
c
(
"V1"
,
"V2"
),
row.names
=
c
(
NA
,
10L
),
class
=
"data.frame"
)
#new Linechart
#new Linechart
plot
(
data
$
V1
,
data
$
V2
,
type
=
"l"
,
ylab
=
input
[[
yplotname
]],
xlab
=
input
[[
xplotname
]]
,
las
=
2
)
plot
(
data
$
V1
,
data
$
V2
,
type
=
"l"
,
ylab
=
input
[[
yplotname
]],
xlab
=
input
[[
xplotname
]])
})
})
})
#Local end
})
#Local end
...
@@ -469,14 +350,12 @@ server <- function(input, output, session) {
...
@@ -469,14 +350,12 @@ server <- function(input, output, session) {
local
({
local
({
output
[[
plotname
]]
<-
renderPlot
({
output
[[
plotname
]]
<-
renderPlot
({
print
(
"hello itse mi"
)
print
(
yplotname
)
#data handling
#data handling
data
<-
structure
(
list
(
V1
=
as.numeric
(
coconut.df
[[
input
[[
xplotname
]]]]),
data
<-
structure
(
list
(
V1
=
as.numeric
(
coconut.df
[[
input
[[
xplotname
]]]]),
V2
=
as.numeric
(
coconut.df
[[
input
[[
yplotname
]]]])),
V2
=
as.numeric
(
coconut.df
[[
input
[[
yplotname
]]]])),
.Names
=
c
(
"V1"
,
"V2"
),
row.names
=
c
(
NA
,
10L
),
class
=
"data.frame"
)
.Names
=
c
(
"V1"
,
"V2"
),
row.names
=
c
(
NA
,
10L
),
class
=
"data.frame"
)
#new scatterplot
#new scatterplot
plot
(
data
$
V1
,
data
$
V2
,
type
=
"p"
,
ylab
=
input
[[
yplotname
]],
xlab
=
input
[[
xplotname
]]
,
las
=
2
,
axis.lty
=
1
)
plot
(
data
$
V1
,
data
$
V2
,
type
=
"p"
,
ylab
=
input
[[
yplotname
]],
xlab
=
input
[[
xplotname
]])
})
})
})
#Local end
})
#Local end
...
@@ -506,7 +385,6 @@ server <- function(input, output, session) {
...
@@ -506,7 +385,6 @@ server <- function(input, output, session) {
solidHeader
=
TRUE
,
solidHeader
=
TRUE
,
collapsible
=
TRUE
,
collapsible
=
TRUE
,
selectInput
(
xplotname
,
"data"
,
choices
=
colnames
(
coconut.df
)),
selectInput
(
xplotname
,
"data"
,
choices
=
colnames
(
coconut.df
)),
#selectInput(yplotname, "y-axis", choices=colnames(coconut.df)),
plotOutput
(
plotname
,
height
=
250
))
plotOutput
(
plotname
,
height
=
250
))
)
)
...
@@ -616,77 +494,4 @@ server <- function(input, output, session) {
...
@@ -616,77 +494,4 @@ server <- function(input, output, session) {
plot
(
data
$
V1
,
data
$
V2
,
type
=
"p"
,
xlab
=
input
$
scat_x
,
ylab
=
input
$
scat_y
)
plot
(
data
$
V1
,
data
$
V2
,
type
=
"p"
,
xlab
=
input
$
scat_x
,
ylab
=
input
$
scat_y
)
dev.off
()
dev.off
()
})
})
################## SOME STUFF ################
##DOWNLOADBUTTON
#observeEvent(input$screenshot,{
#if(input$check_line|input$check_time|input$check_map|input$check_hist)
#disable("screenshot")
#webshot::install_phantomjs()
# cdat <<- session$clientData
# url <- paste0(cdat$url_hostname,":", cdat$url_port,"/")
# print(url)
#URL <- "http://rstudio.github.io/leaflet/"
#appshot("cocoVisR/", file = "dashboard.png", port = getOption("shiny.port"), envvars = NULL)
#webshot(url,delay = 5.0)
#knit("dashboard.png")
#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)
##THIRD TRY
# observeEvent(input$down.pdf, {
#
# pdf("www/myreport.pdf")
# plotinput()
# dev.off()
# tags$iframe(style="height:600px; width:100%", src="myreport.pdf")
#
# })
#})
# url <- paste0(cdat$url_protocol,"//",cdat$url_hostname,":", cdat$url_port, cdat$url_pathname,cdat$url_search)
#output$downButton <- downloadHandler(
# filename="dashboard.png",
#content=function(file){
# observeEvent(input$downButton, {
#appshot("cocoVisR/dashboard", file = "dashboard.png", port = getOption("shiny.port"), envvars = NULL)
#})
#}
#)
##BARCHART
#histdata <- rnorm(500)
#output$plot1 <- renderPlot({
#data <- histdata[seq_len(input$slider)]
#hist(data)
#})
##MAP
#m <- leaflet()
#m <- addTiles(m)
#x=1
#for(x in 1:2019){
#m <- addMarkers(m,lng=longitude[x], lat=latitude[x]) #addPolylines does not work
#x=x+1}
#m
#}
}
}
dashboard/ui.R
View file @
9e6e4dbe
...
@@ -139,9 +139,11 @@ ui <- dashboardPage(
...
@@ -139,9 +139,11 @@ ui <- dashboardPage(
uiOutput
(
"scat_box"
),
uiOutput
(
"scat_box"
),
uiOutput
(
"box_box"
),
uiOutput
(
"box_box"
),
uiOutput
(
"map_box"
),
uiOutput
(
"map_box"
),
uiOutput
(
"pdfview"
),
uiOutput
(
"pdfview"
)
#
,
downloadButton
(
"down.pdf"
,
"Download"
)))
# downloadButton("down.pdf","Download")
)
)
...
...
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