Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement custom reprs #101

Open
flying-sheep opened this issue Nov 9, 2018 · 0 comments
Open

implement custom reprs #101

flying-sheep opened this issue Nov 9, 2018 · 0 comments

Comments

@flying-sheep
Copy link
Member

flying-sheep commented Nov 9, 2018

one example would be plotly. the following is vastly faster than rendering an htmlwidget

ggplotly <- function(p = ggplot2::last_plot(), width = NULL, height = NULL, tooltip = "all", dynamicTicks = FALSE, layerData = 1, originalData = TRUE, source = "A", ...) {
    ggp <- plotly::ggplotly(p, width, height, tooltip, dynamicTicks, layerData, originalData, source, ...)
    tree <- jsonlite::fromJSON(plotly::plotly_json(ggp))  # plotly_json does the right unboxing and so on
    IRdisplay::publish_mimebundle(list('application/vnd.plotly.v1+json' = tree))
}

see also IRkernel/IRkernel#587

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant