- Welcome, Guest. Please Login or Register
MindFusion  
  Version 2 of our Xamarin Calendar component adds Resource view and support for Universal Windows Platform. Now beta testing UWP version of Xamarin Diagram.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Page Index Toggle Pages: 1 Send Topic Print  
Additional attributes in SVG export
Read 202 times

Sil r   Offline
YaBB Newbies
*
Posts: 2
I Love MindFusion!


   
     
 
Additional attributes in SVG export
Jul 18th, 2017 at 11:04am
 
Is it possible to export additional attributes to SVG? I'd like to add an Id attribute but I don't seem to find a way to do it.

I tried to set the ShapeNode.Id and ShapeNode.Tag but neither of them show up in the SVG output.

Preferably I would like to export as many custom attributes as I want.
 
 
 
IP Logged    
 
     

Slavcho   Online
God Member
*****
Posts: 1245
Gender: male
tech.support


   
     
 
Re: Additional attributes in SVG export
Reply #1 - Jul 18th, 2017 at 11:55am
 
Hi,

Unfortunately that's not supported at this time. As a work-around you could identify the node paths using hyperlinks and add your attributes using XML API.

E.g. set ShapeNode.Hyperlink="id" and  exporter.HyperLinkStyle = HyperLinkStyle.Shape. Then using xmldoc.SelectSingleNode(xpath) you can find the ShapeNode's <path> surrounded by an a element with href set to your id. You could remove the <a> element, pulling the <path> one level up and assigning attributes to it.

Regards,
Slavcho
 
 
 
IP Logged    
 
     

Sil r   Offline
YaBB Newbies
*
Posts: 2
I Love MindFusion!


   
     
 
Re: Additional attributes in SVG export
Reply #2 - Jul 19th, 2017 at 2:16pm
 
Hi Slavcho,

The workaround works but only for the shape OR the text element, not for both since the exporter in only generating a link for one of the two.

Can the option HyperLinkStyle.ShapeAndText be added? Or even better, allow a list of custom attributes be added to the SVG export?

Now the SVG export is nice but not customizable at all which might be a showstopper for me.
 
 
 
IP Logged    
 
     

Slavcho   Online
God Member
*****
Posts: 1245
Gender: male
tech.support


   
     
 
Re: Additional attributes in SVG export
Reply #3 - Jul 19th, 2017 at 4:21pm
 
Hi Sil,

We'll have it in mind for next release. At this time you can find the node's text element right after the <a ...><path /></a> for the shape, you could find it along with path's anchor using something like /following-sibling::*[1][self:text] in the XPath expression.

Regards,
Slavcho
 
 
 
IP Logged    
 
     
Page Index Toggle Pages: 1 Send Topic Print