Can GoJs create Svg Diagrams?

It seems like goJS uses Canvas to render the diagrams. Ideally we’d like to unit test our diagrams, and therefore write tests to count the number of nodes rendered in the diagram. In canvas we lose ability to see the details of the diagram in the DOM. Is there a way to have goJs output SvgDiagrams instead of canvas?

i’ve read this:
http://gojs.net/latest/intro/makingSVG.html
but I’m confused. Does is makeSvg() intended to be used to create a svg representation of a canvas diagram for saving or exporting purposes only? Or can you have it create the main diagram as an svg?

Thanks,
Chris

Diagram.makeSvg is for rendering an “image” in SVG, for saving or exporting.

If you want to know how many nodes there are in a diagram: myDiagram.nodes.count. Same goes for links: myDiagram.links.count.

If you are testing, you could use the SVG produced by Diagram.makeSvg to examine features of the individual nodes. Consider using the elementFinished option to actually do the test, or to modify the generated SVG to make it easier to test.