DiagrammeRsvg
DiagrammeRsvg copied to clipboard
<unknown>:1919791: Invalid asm.js: Function definition doesn't match use
Hi Rich,
Thanks for your wonderful packages DiagrammeR and DiagrammeRsvg packages!
I recently noticed this message when calling export_svg
<unknown>:1919791: Invalid asm.js: Function definition doesn't match use
The same issue seems to be reported here:
https://stackoverflow.com/questions/54699858/diagrammer-export-graph-invalid-asm-js
Hi @nbarrowman,
I'm experiencing the same issue, did you find a solution?
Thank you in advance.
Just in case you're still interested I managed to export the grViz
as an .svg.
The way I did it is not one of the cleanest ways but at least it worked:
- Export and save your grViz as a web page;
- Open it and inspect/copy the html code;
- Go to this website and paste it in the "convert HTML code"; and
- Save it!!!
This works.
apuf<-tempfile() cat(DiagrammeRsvg::export_svg(grViz(apu)),file=apuf)
rsvg::rsvg_pdf(apuf,"koe2.pdf",width=5500,height=5500/sqrt(2)) rsvg::rsvg_png(apuf,"koe2.png",width=5500,height=5500/sqrt(2))
@jkhaukka That works for me too, but it also returns the warning:
<unknown>:1919791: Invalid asm.js: Function definition doesn't match use
I'm using this function (modified from PRISMAstatement
-package). It gives the same warning, but does the job:
grViz_pdf <- function(x, filename = "graph.pdf") {
utils::capture.output({
rsvg::rsvg_pdf(svg = charToRaw(DiagrammeRsvg::export_svg(DiagrammeR::grViz(x))),
file = filename)
})
invisible()
}