We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Getting SVG from shape/connector model

Greetings,

I am trying to implement my own symbol palette component and trying to figure out how to map each shape and connector model to an SVG to render in the palette as the items preview. So far I found that calling ej.datavisualization.Diagram.FlowShape(options) and ej.datavisualization.Diagram.ArrowShape(options) adds pathData property which I can use in the SVG's path element's d property, and this works for some of the Flow and Arrow shapes, but not all, and it doesn't work for basic, swimlane and connectors. Is there a function or a set of functions that returns an SVG for a model that could work for all the shapes?

Thanks.

1 Reply

SG Shyam G Syncfusion Team November 24, 2016 12:49 PM UTC

Hi Gabriel, 

The flowShapes is an built-in shapes. So you can get an path and append it in the SVG. For an other shape(basic shape), we need to define it in code behind and can access the SVG element in DOM. We suspect that you need to render the SVG element in the palette. if yes, you can use our native node to achieve your requirement. Please refer to the help documentation below in which we have shown to render the native node. 


Regards, 
Shyam G 


Loader.
Up arrow icon