2017-10-05 14 views
0

私はちょうどRシャイニーを使い始めました。しかし、私はシャイニーでjsとhtmlコードを使用していくつかの問題を抱えています。光沢のあるbsPopoverの幅を変更

私のアプリでは、bsButtonの2つがあり、ホバーするとbsPopoverというテキストが表示されます。これらのポップオーバーの1つには、ポップオーバーの標準ボックスよりも大きなイメージが含まれています。このポップオーバーの幅を設定したいと思います。

Hereすべてのポップオーバーの幅と高さの設定方法が見つかりましたが、特定のポップオーバーの幅/高さを設定するにはどうすればよいですか?

これは、これまでの私のコードであると私はbsPopover(id="q2", ...)の幅ではなくbsPopover(id="q1", ...)の幅を変更したい:

library(shiny) 
library(shinyBS) 

ui <- fluidPage(

    tags$head(
    # this changes the size of the popovers 
    tags$style(".popover{width:200px;height:250px;}") 
), 

    fluidRow(
    fileInput("file", label=h4("Upload Data", 
           tags$style(type = "text/css", "#q1 {vertical-align: top;}"), 
           bsButton("q1", label="", icon=icon("question"), style="info", size="extra-small")), 
       accept=".txt" 
    ),    

    bsPopover(id="q1", title="Title help text1", 
     content=paste("help text"), 
     placement = "right", 
     trigger = "hover", 
     options = list(container = "body") 
    ), 

    numericInput("numIn", label = h4("Choose a value", 
            tags$style(type="text/css", "#q2 {vertical-align: top;}"), 
            bsButton("q2", label="", icon=icon("question"), style="info", size="extra-small")), 
       value = 2.5, step=0.5), 

    bsPopover(id="q2", title="Title help text 2", 
     content=paste0("The figure below shows", 
        img(src='scenarios.png', align = "center", height="320px", width="800px", style="display:block;margin-top:20px;margin-left:auto;margin-right:auto;") 

    ), 
     placement = "right", 
     trigger = "hover", 
     options = list(container = "body") 
    ) 
) 
) 

server <- function(input, output) {} 

shinyApp(ui = ui, server = server) 

答えて

0

だけ

tags$style("#q2{width:200px;height:250px;}") 

tags$style(".popover{width:200px;height:250px;}") 

を置き換えます

+0

答えをありがとう。 Unfortnately thisこれは、ボタンのサイズを変更します。 – RFelber

+0

しかし、popoverボックスのサイズは変更しません。 – RFelber

関連する問題