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

allow pandoc option setting from saveWidget #81

Closed
hrbrmstr opened this issue Feb 15, 2015 · 7 comments
Closed

allow pandoc option setting from saveWidget #81

hrbrmstr opened this issue Feb 15, 2015 · 7 comments

Comments

@hrbrmstr
Copy link

When trying to prep some examples for a blog post for a new widget I tripped the following error:

Stack space overflow: current size 33632 bytes.
Use `+RTS -Ksize -RTS' to increase it.
Error: pandoc document conversion failed with error 2

It doesn't happen when knitting, though, so this may just be a weird edge case.

library(dplyr)
library(babynames)
library(streamgraph) # devtools::install_github("hrbrmstr/streamgraph")

babynames %>%
  filter(grepl("^Kr", name)) %>%
  group_by(year, name) %>%
  tally(wt=n) %>%
  streamgraph("name", "n", "year", offset="zero", interpolate="linear", width=750, height=310) %>%
  sg_legend(show=TRUE, label="Kr- names: ") -> two

saveWidget(two, "two.html", TRUE)

to reproduce (but a restart of RStudio also cleared the error at least one time for me).

UPDATE

It's pretty reproducible, but even using the extra parameters from the command line (bash, pandoc 1.13.x, os x 10.10.x) didn't solve the issue. I think it requires compiling pandoc to support rts options. ugh.

folks might just want to be careful when making ginormous vis.

@simecek
Copy link

simecek commented Mar 4, 2015

Same issue here for Karl Broman iplot (testjs package). Possible solution seems to be setting selfcontained=FALSE

@ramnathv
Copy link
Owner

ramnathv commented Mar 4, 2015

Thanks for reporting this. We will investigate the issue and figure out potential solutions to fix it.

@kbroman
Copy link
Contributor

kbroman commented Mar 8, 2015

The problem can be related to the size of the data being placed in the widget. With R/qtlcharts, I get this stack space overflow error only for the iplotMScanone function, and only with larger data sets. Here's an example (a subset of this gist):

library(qtl)
library(qtlcharts)
library(htmlwidgets)
data(grav)
grav$pheno <- grav$pheno
grav <- calc.genoprob(grav)
out <- scanone(grav, phe=1:nphe(grav), method="hk")

# this is okay
out_plot1 <- iplotMScanone(out, lodcolumn=1:103)
saveWidget(out_plot1, file="tmp1.html")

# this gives "stack space overflow"
out_plot3 <- iplotMScanone(out, lodcolumn=1:104)
saveWidget(out_plot3, file="tmp3.html")

@ramnathv
Copy link
Owner

ramnathv commented Jul 9, 2015

This should be fixed now. See here

@ramnathv ramnathv closed this as completed Jul 9, 2015
@kbroman
Copy link
Contributor

kbroman commented Jul 9, 2015

Excellent!

@hrbrmstr
Copy link
Author

hrbrmstr commented Jul 9, 2015

agreed! #ty for this!

On Thu, Jul 9, 2015 at 12:10 PM, Karl Broman notifications@github.com
wrote:

Excellent!


Reply to this email directly or view it on GitHub
#81 (comment)
.

@jjallaire
Copy link
Collaborator

BTW I've subsequently discovered that it's best to increase the pandoc
stack size to ~ 512MB for all pandoc operations:

259bc3c

So you shouldn't require fiddling with the arguments manually any longer.

On Thu, Jul 9, 2015 at 3:39 PM, boB Rudis notifications@github.com wrote:

agreed! #ty for this!

On Thu, Jul 9, 2015 at 12:10 PM, Karl Broman notifications@github.com
wrote:

Excellent!


Reply to this email directly or view it on GitHub
<
https://github.com/ramnathv/htmlwidgets/issues/81#issuecomment-120051426>

.


Reply to this email directly or view it on GitHub
#81 (comment)
.

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

5 participants