Debian Codegraph @

R/handlers.r

raw symbols SCIP
1 prepare_mimebundle_kernel <- function(obj, handle_display_error = log_error) {
2 # we always send text/plain, even if the user removed that from the option!
3 text_bundle <- prepare_mimebundle(obj, 'text/plain', error_handler = handle_display_error)
4 text_repr <- text_bundle$data[['text/plain']]
5
6 # if the text/plain repr returns nothing, we also do
7 if (is.null(text_repr) || nchar(text_repr) == 0L)
8 return(list(data = NULL, metadata = NULL))
9
10 if (getOption('jupyter.rich_display')) {
11 mimetypes <- setdiff(getOption('jupyter.display_mimetypes'), 'text/plain')
12 bundle <- prepare_mimebundle(obj, mimetypes, error_handler = handle_display_error)
13 bundle$data[['text/plain']] <- text_repr
14 bundle
15 } else {
16 text_bundle
17 }
18 }