Make a shiny app for profiling the shiny apps using the profvis package

I was wondering if one could have an app, asking for the path to the shiny application then do the profiling, and show the results ? something like the following script (which does not work at least in this format !)

library(shiny)
library(profvis)
ui <- fluidPage(

    titlePanel("test profvis"),

    sidebarLayout(
        sidebarPanel(
            textInput("path",
                        "path to the shiny app:"),
            actionButton("go", "Go"),
        ),

        mainPanel(
           htmlOutput("profvis")
        )
    )
)

server <- function(input, output) {
    
    p <- eventReactive(input$go,{
        profvis(shiny::runApp(input$path))
    })
    
    
    output$profvis <- renderUI({
         p()
    })  
}
shinyApp(ui = ui, server = server)

Even if I do it manually like :

p = profvis(shiny::runApp("/path/to/my/app.R"))
htmlwidgets::saveWidget(p, "profile.html") 

and then put the HTML file inside the www folder on my app and try to use it in Shiny app, it won't work :

library(shiny)
library(profvis)
ui <- fluidPage(

    titlePanel("test profvis"),

    sidebarLayout(
        sidebarPanel(),

        mainPanel(
           htmlOutput("profvis")
        )
    )
)

server <- function(input, output) {

    getPage<-function() {
        return(includeHTML("www/profile.html"))
    }
    output$profvis <- renderUI({
        getPage()
    })
    
    
}

shinyApp(ui = ui, server = server)

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.