Maybe we should investigate if we could just pass the ranges directly to optionalSliderInput and remove min, max, and step arguments to optimize our code.
|
ui = function(id) { |
|
ns <- NS(id) |
|
pretty_range_inputs <- private$get_pretty_range_inputs(private$choices) |
|
fluidRow( |
|
div( |
|
class = "filterPlotOverlayRange", |
|
plotOutput(ns("plot"), height = "100%") |
|
), |
|
teal.widgets::optionalSliderInput( |
|
inputId = ns("selection"), |
|
label = NULL, |
|
min = pretty_range_inputs["min"], |
|
max = pretty_range_inputs["max"], |
|
# on filter init without predefined value select "pretty" (wider) range |
|
value = isolate({ |
|
if (identical(private$choices, self$get_selected())) { |
|
pretty_range_inputs[c("min", "max")] |
|
} else { |
|
self$get_selected() |
|
} |
|
}), |
|
width = "100%", |
|
step = pretty_range_inputs["step"] |
I'll make a new issue so we can look into this.
Originally posted by @donyunardi in #98 (comment)
Maybe we should investigate if we could just pass the ranges directly to
optionalSliderInputand removemin,max, andsteparguments to optimize our code.teal.slice/R/FilterState.R
Lines 1381 to 1403 in a449203
I'll make a new issue so we can look into this.
Originally posted by @donyunardi in #98 (comment)