Open ghost opened 3 years ago
Dang. Attributes are lost when saving to regular json. 😞
For now...
### add elements to reactlog
library(shiny)
library(reactlog)
# tell shiny to log all reactivity
reactlog_enable()
reactlogReset()
# run a shiny app
app <- system.file("examples/01_hello", package = "shiny")
runApp(app)
###
# save to disk
writeLines(jsonlite::serializeJSON(shiny::reactlog()), file = "test2.json")
# ---------
# restore reactlog to an object
my_reactlog <- jsonlite::unserializeJSON(readLines("test2.json")[1])
# view reactlog object
reactlog::reactlog_show(my_reactlog)
Can we save the html directly without storing to the json ? I can see in the Readme, that one of the reactlog html has been shown. I also want to store the html for later use how to do that ?
Your browser can store the webpage as a "web archive". The html is not a standalone file. For the readme, I have to copy over the assets to make the images / css / js work.
(For context, I am aware that it would be very nice if it was an htmlwidget to be able to easily include it in other locations.)
Any updates here? Would it be possible to include a reactlog output in a quarto document?
How to download the intreactive Reactlog
I want to download or store the html file produced by reactlog so that i can see it later even if the program is closed or the reactlog is reset. There is a reactlog_write() function that puts it into a json file but how to use that json file again to create or generate the reactlog.
How to use this file test1.json to produce the interative reactlog again ?