rich-iannone / DiagrammeRsvg

A utility package for providing SVG export to DiagrammeR graph diagrams
Other
29 stars 1 forks source link

<unknown>:1919791: Invalid asm.js: Function definition doesn't match use #7

Open nbarrowman opened 5 years ago

nbarrowman commented 5 years ago

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

ThomasDelSantoONeill commented 5 years ago

Hi @nbarrowman,

I'm experiencing the same issue, did you find a solution?

Thank you in advance.

ThomasDelSantoONeill commented 5 years ago

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:

jkhaukka commented 5 years ago

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))

ek-g commented 4 years ago

@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()
}