Page Index Toggle Pages: 1 [2] 3  Send TopicPrint
Very Hot Topic (More than 25 Replies) diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) fails (Read 18291 times)
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) fails
Reply #15 - Feb 20th, 2017 at 2:54pm
Print Post  
Quote:
But still can't figure out why the error is happening on calling diagram.saveToString


Are you still getting same error after renaming your style() function, or just wondering why it was happening before that? If you have a custom link.style() method in your links, it will confuse our writeStyle method called when saving to XML, because it looks for some appearance attributes in link.style objects.
  
Back to top
 
IP Logged
 
Gravity
Junior Member
**
Offline


I Love MindFusion!

Posts: 52
Joined: Sep 21st, 2016
Re: diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) fails
Reply #16 - Feb 21st, 2017 at 9:17am
Print Post  
Well, it is definitely an error is in instantiating custom diagram link, since custom class has no properties or style function in it, only inheritance  and that method overrid (DrawLinksBehavior.prototype.createLink = function (origin, point) ), so it seems, i need to specify some parameters or god know what. Is there a way to figure out that?
What this error means "Key type not supported." ?
  
Back to top
 
IP Logged
 
Gravity
Junior Member
**
Offline


I Love MindFusion!

Posts: 52
Joined: Sep 21st, 2016
Re: diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) fails
Reply #17 - Feb 21st, 2017 at 9:19am
Print Post  
yeah you are right, actually when removed it works...sort of...

  
Back to top
 
IP Logged
 
Gravity
Junior Member
**
Offline


I Love MindFusion!

Posts: 52
Joined: Sep 21st, 2016
Re: diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) fails
Reply #18 - Feb 21st, 2017 at 9:32am
Print Post  
And the source of it was this thing:

this liner in custom diagram link (backend) is causing an issue:

this.Shape = LinkShape.Cascading;

is it something wrong with that liner?

an error:
An exception of type 'System.Reflection.TargetInvocationException' occurred in MindFusion.Diagramming.DLL but was not handled in user code
  
Back to top
 
IP Logged
 
Gravity
Junior Member
**
Offline


I Love MindFusion!

Posts: 52
Joined: Sep 21st, 2016
Re: diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) fails
Reply #19 - Feb 21st, 2017 at 12:27pm
Print Post  
Ok, nevermind. Thanks for your help Slavcho, you THE MAN!
  
Back to top
 
IP Logged
 
friedel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 31
Joined: Mar 3rd, 2017
Re: diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) fails
Reply #20 - Mar 8th, 2017 at 2:08pm
Print Post  
Hi. I noticed a problem - diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) does not save <GridPointSize>1</GridPointSize> node. Before calling this method, I have checked that diagram.getGridPointSize() returns valid value.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) fails
Reply #21 - Mar 9th, 2017 at 11:16am
Print Post  
Hi,

This build adds it to both JSON and XML serializers -
https://mindfusion.eu/_beta/jsdiag_gridpointsize.zip

Regards,
Slavcho
  
Back to top
 
IP Logged
 
friedel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 31
Joined: Mar 3rd, 2017
Re: diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) fails
Reply #22 - Mar 9th, 2017 at 12:35pm
Print Post  
Hi. Thanks! Well, I faced another problem with diagram xml saving. After saving, <GridColor> node has value #00000000. After loading this diagram grid disappears. I edited xml and changed <GridColor> value to #1B000000 (also black) and grid became visible.

I tried it with other colors and made the conclusion, that if first two digits is 00, after loading xml, then grid is not visible.

Maybe there are some problems with saving or processing AARRGGBB color codes?
  
Back to top
 
IP Logged
 
friedel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 31
Joined: Mar 3rd, 2017
Re: diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) fails
Reply #23 - Mar 9th, 2017 at 12:43pm
Print Post  
As I understand, the problem is, that color should not be saved with two leading zeros, it makes grid transparent
  
Back to top
 
IP Logged
 
friedel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 31
Joined: Mar 3rd, 2017
Re: diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) fails
Reply #24 - Mar 9th, 2017 at 1:17pm
Print Post  
Another problem with .saveToString() is that it doesn not save <AdjustmentHandlesSize>8</AdjustmentHandlesSize> node (inside <Properties> node)

Without it, adjusment handles is not visible

  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) fails
Reply #25 - Mar 9th, 2017 at 1:19pm
Print Post  
Seeing that #1B000000 value, do you work on same project as Vitaly here ?
http://mindfusion.eu/Forum/YaBB.pl?num=1487930193

You will have to use the new assemblies from zip file from end of that thread, they implement some fixes for saving colors with semi-transparency. If you don't use ASP.NET version but stand-alone JavaScript library, make sure you replace the common.js file with one from jsdiag_gridpointsize.zip. If that does not work, please let me know the original color value string you are assigning to GridColor.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
friedel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 31
Joined: Mar 3rd, 2017
Re: diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) fails
Reply #26 - Mar 9th, 2017 at 1:24pm
Print Post  
Ok. I will try it. Vitaliy is no longer works on this project.
  
Back to top
 
IP Logged
 
friedel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 31
Joined: Mar 3rd, 2017
Re: diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) fails
Reply #27 - Mar 9th, 2017 at 1:33pm
Print Post  
Where I can find jsdiag_gridpointsize.zip? https://mindfusion.eu/_beta/netdiag_xmlalpha.zip contains only dlls
  
Back to top
 
IP Logged
 
friedel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 31
Joined: Mar 3rd, 2017
Re: diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) fails
Reply #28 - Mar 9th, 2017 at 1:44pm
Print Post  
Oh. I have found it. Sorry.
  
Back to top
 
IP Logged
 
friedel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 31
Joined: Mar 3rd, 2017
Re: diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) fails
Reply #29 - Mar 9th, 2017 at 2:10pm
Print Post  
Updating dlls solved problem with grid color, but not solved problem with adjustment handles.

http://mindfusion.eu/Forum/YaBB.pl?num=1486717638/24#24
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 
Send TopicPrint