# NOT RUN {
if (interactive()) {
library(dash)
app <- Dash$new()
app$layout(
htmlDiv(
list(
dccSlider(
id = "slider-input",
min = -5,
max = 10,
step = 0.5,
value = -3
),
htmlDiv(
id = "slider-output",
children = "Make a selection on the slider to see the value appear here."
)
)
)
)
app$callback(
output("slider-output", "children"),
list(input("slider-input", "value")),
function(value) {
return(paste0("You have chosen ", value, " on the slider above."))
}
)
app$run_server()
}
# }
Run the code above in your browser using DataLab