ericrayanderson/shinymaterial

Add compatibility with renderUI

Closed this issue ยท 8 comments

It would be awesome if you could render these outputs from the server, but it looks like this isn't possible at the moment. In addition, material_cards do not adapt their sizing to uiOutputs generated from the server.

capture

This would be a great feature, and the next logical thing to add to this package. Also, I will look into the issue with the cards.

I also noticed that material_buttons and material_modals don't trigger events when generated from renderUI , but actionButtons still work?

Ya, there are definitely issues with the renderUI. This will be the next thing addressed.

I'd like to bump up the priority of this issue.

renderUI is key to build in dependency rendering. Without it, the usability of this package will be very limited....

My issue below (not rendering at all)
image
image

minimal example

library(shiny)
library(shinymaterial)
library(visNetwork)
# Wrap shinymaterial apps in material_page
ui <- material_page(
  title = "Basic Page",
  tags$h1("Page Content"),
  uiOutput('ui_test')
)

server <- function(input, output) {
  output$ui_test <- renderUI({
    visNetworkOutput('vis_vn',width = "100%",height = 800)
  })
  
  output$vis_vn <- renderVisNetwork({
    isolate({
      nodes <- data.frame(id = 1:3)
      edges <- data.frame(from = c(1,2), to = c(1,3))
      visNetwork(nodes, edges)
    })
  })
}
shinyApp(ui = ui, server = server)

Please try the most recent dev version

devtools::install_github("ericrayanderson/shinymaterial")

with renderUI (using material_inputs).

Still working on a fix regarding the issue directly above this comment.

@arpyem The issue regarding the material_card: Are you still experiencing this with the most recent dev release? devtools::install_github("ericrayanderson/shinymaterial")

Also, does putting the material_card call inside the renderUI (as opposed to ui.R) solve this issue?

@nfultz material_buttons rendered from renderUI should now work in the most recent dev version.

devtools::install_github("ericrayanderson/shinymaterial")