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

Add support for plotly objects, and possibly htmlwidget objects? #276

Open
happyshows opened this issue Sep 15, 2016 · 6 comments
Open

Add support for plotly objects, and possibly htmlwidget objects? #276

happyshows opened this issue Sep 15, 2016 · 6 comments

Comments

@happyshows
Copy link

Error in x[[i]] : subscript out of bounds
In addition: Warning message:
In pander.default(x$result) :
No pander.method for "plotly", reverting to default.No pander.method for "htmlwidget", reverting to default.

@daroczig
Copy link
Member

Thanks for this report. Can you please provide some details on the use case? I mean why do you run a plotly object through pander? Or are you using Pandoc.brew?

@happyshows
Copy link
Author

Hi,

I was attempting to use pander to dynamically create markdown files that allow me to embed plotly visualization in there, so that reader will have some flexibility in the generated html file to do filtering, regrouping.

@daroczig
Copy link
Member

Thanks a lot, makes a lot of sense, will try to get some time to add support for it soon.

@timwoelfle
Copy link

timwoelfle commented Mar 29, 2021

Any news or workarounds on this? I love using pander to dynamically create documents with static ggplot figures and it would be awesome to be able to do the same with plotly. I'm using R 4.0.3 and pander 0.6.3 and I still get the same error reported by the host. Here's the code I'm using:

evalsOptions("width", 900)
evalsOptions("height", 600)
myReport <- Pandoc$new(title="Plots")

for (name in names(plots)) {
  myReport$add.paragraph(paste0("## ", name))
  myReport$add(plots[[name]])
}

myReport$add.paragraph("") # hack, otherwise there is a figure in the TOC

myReport

@daroczig
Copy link
Member

Sorry for not making this happen sooner. @timwoelfle, can you please edit your above example to make it reproducible? Eg creating the list of plots. Please feel free to keep it to a super simple minimal example.

@timwoelfle
Copy link

Attached is a reproducible example! The ggplot objects work, but the plotly objects don't. You have to run the notebook in RStudio (e.g. with "Run all") and save it as a notebook, looking at the auto-generated test.nb.html (also attached, knitting won't work).

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

No branches or pull requests

3 participants