Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Need add SVG image in diagram node (Read 1827 times)
Shafi
Full Member
***
Offline


I Love MindFusion!

Posts: 109
Joined: Nov 8th, 2016
Need add SVG image in diagram node
Nov 23rd, 2017 at 8:24am
Print Post  
Is there any api which will accept SVG image inside diagram Node?
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Need add SVG image in diagram node
Reply #1 - Nov 23rd, 2017 at 10:14am
Print Post  
Hi,

You can use SVG images like other image types like PNG, JPG, etc, like shown here: https://mindfusion.eu/Forum/YaBB.pl?num=1511255550/1#1.

Please note that if you use a base64 encoded image, the prefix is different that in the post above - you should use 'data:image/svg+xml;base64,' and then the base64 encoded string itself.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Shafi
Full Member
***
Offline


I Love MindFusion!

Posts: 109
Joined: Nov 8th, 2016
Re: Need add SVG image in diagram node
Reply #2 - Nov 23rd, 2017 at 11:02am
Print Post  
Thanks for reply
One last question if need add a css class like below in our diagram node. Can we use this?
As i have used it in diagram it does not the image.

Code (Javascript)
Select All
icon-system {
    background-image: url('@{images}/indicatorSystemNew16.svg');
}
 

  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Need add SVG image in diagram node
Reply #3 - Nov 23rd, 2017 at 11:36am
Print Post  
Hi,

You can't use CSS to style individual elements in the diagram, as it uses the HTML5 Canvas API for drawing. If you wish to show images inside nodes, you should use one of the methods discussed above.

If you wish to create something like a template for your nodes, you can also look into the CompositeNode class - how it's used is shown in Tutorial4 sample from the JsDiagram package.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint