Skip to content

Commit

Permalink
remove unneeded
Browse files Browse the repository at this point in the history
  • Loading branch information
gogonzo committed Nov 15, 2024
1 parent e0969da commit c5c744d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 34 deletions.
34 changes: 1 addition & 33 deletions R/tm_data_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,7 @@ ui_data_table <- function(id,

tagList(
teal.widgets::get_dt_rows(ns("data_table"), ns("dt_rows")),
div(
actionButton(ns("apply_brush_filter"), "Apply filter"),
actionButton(ns("remove_brush_filter"), "Remove applied filter")
),
div(actionButton(ns("apply_brush_filter"), "Apply filter")),
fluidRow(
teal.widgets::optionalSelectInput(
ns("variables"),
Expand Down Expand Up @@ -370,34 +367,5 @@ srv_data_table <- function(id,
shinyjs::hide("apply_brush_filter")
set_filter_state(filter_panel_api, slice)
})

states_list <- reactive({
as.list(get_filter_state(filter_panel_api))
})

observeEvent(input$remove_brush_filter, {
remove_filter_state(
filter_panel_api,
teal_slices(
teal_slice(
dataname = "ADSL",
varname = "USUBJID",
id = "brush_filter"
)
)
)
})

observeEvent(states_list(), {
brushed_states <- Filter(
function(state) state$id == "brush_filter",
states_list()
)
if (length(brushed_states)) {
shinyjs::show("remove_brush_filter")
} else {
shinyjs::hide("remove_brush_filter")
}
})
})
}
1 change: 0 additions & 1 deletion inst/swimlane_poc.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ pkgload::load_all("teal")
pkgload::load_all("teal.widgets")
pkgload::load_all("teal.modules.general")


# Example data
data <- within(teal_data(), {
library(dplyr)
Expand Down

0 comments on commit c5c744d

Please sign in to comment.