How to transform svg into geometric path

I have a question , how to transform SVG’s diagram into gojs’s geometric path.please!!
Because I have many graphics generated by SVG, but I don’t know how to convert between SVG’s path and gojs’s geometric path.

Please read GoJS Geometry Path Strings -- Northwoods Software.

I know there is an introduction about it. I think you should say this method.

go.Geometry.fillPath(“M0 0 L20 20 L20 0”);

But the fillPath premise is that there is a path string.However,SVG is the form of XML, first of all, to convert SVG into a path string. My idea is to use link in the way of transformation, and then through the fillPath to achieve, is that so?

Yes, you’ll need to walk the SVG DOM to find the one particular geometry path string that you want to use in a GoJS Shape.


hello ,If I have other tags except path in my SVG diagram, how do I transform them by parseFromString?

Each of those correspond to a Shape with a particular Geometry. Please read Geometry | GoJS API and build the appropriate Geometry for each one.