Unten richten Sie eine Schaltfläche in R glänzend aus

Lesezeit: 1 Minute

Guyabels Benutzeravatar
Guyabel

Ich kann keine Möglichkeit finden, unten auszurichten downloadButton mit einer selectizeInputdh,

Geben Sie hier die Bildbeschreibung ein

library(shiny)

runApp(list(
  ui = shinyUI(fluidPage(
    fluidRow(align="bottom",
      column(12, align="bottom",
             h4("Download Options:"),
             fluidRow(align="bottom", 
                      column(6, selectizeInput("plot_dl", "File Type", width="100%",  
                                               choices = list("PDF"="pdf","PNG"="png"))),
                      column(3, downloadButton('plot1_dl', 'Left Plot')),
                      column(3, downloadButton('plot2_dl', 'Right Plot'))
             )
      )
    ),
    tags$style(type="text/css", "#plot1_dl { width:100%; vertical-align:bottom}"),
    tags$style(type="text/css", "#plot2_dl { width:100%;}")
  )),
  server = function(input, output) {
  }
))

Platzierung align="bottom" irgendwo und überall wirft keine Fehlermeldung, hat aber auch nicht den gewünschten Effekt. Ich habe versucht, mit den Stil-Tags der Schaltflächen herumzuspielen, bin aber weit über meine Tiefe hinaus.

Ad-hoc-Fix mit gefunden margin-top: 25px im Style-Tag …

Geben Sie hier die Bildbeschreibung ein

library(shiny)

runApp(list(
  ui = shinyUI(fluidPage(
     h4("Download Options:"),
     fluidRow(
       column(6, selectizeInput("plot_dl", "File Type", width="100%",
                                choices = list("PDF"="pdf","PNG"="png"))),
       column(3, downloadButton('plot1_dl', 'Left Plot')),
       column(3, downloadButton('plot2_dl', 'Right Plot'))
     ),
     tags$style(type="text/css", "#plot1_dl { width:100%; margin-top: 25px;}"),
     tags$style(type="text/css", "#plot2_dl { width:100%; margin-top: 25px;}")
  )),
  server = function(input, output) {
  }
))

  • Ja, ich wollte vorschlagen, dies zu untersuchen, da der Name des Selectinput ‘File Type’ die Platzierung beeinflusst

    – Schweinekotelett

    10. März 2015 um 10:42 Uhr

  • Das scheint mir beim Ausprobieren keinen Unterschied zu machen. Allerdings benutze ich uiOutput(). Könnte das einen Unterschied machen??

    – der Forstökologe

    24. April 2017 um 14:22 Uhr


Ein anderer Weg, es zu tun, ist zu bestehen style Argument in der Spaltenfunktion.

runApp(list(
        ui = shinyUI(fluidPage(
                h4("Download Options:"),
                fluidRow(
                        column(6, selectizeInput("plot_dl", "File Type", width="100%",
                                                 choices = list("PDF"="pdf","PNG"="png"))),
                        column(3, style = "margin-top: 25px;", downloadButton('plot1_dl', 'Left Plot')),
                        column(3, style = "margin-top: 25px;", downloadButton('plot2_dl', 'Right Plot'))
                )
        )),
        server = function(input, output) {
        }
))

1429920cookie-checkUnten richten Sie eine Schaltfläche in R glänzend aus

This website is using cookies to improve the user-friendliness. You agree by using the website further.

Privacy policy