Full support for SVG

For our application I want to render layouts to SVG, rather than to the HTML5 canvas. We’ll still want to support interaction, so in addition to replacing the canvas drawing routines with SVG equivalents, I suppose we’d need to re-wire a lot of the event management functionality.

If we purchased a source code license to Go-JS, how feasible might that re-write be? Or is it on your roadmap anyway?

Thanks for any info


It’s on our todo list to render snapshots (aka Diagram.makeImage) to various formats, including SVG.

Why do you see the need for interactivity using SVG?

It’s more that we see the need for all the great GoJS interactivity but we don’t like canvas.

We want to be able to draw really delicious pin-sharp digraphs that will wow potential users. The quality we can get with SVG is distinctly better than anything we’ve seen with canvas, and with SVG it is easy to add extra polish using stylesheets, gradients, filters and animations.

I asked about the source code because I was hoping it would be reasonably straightforward for us to add SVG rendering to GoJS, because it is just translating from GoDiagram geometry conventions to SVG’s. However, we’d still want to leverage the dynamic layout and edge routing features in GoJS and that’s where I thought we might face much more of a challenge, because we’d have to connect events on all our hand-rolled SVG entities back to your layout management code.

I mentioned your future plans because SVG is having something of a comeback nowadays, and presumably you already have much of the equivalent functionality in place in GoXam etc anyway.

Thanks for replying so quickly over the weekend.


We’ll take a look at what work would be involved.

Any news?

Sorry, I never did update this topic.
Actually we are about to start doing some SVG work next week, for example to better support importing SVG for defining nodes. However we do not have any plans to do interactive rendering using SVG instead of Canvas – that is significantly different work. So far you are the only person to request such a feature.

I think that work would require significant effort. The internal design is really oriented around rendering by (re)drawing, not rendering by updating an existing scene graph. Although I suppose it might not be too hard to do a minimal demonstration.

Do you have any particular SVG features that you want to see implemented in GoJS or in a GoJS sample?