Skip to content

Commit f913acb

Browse files
committed
display brushed only
1 parent ea67bd0 commit f913acb

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

R/tm_p_swimlane2.r

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ srv_p_swimlane2 <- function(id,
6868
shinyjs::hide("brushing_wrapper")
6969
} else {
7070
shinyjs::show("brushing_wrapper")
71-
eval_code(plotly_q(), as.expression(brush_filter_call()))
71+
q <- eval_code(plotly_q(), as.expression(brush_filter_call()))
72+
module_datanames <- unique(lapply(plotly_specs, function(x) deparse(x$data)))
73+
is_brushed <- sapply(module_datanames, function(x) is.data.frame(q[[x]]) && nrow(q[[x]]))
74+
brushed_datanames <- unique(unlist(module_datanames[is_brushed]))
75+
q[brushed_datanames] # we want to show brushed datanames only
7276
}
7377
})
7478

inst/poc_osprey.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
pkgload::load_all("teal")
2-
pkgload::load_all("teal.widgets")
31
pkgload::load_all("teal.modules.general")
42

53
data <- within(teal_data(), {

0 commit comments

Comments
 (0)