swimlane/ngx-graph

Export a graph to png or base64

bastientardits opened this issue · 2 comments

Hello and thank you for this much useful package.
I'm currently building an angularservice for my working place's solution. This package was already installed before my arrival, which could explain some of my confusion.
I would like to know if a functionnality allowing the user to save a graph as a png or convert it to base64 exists in this package? I tried some things with html2canvas package for example, but I can't make anything work.
I'm creating documentation in the form of an html file that I export and download. I would like to document a graph ,and so, to add a visual representation of that graph in the html file, either as an image or a base64 string for .
If you have any ideas or recommandations, I would be very grateful
Thank you and have a good day

Hi,

maybe you've found this already and maybe it doesn't fit your needs but there's this project which has not been maintained anymore for the last 3 years but it still does the basic work:

https://github.com/exupero/saveSvgAsPng

Typings: https://github.com/ksholla20/save-svg-as-png-typings

Hi @arbertrary thanks for your answer and sorry for the late response. I actually figured out the svg does fit in the html file perfectly and there was no need to convert it.
Have a good day