【问题标题】:Increase the width of the text box made by bsPopover in Shiny增加Shiny中bsPopover制作的文本框的宽度
【发布时间】:2020-05-13 16:11:32
【问题描述】:

朋友们,我想增加bsPopover制作的文本框的宽度。使其更水平,即增加文本框的宽度。这是可能的??可执行代码如下。任何帮助表示赞赏。

library(shinyBS)
library(shiny)


DES_filter1<-paste("Sudden she seeing garret far regard. By hardly it direct if pretty up regret. Ability thought enquire settled prudent you sir. Or easy knew sold on well come year. Something consulted age extremely end procuring. Collecting preference he inquietude projection me in by. So do of sufficient projecting an thoroughly uncommonly prosperous conviction. Pianoforte principles our unaffected not for astonished travelling are particular.", sep = "<br>")


ui <- fluidPage(


  titlePanel("Old Faithful Geyser Data"),

  sidebarLayout(
    sidebarPanel(

      radioButtons(
        "filter1", 
        h3("Select properties"), 
        choiceValues = c(1, 2),
        choiceNames = list(
          tagList(
            tags$span("All properties"),
            tags$span(icon("info-circle"), id = "icon1", style = "color: blue;")
          ), 
          tagList(
            tags$span("Exclude properties"),
            tags$span(icon("info-circle"), id = "icon2", style = "color: blue;")
          )
        ),
        selected = 1
      ),

      bsPopover("icon1", "TITLE1", DES_filter1, placement = "right"), 
      bsPopover("icon2", "TITLE2", "CONTENT2", placement = "right"), 

      radioButtons("filter2", h3("Select farms"),
                   choices = list("All farms" = 1, 
                                  "Exclude farms" = 2),
                   selected = 1),
      ),

    mainPanel(

    )
  )
)

server <- function(input, output) {

}

shinyApp(ui = ui, server = server) 

非常感谢各位朋友!

【问题讨论】:

    标签: r shiny


    【解决方案1】:
    library(shinyBS)
    library(shiny)
    
    popoverTempate <- 
      '<div class="popover popover-lg" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
    
    DES_filter1<-paste("Sudden she seeing garret far regard. By hardly it direct if pretty up regret. Ability thought enquire settled prudent you sir. Or easy knew sold on well come year. Something consulted age extremely end procuring. Collecting preference he inquietude projection me in by. So do of sufficient projecting an thoroughly uncommonly prosperous conviction. Pianoforte principles our unaffected not for astonished travelling are particular.", sep = "<br>")
    
    
    ui <- fluidPage(
    
      tags$head(
        tags$style(HTML(".popover.popover-lg {width: 500px; max-width: 500px;}"))
      ),
      titlePanel("Old Faithful Geyser Data"),
    
      sidebarLayout(
        sidebarPanel(
    
          radioButtons(
            "filter1", 
            h3("Select properties"), 
            choiceValues = c(1, 2),
            choiceNames = list(
              tagList(
                tags$span("All properties"),
                tags$span(icon("info-circle"), id = "icon1", style = "color: blue;")
              ), 
              tagList(
                tags$span("Exclude properties"),
                tags$span(icon("info-circle"), id = "icon2", style = "color: blue;")
              )
            ),
            selected = 1
          ),
    
          bsPopover("icon1", "TITLE1", DES_filter1, placement = "right", 
                    options = list(template = popoverTempate)), 
          bsPopover("icon2", "TITLE2", "CONTENT2", placement = "right"), 
    
          radioButtons("filter2", h3("Select farms"),
                       choices = list("All farms" = 1, 
                                      "Exclude farms" = 2),
                       selected = 1),
        ),
    
        mainPanel(
    
        )
      )
    )
    
    server <- function(input, output) {
    
    }
    
    shinyApp(ui = ui, server = server) 
    

    【讨论】:

    猜你喜欢
    • 2018-03-17
    • 2020-09-13
    • 1970-01-01
    • 1970-01-01
    • 2016-12-18
    • 2011-05-02
    • 2012-01-18
    • 2015-12-18
    • 2017-12-18
    相关资源
    最近更新 更多