Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add and fix example popovers for elements #6

Closed
Martin-Jung opened this issue Nov 18, 2023 · 1 comment
Closed

Add and fix example popovers for elements #6

Martin-Jung opened this issue Nov 18, 2023 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@Martin-Jung
Copy link
Collaborator

Ideally for every element a popup is shown that display an example of what could be entered in a given field, also possibly including a reference.

The protocol has already been expanded by a popexample field which provides the example text. This text needs to be loaded in and added via addPopover()
The Example code works, however not when added within golem modules?

library(shiny)
library(bs4Dash)

shinyApp(
  ui = dashboardPage(
    header = dashboardHeader(),
    sidebar = dashboardSidebar(),
    controlbar = dashboardControlbar(),
    footer = dashboardFooter(),
    title = "Popover server",
    body = dashboardBody(
      sliderInput("obs", "Number of observations:",
                  min = 0, max = 1000, value = 500
      ),
      textAreaInput(inputId = "test",label = "hello"),
      plotOutput("distPlot")
    )
  ),
  server = function(input, output, session) {
    output$distPlot <- renderPlot({
      hist(rnorm(input$obs))
    })
    
        addPopover(
          id = "test",
          options = list(
            content = "Vivamus sagittis lacus vel augue laoreet rutrum faucibus.",
            title = "Server popover",
            placement = "bottom",
            trigger = "hover"
          )
        )
  }
)
@Martin-Jung Martin-Jung added bug Something isn't working enhancement New feature or request labels Nov 18, 2023
@Martin-Jung
Copy link
Collaborator Author

Added in 55142ea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant