删除闪亮的应用程序中不必要的空白

时间:2018-09-20 18:17:42

标签: r shiny

我正在制作一个闪亮的应用程序,但是我有很多不必要的空白。 我已经尝试过解决方案建议here,但这似乎不起作用,因为当我添加div(style =)部分时,它没有任何改变。

这是现在的样子: enter image description here

这就是我想要的样子:

enter image description here

下面是一个最小的工作示例

ui.r

library(shiny)

ui <- fluidPage(
  titlePanel("Minimal Working Example"),

  fluidRow(
column(1),


column(5, align = "center",
       sliderInput("ArousalSchema",
                   "Arousal Schema",
                   min = 0,
                   max = 1,
                   value = 0.25,
                   step = 0.01)

),
column(1),

column(5,
       div(style='padding:0px;',
       plotOutput('network'))

)),

  fluidRow(
column(1),

column(5,
       plotOutput('field')),

column(1),

column(5,
       plotOutput('landscape'))

  )
)

server.R

library(shiny)
library(qgraph)

shinyServer(function(input, output) {

  output$network <- renderPlot({
    adj <- matrix(c(0, 1, 0.5, 0), 2, 2, byrow = TRUE)

    adj[1,2] <- input$ArousalSchema

    L <- matrix(c(0, 0, 1, 0), 2, 2, byrow = TRUE)

    qgraph(adj, layout = L, labels = c("A", "PT"), minimum = 0, maximum = 1, cut = 0.3)
  })

  output$field <- renderPlot({
    x <- 1:10
    y <- 1:10

    plot(x,y) 
  })

  output$landscape <- renderPlot({

    z <- rnorm(1000)
    hist(z)
  })
})

0 个答案:

没有答案
相关问题