JohnCoene / cicerone

🏛️ Give tours of your Shiny apps
https://cicerone.john-coene.com
Other
187 stars 7 forks source link

Basic callout with `highlight`? #55

Closed yogat3ch closed 1 year ago

yogat3ch commented 1 year ago

Does highlight allow for just a simple callout when you're not building a guide but just want to highlight an element?

I don't see any documentation for it. When I run the function via a small reprex I get a JS error:

image
Reprex ```r # # This is a Shiny web application. You can run the application by clicking # the 'Run App' button above. # # Find out more about building applications with Shiny here: # # http://shiny.rstudio.com/ # library(shiny) # Define UI for application that draws a histogram ui <- fluidPage( cicerone::use_cicerone(), # Application title div(id = "bins") ) # Define server logic required to draw a histogram server <- function(input, output) { cicerone::highlight( "bins", "test", "Does this work", position = "bottom-center" ) } # Run the application shinyApp(ui = ui, server = server) ```
etiennebacher commented 1 year ago

I think there are 2 issues:

This works:

library(shiny)

# Define UI for application that draws a histogram
ui <- fluidPage(
  cicerone::use_cicerone(),
  # Application title
  div(id = "bins", p("hello there"))
)

# Define server logic required to draw a histogram
server <- function(input, output) {

  cicerone::initialise("test")

  cicerone::highlight(
    "bins",
    "test",
    "Does this work",
    position = "bottom-center"
  )
}

# Run the application
shinyApp(ui = ui, server = server)
yogat3ch commented 1 year ago

Awesome, thank you for the help @etiennebacher !