I wonder if it is possible to send a json file from shiny and call a function in javascript that uses this json file as a parameter.
This is my server
server <- function(input, output, session){
jsonstring <- read_json("Documents/HelloWorld.json")
output$table2 <- renderTable({
#json_test
session$sendCustomMessage("OpenJSON", jsonstring)
})
}
And this is how I tried to pass my JSON file through the shiny app to javaScript
Shiny.addCustomMessageHandler("OpenJSON", download);
download() is my javascript function that I want to call in my shinyApp
But unfortunately, this did not work. How can I solve this?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…