Closed Tutuchan closed 4 months ago
Hello,
I added some code so we can retrieve the value of the legend item after a click event. The Shiny input is the input specified in tauchart() with -legend added at the end (e.g. tauchart(inputId = "test") yields input[["test-legend"]]).
tauchart()
-legend
tauchart(inputId = "test")
input[["test-legend"]]
Please, let me know if you feel this is useful.
Some code to test:
library(shiny) library(taucharts) ui <- fluidPage( titlePanel("Hello Shiny!"), sidebarLayout( sidebarPanel(), mainPanel( tauchartsOutput(outputId = "tc"), h2("Selected"), textOutput(outputId = "leg") ) ) ) server <- function(input, output) { output$tc <- renderTaucharts({ tauchart(iris, inputId = "iris") %>% tau_point(x = "Petal.Width", y = "Sepal.Width", color = "Species") %>% tau_legend() }) output$leg <- renderText(input[["iris-legend"]]) } shinyApp(ui = ui, server = server)
Hello,
I added some code so we can retrieve the value of the legend item after a click event. The Shiny input is the input specified in
tauchart()
with-legend
added at the end (e.g.tauchart(inputId = "test")
yieldsinput[["test-legend"]]
).Please, let me know if you feel this is useful.
Some code to test: