DiagrammeRsvg icon indicating copy to clipboard operation
DiagrammeRsvg copied to clipboard

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

Open nbarrowman opened this issue 6 years ago • 4 comments

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

nbarrowman avatar Mar 01 '19 00:03 nbarrowman

Hi @nbarrowman,

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

Thank you in advance.

ThomasDelSantoONeill avatar Mar 16 '19 22:03 ThomasDelSantoONeill

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

ThomasDelSantoONeill avatar Mar 16 '19 23:03 ThomasDelSantoONeill

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 avatar Jun 10 '19 13:06 jkhaukka

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

ek-g avatar Jan 08 '20 08:01 ek-g