I currently have two sliders that I use to reactively plot points on a plotly graph in shiny. The sliders are called "x" and "y". I then feed these values into an optimizer that gives me a solution. On my "x" and "y" sliders, I would like to add a vertical dotted line and text that tells the x-value and y-value of the optimized point. Note: I do not want this dotted line to be able to move from a user's input. The purpose of this line is to tell the user how much the current solution achieves on the current goal. I already know how to reactively update the slider, so I am mainly just looking for the aesthetic component of adding the line. If adding a line is too difficult, I wouldn't mind just a marker, as long as the intended information is conveyed.
Adding a line to the slider like this
A simplified version of my code looks like this.
library(shiny)
library(shinydashboard)
library(shinyjs)
ui <- fluidPage(
shiny::sliderInput(inputId = 'x',
label = "X Slider",
value = 0.9,
pre = paste("Goal x: "),
min = 0,
max = 1
),
shiny::sliderInput(inputId = 'y',
label = "Y Slider",
value = 0.5,
pre = paste("Goal y: "),
min = 0,
max = 1
)
)
server <- function(input, output) {}
shinyApp(ui = ui, server = server)