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
close icon

DiagramComponent "corrupts" the SVG/NativeModel

Hello SyncFusion Team,

I'm using the @syncfusion/ej2-angular-diagrams control in my Angular app.

I'm loading a NativeModel node from an SVG file.

However the node looks different from the source SVG (I've tried it in multiple browsers: chrome, firefox, edge etc). 

Is this a known issue? Any workarounds? 

PS: I have set up a stackblitz repro: https://stackblitz.com/edit/diagram-rendering


Actual SVGDiagramComponent renders it as (notice the left arrow)




3 Replies

SG Shyam G Syncfusion Team October 25, 2019 07:24 AM UTC

Hi Mithun, 
 
The last points in a polygon have been provided in a new line in your sample (see Example of Actual Code). The new line points have created unsuitable SVG. We have now solved it by removing the new line spaces (see Example Modified code). Refer to the example code and sample below. 
  
Code example: 
Actual 
<polygon fill="#FFFFFF" points="10.685,33.515 20.018,33.515 16.766,30.263 25.447,21.582 22.618,18.753 13.937,27.434  
10.685,24.182 " /> 
 
Modified 
 
<polygon fill="#FFFFFF" points="10.685,33.515 20.018,33.515 16.766,30.263 25.447,21.582 22.618,18.753 13.937,27.434 10.685,24.182 " /> 
 
 
 
Regards, 
Shyam G 



MI Mithun October 27, 2019 01:25 AM UTC

Thank you. 

Is there a recommended linter/validator for SVG files? Preferably something that be run on the command line (i.e. part of the build process).

Thanks,
Mithun



SG Shyam G Syncfusion Team October 28, 2019 09:51 AM UTC

Hi Mithun, 
 
You do not need the SVG linter / validator to validate your SVG. The SVG tag can be removed in your SVG alone. If you are facing any problems in SVG, you can share them with us so we can solve them. Also, please refer to the reference below if you need to validate the SVG. 
 
 
Regards, 
Shyam G 


Loader.
Live Chat Icon For mobile
Up arrow icon