R:从服务器端打开弹出窗口

R:从服务器端打开弹出窗口,r,shiny,R,Shiny,我使用ShinyBS包中的bsModal指令在我的应用程序中打开弹出窗口 我想使用此弹出窗口以plotly方式渲染多个绘图,具体取决于我单击的输入按钮,但由于我必须在引号之间返回图形名称,因此我无法成功完成此操作 这是我的UI代码的一部分: tabItem(tabName = "Tab 1", useShinyjs(), bsModal("modal_graph", textOutput("graph_title"), textOutput("graph_name"), s

我使用ShinyBS包中的bsModal指令在我的应用程序中打开弹出窗口

我想使用此弹出窗口以plotly方式渲染多个绘图,具体取决于我单击的输入按钮,但由于我必须在引号之间返回图形名称,因此我无法成功完成此操作

这是我的UI代码的一部分:

tabItem(tabName = "Tab 1",
    useShinyjs(),

      bsModal("modal_graph", textOutput("graph_title"), textOutput("graph_name"), size = "large",
      fluidRow(plotlyOutput("graph_df", height = 700))),
以及我的服务器的一部分:

observeEvent(input$btn_modal_graphCG,{

    graph_title <- paste("Housing class : ", CL1)
    output$graph_title <- renderText({graph_title})

    graph_name <- shQuote("btn_modal_graphCG")
    output$graph_name <- renderText({graph_name})
使用关联的操作按钮:

actionButton("btn_modal_graph_", "", width = 100, icon("bar-chart"), class = "btn_block", style = "color : #FFF ; background-color : #337ab7 ; border-color : #2e6da4")
和服务器端:

observeEvent(input$btn_modal_graph,{
             .........
             .........
             output$graph_df <- renderPlotly({
             .........
             .........
                      }) # end of renderPlotly

toggleModal(session, "modal_graph", "open")

}) # end of observeEvent
observeEvent(输入$btn\u模态图{
.........
.........

output$graph_df Hello Symbolicaxau,很抱歉,我已经编辑了我的帖子,谢谢。不,不幸的是,它不起作用。我将尝试使用“toggleModal”命令从服务器端打开一个弹出窗口。非常感谢您的帮助。我将使用
uiOutput(“themodal”)
在用户界面和服务器中,我会输出$themodelThank,您非常喜欢,我刚刚用“toggleModal”命令找到。祝您有愉快的一天。如果您自己将其发布为答案并将其标记为正确,那就太好了。
observeEvent(input$btn_modal_graph,{
             .........
             .........
             output$graph_df <- renderPlotly({
             .........
             .........
                      }) # end of renderPlotly

toggleModal(session, "modal_graph", "open")

}) # end of observeEvent