Skip to content

Commit c784efc

Browse files
committed
v0.6.2: Allow using metadata in display
e.g.: display(ggplot(...), width = 600)
1 parent 9390150 commit c784efc

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Title: 'Jupyter' Display Machinery
33
Description:
44
An interface to the rich display capabilities of 'Jupyter' front-ends (e.g. 'Jupyter Notebook') <https://jupyter.org>.
55
Designed to be used from a running 'IRkernel' session <https://irkernel.github.io>.
6-
Version: 0.6.1.9000
6+
Version: 0.6.2
77
Authors@R: c(
88
person('Thomas', 'Kluyver', role = c('aut', 'cph'), email = '[email protected]'),
99
person('Philipp', 'Angerer', role = c('aut', 'cph', 'cre'), email = '[email protected]'),

R/display.r

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ publish_mimebundle <- function(data, metadata = NULL) {
2626
#'
2727
#' @param obj The object to create representations for
2828
#' @param mimetypes Mimetypes to create reprs for. The defaults are defined by the option \code{jupyter.display_mimetypes}. (see: \link{IRdisplay-options})
29-
#' @param metadata Metadata to attach to the result (can be expanded by additional metadata)
29+
#' @param metadata,... Metadata to attach to the result (can be expanded by additional metadata)
3030
#' @param error_handler Function used when errors in individual reprs occur
3131
#'
3232
#' @return \code{prepare_mimebundle} returns a list with items corresponding to the parameters of \code{\link{publish_mimebundle}} (\code{data} and \code{metadata})
@@ -41,8 +41,13 @@ publish_mimebundle <- function(data, metadata = NULL) {
4141
#'
4242
#' @name display
4343
#' @export
44-
display <- function(obj) {
45-
bundle <- prepare_mimebundle(obj)
44+
display <- function(
45+
obj,
46+
...,
47+
mimetypes = getOption('jupyter.display_mimetypes'),
48+
error_handler = stop
49+
) {
50+
bundle <- prepare_mimebundle(obj, mimetypes, list(...), error_handler)
4651
publish_mimebundle(bundle$data, bundle$metadata)
4752
}
4853

man/display.Rd

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)