@@ -374,10 +374,10 @@ select_decorators <- function(decorators, scope) {
374374# ' @importFrom utils modifyList
375375# ' @keywords internal
376376set_chunk_attrs <- function (teal_card ,
377- attributes ,
378- n = 1 ,
379- inner_classes = NULL ,
380- quiet = FALSE ) {
377+ attributes ,
378+ n = 1 ,
379+ inner_classes = NULL ,
380+ quiet = FALSE ) {
381381 checkmate :: assert_class(teal_card , " teal_card" )
382382 checkmate :: assert_list(attributes , names = " unique" )
383383 checkmate :: assert_int(n , lower = 1 )
@@ -417,29 +417,29 @@ set_chunk_attrs <- function(teal_card,
417417}
418418
419419# ' Create a reactive that sets plot dimensions on a teal_card
420- # '
420+ # '
421421# ' This is a convenience function that creates a reactive expression that
422422# ' automatically sets the dev.width and dev.height attributes on the last
423423# ' chunk outputs of a teal_card based on plot dimensions from a plot widget.
424- # '
424+ # '
425425# ' @param pws (`plot_widget`) plot widget that provides dimensions via `dim()` method
426426# ' @param decorated_output_q (`reactive`) reactive expression that returns a teal_card
427427# ' @param inner_classes (`character`) classes within `chunk_output` that should be modified.
428428# ' This can be used to only change `recordedplot`, `ggplot2` or other type of objects.
429- # '
429+ # '
430430# ' @return A reactive expression that returns the teal_card with updated dimensions
431- # '
431+ # '
432432# ' @keywords internal
433433set_chunk_dims <- function (pws , decorated_output_q , inner_classes = NULL ) {
434434 checkmate :: assert_class(pws , " plot_widget" )
435435 checkmate :: assert_class(decorated_output_q , " reactive" )
436436 checkmate :: assert_character(inner_classes , null.ok = TRUE )
437-
437+
438438 reactive({
439439 dims <- req(pws $ dim())
440440 q <- req(decorated_output_q())
441441 teal.reporter :: teal_card(q ) <- set_chunkt_attrs(
442- teal.reporter :: teal_card(q ),
442+ teal.reporter :: teal_card(q ),
443443 list (dev.width = dims [[1 ]], dev.height = dims [[2 ]]),
444444 inner_classes = inner_classes
445445 )
0 commit comments