publish_mimebundle: Display data by mimetype, with optional alternative...

Description Usage Arguments Functions See Also Examples

View source: R/display.r

Description

publish_mimebundle calls the function stored as option value of jupyter.base_display_func, clear_output calls the value of option jupyter.clear_output_func. (see: IRdisplay-options)

Usage

1
2
3

Arguments

data

A named list mapping mimetypes to content (character or raw vectors)

metadata

A named list mapping mimetypes to named lists of metadata, e.g. list('image/png' = list(width = 5))

wait

Wait to clear the output until new output is available. Default TRUE. If FALSE, clears the existing output immediately before the new output is displayed.

Functions

See Also

prepare_mimebundle

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: ## (Run inside of an IRkernel)
publish_mimebundle(list('text/html' = '<h1>Hi!</h1>'))
publish_mimebundle(
  list('image/svg+xml' = '<svg xmlns="http://www.w3.org/2000/svg"><circle r="100"/></svg>'),
  list('image/svg+xml' = list(width = 100, height = 100)))

for (i in 1:5) {
  Sys.sleep(.2)    # simulate work
  clear_output()   # clear previous iteration
  cat(i)           # alternative: IRdisplay::display(i)
  flush.console()  # make output available
}
## End(Not run)

IRdisplay documentation built on Jan. 4, 2022, 5:08 p.m.