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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Adding a new SVG node to diagram corrupts an existing SVG node

Thread ID:

Created:

Updated:

Platform:

Replies:

149969 Dec 16,2019 03:13 PM UTC Dec 18,2019 07:25 AM UTC Angular - EJ 2 5
loading
Tags: Diagram
Mithun
Asked On December 16, 2019 03:15 PM UTC

Hello Syncfusion Team,

I'm using the latest version of diagram component in my app:"@syncfusion/ej2-angular-diagrams": "^17.3.34",

I notice that sometimes, adding a new SVG node to the diagram corrupts an earlier, existing SVG node.

I have prepared a stackblitz demo for this:

1: Here is the original node (notice the color):https://stackblitz.com/edit/unexpected-color-change-part1



2: Here is what the original node looks like after I add a new SVG node to canvas:https://stackblitz.com/edit/unexpected-color-change-part2



Could this be because both SVGs are using the same CSS class names (.st0, .st1 etc).

Please let me know if any additional logs/details are needed from my end to investigate this.

Thanks,
Mithun

Shyam G [Syncfusion]
Replied On December 17, 2019 05:36 AM UTC

Hi Mithun, 

Yes, the problem is defining same class name for multiple SVG content. The node style is overriding with the other node. We have changed the class name in the SVG content and provided a modified sample below. 


Regards, 
Shyam G 


Mithun
Replied On December 17, 2019 07:53 AM UTC

Thanks Shyam for confirming!

We were planning to use a file picker/uploader to allow users to upload their own SVG files onto the diagram component. 

However this name collision issue with CSS classes seems problematic in that regard. 

Any ideas?

Our app may have to restrict the custom uploads to SVGs or JPEGs only since we cannot control (or easily manipulate) the contents of arbitrary SVG files.

Thanks,
Mithun 

Shyam G [Syncfusion]
Replied On December 18, 2019 05:53 AM UTC

Hi Mithun, 

We should define a different class name for each SVG content and it is mandatory. If not, the style will be overridden for each SVG content by default. 

Regards, 
Shyam G 


Mithun
Replied On December 18, 2019 07:20 AM UTC

Thanks Shyam!

Shyam G [Syncfusion]
Replied On December 18, 2019 07:25 AM UTC

Hi Mithun, 
Thanks for your update. 
Regards, 
Shyam G 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon