从R Studio库“ esquisse”中查询

时间:2019-10-30 06:46:18

标签: r shiny rstudio shinydashboard

我试图在图选项中将“ squisse”包含在shiny_material中:“ Facet Scales”,“ Positions”,“ Flipordinates”选项不起作用。请引导我出路。     以上选项在“发光的流体页面”中有效,而在“发光的材料页面”中无效。

当我尝试执行代码时,选项会闪亮:

library(shiny)
library(esquisse)
ui <- fluidPage(
  tags$h1("Use esquisse as a Shiny module"),
  radioButtons(
    inputId = "data",
    label = "Data to use:",
    choices = c("iris", "churn_data_raw"),
    inline = TRUE
  ),
  tags$div(
    style = "height: 700px;", # needs to be in fixed height container
    esquisserUI(
      id = "esquisse",
      header = FALSE, # dont display gadget title
      choose_data = FALSE # dont display button to change data
    )
  )
)

server <- function(input, output, session) {
  data_r <- reactiveValues(data = iris, name = "iris")

  observeEvent(input$data, {
    if (input$data == "iris") {
      data_r$data <- iris
      data_r$name <- "iris"
    } else {
      data_r$data <- churn_data_raw
      data_r$name <- "churn_data_raw"
    }
  })

  callModule(module = esquisserServer, id = "esquisse", data = data_r)
}

shinyApp(ui, server)

当我尝试执行代码时,以上选项在闪亮材料中不起作用:

library(shiny)
library(shinymaterial)
library(esquisse)

ui <- material_page(
  radioButtons(
    inputId = "data",
    label = "Data to use:",
    choices = c("iris", "churn_data_raw"),
    inline = TRUE
  ),
  tags$div(
    style = "height: 700px;", # needs to be in fixed height container
    esquisserUI(
      id = "esquisse",
      header = FALSE, # dont display gadget title
      choose_data = FALSE # dont display button to change data
    )
  )
)

server <- function(input, output, session) {
  data_r <- reactiveValues(data = iris, name = "iris")
  observeEvent(input$data, {
    if (input$data == "iris") {
      data_r$data <- iris
      data_r$name <- "iris"
    } else {
      data_r$data <- churn_data_raw
      data_r$name <- "churn_data_raw"
    }
  })

  callModule(module = esquisserServer, id = "esquisse", data = data_r)
}

shinyApp(ui, server)

附带的屏幕截图很容易解释:

Not working in shiny material for the above code ..Image

Working in Fluid page for the above code ..Image

0 个答案:

没有答案