Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
linters: with_defaults(
line_length_linter(100)
)
exclusions: list(
"inst/examples/01-hello/app.R"
)
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
reactlog 1.0.0.9000
==========================

- Add `reactlog_enable()`+`reactlog_disable()` that replace the need to explicitly set R options (#61)
- Added a shiny module to inline the current `reactlog`. See `?reactlog_module_ui` for an example (#66)
- Added `reactlog_enable()` and `reactlog_disable()` which replace the need to explicitly set R options (#61)
- Use log entry for status bar instead of a final graph (#67)
- Allow reactlog to handle isolate calls in a non-reactive context (#68)


reactlog 1.0.0
Expand Down
10 changes: 9 additions & 1 deletion R/shinyModule.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ reactlog_module_server <- function(
# trigger render refresh
input$refresh

test_mode_txt <-
if (isTRUE(getOption("shiny.testmode"))) {
"&test=1"
} else {
""
}

random_id <- ns(paste0(
"reactlog_iframe_",
as.hexmode(floor(stats::runif(1, 1, 16^7)))
Expand All @@ -104,7 +111,8 @@ reactlog_module_server <- function(
(function() {
var src =
'reactlog?w=' + window.escape(window.Shiny.shinyapp.config.workerId) +
'&s=' + window.escape(window.Shiny.shinyapp.config.sessionId);
'&s=' + window.escape(window.Shiny.shinyapp.config.sessionId) + '",
test_mode_txt, "';
$('#", random_id, "').attr('src', src);
})()
")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ui <- fluidPage(
numericInput(inputId = "obs", label = "Number of observations to view:", value = 10)
),
mainPanel(
h3(textOutput("caption", container = span)),
h3(textOutput("caption_out", container = span)),
verbatimTextOutput("summary"),
tableOutput("view")
)
Expand All @@ -27,7 +27,7 @@ server <- function(input, output) {
datasetInput <- reactive({
switch(input$dataset, "rock" = rock, "pressure" = pressure, "cars" = cars)
})
output$caption <- renderText({ input$caption })
output$caption_out <- renderText({ input$caption })
output$summary <- renderPrint({ summary(datasetInput()) })
output$view <- renderTable({ head(datasetInput(), n = input$obs) })

Expand Down
Loading