kaluginserg / cytoscape-node-html-label

Labels for cytoscape node. Demo:
https://kaluginserg.github.io/cytoscape-node-html-label/
MIT License
102 stars 43 forks source link

NodeHTML content lost when exporting graph to png #36

Open invaders-xx opened 4 years ago

invaders-xx commented 4 years ago

When I export my graph which is using this plugin to display information inside the node, I loose all those information when exporting the graph to png.

Is there any option to get those information ?

Many thanks in advance.

David

sagarrabadiya commented 4 years ago

same problem

jeppebm commented 4 years ago

I'm imagining that this problem is hard to solve, since going from Canvas to PNG is not the same as going from HTML to PNG.

But i'm in the same boat, would absolutely love that feature.

gamespark commented 3 years ago

I tried html-to-dom to export html nodes to imageA (with transparent background), and trim the image as cy trims it's export imageB too. Then merge imageA to imageB using canvas. Finally export image from canvas. It works pretty great.

jeppebm commented 3 years ago

I've been using html2canvas, which is really straight forward. Just give it the canvas container and it includes both canvas and any html contained in/above it, like the node labels.

https://html2canvas.hertzen.com/

gamespark commented 3 years ago

Thanks, I just try it, really really simple. . Although there are some problems to resolve. Like non display area export, if zoom in is not allowed and the chart is very big. Will keep researching it.