almende / vis

⚠️ This project is not maintained anymore! Please go to https://github.com/visjs
7.85k stars 1.48k forks source link

Is it possible the vis to use a library like canvas2svg.js to allow exports SVG? #4124

Closed fmassicano closed 5 years ago

fmassicano commented 6 years ago

I know that use an external library is bad but some users want to show their visualizations in a poster or printed in high definitions in order to share your work. The vis library is really amazing in build network-charts but the property of canvas doesn't allow share that images in a high definition. I am thinking in fork the vis and use the library canvas2svg.js to help export the images in SVG. What I saw so far, was that the work to do that is only create an object canvas2Svg that imitate the context of canvas and this library turns the Canvas into SVG using javascript.
Of course, this need be tested but would be a great improvement.
And I have a question too. Why was chosen canvas and not for example d3.js?

alexsandro-xpt commented 5 years ago

Good question, I'm interested too.

mojoaxel commented 5 years ago

I am thinking in fork the vis and use the library canvas2svg.js to help export the images in SVG

Good luck! I would be interested if you could pull that off.

Why was chosen canvas and not for example d3.js?

The problem with SVG is performance. You could not handle big network charts maybe even with physics in SVG. I think that this is why the developers from almende choose to use canvas over SVG - at least for the network chart.

alexsandro-xpt commented 5 years ago

And about Timeline Chart?

mojoaxel commented 5 years ago

And about Timeline Chart?

The Timeline-Chart is renderd as DOM elements. Also no SVG, but it would be easy to create e.g. a PDF from that.