Skip to content

Commit d33d8fb

Browse files
committed
Grabbed Ezra's changes on the POV tab
1 parent 00c3f0f commit d33d8fb

2 files changed

Lines changed: 89 additions & 70 deletions

File tree

‎R/server/choosePOV.R‎

Lines changed: 46 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,64 @@
1-
# Server Output Functions for Choose POV Tab
21

32
#### Define Threads sub-tab ####
43

5-
output$POV_Tab_Controls_2 <- renderUI({
6-
checkboxGroupInput(
7-
"THREAD_CF_ID",
8-
"Select columns to define threads:",
9-
cfnames(selectOccFilter()),
10-
selected = get_THREAD_CF(),
11-
inline = TRUE
12-
)
4+
output$povThreadSelector <- renderUI({
5+
checkboxGroupInput(
6+
"THREAD_CF_ID",
7+
"Select columns to define threads:",
8+
get_CF(),
9+
selected = "",
10+
inline = TRUE
11+
)
1312
})
1413

15-
output$ContextFlowers_2 <- renderPlotly({
16-
CF_multi_pie(
17-
selectOccFilter(),
18-
get_THREAD_CF()
19-
)
14+
output$ContextFlowers_Threads <- renderPlotly({
15+
CF_multi_pie(
16+
selectOccFilter(),
17+
get_THREAD_CF()
18+
)
2019
})
2120

2221
#### Define Events sub-tab ####
2322

24-
output$POV_Tab_Controls_3 <- renderUI({
25-
checkboxGroupInput(
26-
"EVENT_CF_ID",
27-
"Select columns to mark events:",
28-
cfnames(selectOccFilter()),
29-
selected = get_EVENT_CF(),
30-
inline = TRUE
31-
)
23+
output$povEventSelector <- renderUI({
24+
checkboxGroupInput(
25+
"EVENT_CF_ID",
26+
"Select columns to mark events:",
27+
get_CF(),
28+
selected = "",
29+
inline = TRUE
30+
)
3231
})
3332

34-
output$ContextFlowers_3 <- renderPlotly({
35-
CF_multi_pie(
36-
selectOccFilter(),
37-
get_EVENT_CF()
38-
)
33+
output$ContextFlowers_Events <- renderPlotly({
34+
CF_multi_pie(
35+
selectOccFilter(),
36+
get_EVENT_CF()
37+
)
3938
})
4039

41-
#### Preview Threads sub-tab ####
40+
#### Preview Data sub-tab ####
41+
42+
########
43+
# The POV tabs reconstruct the data into threads by sorting by tStamp and
44+
# adding columns for threadNum and seqNum for the selected POV in ThreadOccByPOV
45+
output$povDataThreads <- DT::renderDataTable({
4246

43-
output$previewThreadMap_1 <- renderPlotly({
44-
threadMap(
45-
threadedOcc(),
46-
"threadNum",
47-
"tStamp",
48-
newColName(get_EVENT_CF()),
49-
16
50-
)
47+
# thread occurences by POV
48+
threadedOcc()
5149
})
5250

53-
output$Preview_Thread_Output_1 <- renderText({ paste(numThreads(threadedOcc(), "threadNum"),"threads in the selected data.")})
51+
#### Add new Dataset sub-tab ####
5452

55-
#### Preview Data sub-tab ####
53+
output$addPOV <- renderUI({
54+
tags$div(
55+
align="left",
56+
textInput(
57+
"POVMapName",
58+
label = h4(paste("Enter label for this POV mapping")),
59+
value = ""
60+
),
61+
actionButton("addPOVButton", "Save mapping")
62+
)
63+
})
5664

57-
output$Thread_Tab_Output_1 <- DT::renderDataTable({ threadedOcc()})

‎R/ui/choosePOV.R‎

Lines changed: 43 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,45 @@
1-
tabPanel(value = "choosePOV",
2-
"Choose POV",
3-
helpText('Select columns from your data to define your point of view. You MUST click on either Preview Threads or Preview Data before proceeding.'),
4-
tags$hr(),
5-
tabsetPanel(
6-
id = "tabs",
7-
tabPanel(value = "defineThreads",
8-
"Define Threads",
9-
tags$h4("Threads are defined by contextual features that STAY THE SAME during a thread. At least ONE is required."),
10-
uiOutput("POV_Tab_Controls_2"),
11-
plotlyOutput("ContextFlowers_2")
12-
),
13-
tabPanel(value = "defineEvents",
14-
"Define Events",
15-
tags$h4("Events are marked by contextual features that CHANGE within the threads. At least ONE is required."),
16-
uiOutput("POV_Tab_Controls_3"),
17-
plotlyOutput("ContextFlowers_3")
18-
),
19-
# tabPanel(
20-
# "Preview Threads",
21-
# tags$h4("Threads based on selected POV"),
22-
# verbatimTextOutput("Preview_Thread_Output_1" ),
23-
# # ** add conditional panels here to choose output **
24-
# plotlyOutput("previewThreadMap_1")
25-
# ),
26-
tabPanel(value = "showThreads",
27-
"*** CLICK HERE TO PROCEED ***",
28-
tags$h4("This table shows the data threaded from your chosen POV"),
29-
DT::dataTableOutput("Thread_Tab_Output_1")
30-
)
1+
# UI: Choose POV tab definitions
2+
3+
tabPanel(
4+
5+
value = "choosePOV",
6+
7+
"Choose POV",
8+
9+
tags$hr(),
10+
11+
tabsetPanel(
12+
13+
id = "tabs",
14+
15+
tabPanel(
16+
value = "defineThreads",
17+
"Define Threads",
18+
tags$h4("Threads are defined by contextual features that STAY THE SAME during a thread. At least ONE is required."),
19+
uiOutput("povThreadSelector"),
20+
plotlyOutput("ContextFlowers_Threads")
21+
),
22+
23+
tabPanel(
24+
value = "defineEvents",
25+
"Define Events",
26+
tags$h4("Events are marked by contextual features that CHANGE within the threads. At least ONE is required."),
27+
uiOutput("povEventSelector"),
28+
plotlyOutput("ContextFlowers_Events")
29+
),
30+
31+
tabPanel(
32+
value = "showThreads",
33+
"Review Data",
34+
tags$h4("This table shows the data threaded from your chosen POV."),
35+
DT::dataTableOutput("povDataThreads")
36+
),
37+
38+
tabPanel(
39+
value = "saveThreads",
40+
"Save Data",
41+
tags$h4("Save this dataset to continue."),
42+
uiOutput("addPOV")
3143
)
44+
)
3245
)
33-

0 commit comments

Comments
 (0)