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
592039b3
Commit
592039b3
authored
Aug 01, 2018
by
Stephanie Wegscheidl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cocoQuest Import and tableview now right, PROBLEM: showing date/time in shiny GUI
parent
a11186f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
50 deletions
+45
-50
dashboard/server.R
dashboard/server.R
+41
-48
dashboard/ui.R
dashboard/ui.R
+4
-2
No files found.
dashboard/server.R
View file @
592039b3
...
...
@@ -44,17 +44,14 @@ server <- function(input, output) {
})
output
$
lastLoadedNut
<-
renderText
({
lastCoConUT
if
(
is.null
(
input
$
nut
))
return
(
NULL
)
else
lastCoConUT
})
#CoCOQuest Data import and showing into data site
output
$
lastLoadedQuest
<-
renderText
({
})
output
$
questTimes
<-
renderDataTable
({
inFile
<-
input
$
quest
if
(
is.null
(
inFile
))
...
...
@@ -64,28 +61,40 @@ server <- function(input, output) {
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_endtime
<-
as.numeric
(
json_data_quest
$
endTime
)
/
1000
starttime
<-
anytime
(
json_data_quest
$
unix_starttime
)
endtime
<-
anytime
(
json_data_quest
$
unix_endtime
)
totalStarttime
<<-
anytime
(
json_data_quest
$
unix_starttime
)
totalEndtime
<<-
anytime
(
json_data_quest
$
unix_endtime
)
#unix parsed
questTimes
<<-
c
(
starttime
,
endtime
)
print
(
"questTime"
)
print
(
questTimes
)
mat
<-
matrix
(
questTimes
,
1
,
2
)
#mat <- matrix(as.Date(questTimes),1,2)
dat
<-
do.call
(
rbind
,
json_data_quest
$
tasks
$
data
)
endtimes
<<-
c
(
anytime
(
dat
$
endtime
/
1000
))
tasks
<-
rep
(
1
:
length
(
json_data_quest
$
tasks
$
data
),
sapply
(
json_data_quest
$
tasks
$
data
,
nrow
))
#count<<-0
# y <<-1
# x<<-1
#numOfTasks <<- if(tasks[x]!=y)
# {
# count<<-count+1
# y<<-y+1
# x<<-x+1
#}
#else{x<<-x+1}
together
<<-
c
(
tasks
,
endtimes
)
#all <<- matrix(c(tasks,endtimes),byrow=FALSE,nrow=length(tasks))
all
<-
rbind
(
together
)
print
(
"mat"
)
print
(
mat
)
colnames
(
mat
)
<-
c
(
"Starttime"
,
"Endtime"
)
#setting the table style
datatable
(
cbind
(
mat
),
cbind
(
tasks
,
endtimes
),
options
=
list
(
searching
=
FALSE
,
#autoWidth = TRUE,
...
...
@@ -99,36 +108,20 @@ server <- function(input, output) {
)
})
#TODO: CoCoQuest Output --> Ansätze data[] raus nehmen oder flatten richtig funken
##output$file2 <- renderDataTable({
# inFile <- input$file2
#if (is.null(inFile))
# return(NULL)
#simplifyVector <- c("studyID", "studyName", "description", "tasks$endTime" , "id", "startTime", "endTime")
#json_data_quest <- fromJSON(paste(inFile$datapath, sep = ""), simplifyVector = TRUE, simplifyDataFrame = simplifyVector,
# simplifyMatrix = simplifyVector, flatten = TRUE)
#lastLoadedQuest<<-inFile$name
#print("with simplify: ")
#print(json_data_quest)
## ANSATZ zum rauslesen der Times: --> not working now
#questLength <<- length(json_data_quest)
#print("length")
#print(questLength)
#data <- c(json_data_quest$tasks[[1]]$`data`[[1]]$endtime, json_data_quest$tasks[[1]]$`data`[[2]]$endtime, json_data_quest$tasks[[1]]$startTime, json_data_quest$tasks[[1]]$endTime, json_data_quest$tasks[[2]]$`data`[[1]]$endtime, json_data_quest$tasks[[2]]$`data`[[2]]$endtime, json_data_endtime$tasks[[2]]$`data`[[3]]$endtime)
#data<-c(json_data_quest$tasks[[1]]$startTime, json_data_quest$tasks[[1]]$endTime, json_data_quest$tasks[[2]]$startTime, json_data_quest$tasks[[2]]$endTime )
#x<<-0
#for(x in x:questLength)
#{data<<-c(json_data_quest$tasks[[x]]$startTime, json_data_quest$tasks[[x]]$endTime)
#x=x+1}
#print("data: ")
#print(data)
#CoCOQuest Data import and showing into data site
output
$
lastLoadedQuest
<-
renderText
({
if
(
is.null
(
input
$
quest
))
return
(
NULL
)
else
lastCoCoQuest
##})
})
output
$
totalStarttime
<-
renderText
({
if
(
is.null
(
input
$
quest
))
return
(
NULL
)
else
as.POSIXct
(
totalStarttime
)
print
(
totalStarttime
)
})
#TODO: Getting HEADER out of json to select it
...
...
dashboard/ui.R
View file @
592039b3
...
...
@@ -48,14 +48,16 @@ ui <- dashboardPage(
tabItem
(
tabName
=
"data"
,
h2
(
"CoConUT Data here:"
),
"Last Loaded CoConUT Data: "
,
h4
(
"Last Loaded CoConUT Data: "
)
,
textOutput
(
"lastLoadedNut"
),
dataTableOutput
(
"nut"
),
h2
(
"CoCoQuest Data here:"
),
"Last Loaded CoCoQuest Data: "
,
h4
(
"Last Loaded CoCoQuest Data: "
)
,
textOutput
(
"lastLoadedQuest"
),
h4
(
"Starttime: "
),
textOutput
(
"totalStarttime"
),
dataTableOutput
(
"questTimes"
)
),
...
...
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