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

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

Open
nbarrowman opened this issue Mar 1, 2019 · 4 comments

Comments

@nbarrowman
Copy link

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
Copy link

Hi @nbarrowman,

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

Thank you in advance.

@ThomasDelSantoONeill
Copy link

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

@jkhaukka
Copy link

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
Copy link

ek-g commented Jan 8, 2020

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

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

4 participants