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


I Love MindFusion!

Posts: 31
Joined: Mar 3rd, 2017
Re: diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml) fails
Reply #30 - Mar 10th, 2017 at 12:34pm
Print Post  
Also I found out that "diagram.saveToString(MindFusion.Diagramming.SaveToStringFormat.Xml);" is not setting "RouteLinks" value to xml.

Xml doesn't have "<RouteLinks>True</RouteLinks>" in properties section.

Therefore when I create new diagram, links between nodes are going around other nodes. But when I load saved diagram from Xml, new links are crossing nodes like this:

  
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 #31 - Mar 10th, 2017 at 2:27pm
Print Post  
Yes, we left out many non-essential diagram properties from initial xml implementation, we'll add them all for upcoming release in a couple of weeks.

Regards,
Slavcho
Mindfusion
  
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 #32 - Mar 17th, 2017 at 10:11am
Print Post  
This build now saves all diagram properties in XML -
https://mindfusion.eu/_beta/jsdiag_diagramxml.zip

What remains is the swimlane grid, we'll complete XML serialization for it next week.

Regards,
Slavcho
  
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 #33 - Mar 27th, 2017 at 8:18am
Print Post  
This build also serializes lane grid to XML, we believe that covers all diagram properties now -
https://mindfusion.eu/_beta/jsdiag_diagramxml.zip

Regards,
Slavcho
Mindfusion
  
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 #34 - Mar 28th, 2017 at 6:35am
Print Post  
Hi. It solved this problem (http://mindfusion.eu/Forum/YaBB.pl?num=1489054543/9#9)

But this problem with grid is still there (I use AutoResize="AllDirections")
http://i65.tinypic.com/28h26ue.jpg

I understand that it may be not related to saveToString method, just saying.
  
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 #35 - Mar 28th, 2017 at 11:14am
Print Post  
Please attach saved Json or Xml showing that.
  
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 #36 - Mar 29th, 2017 at 5:37am
Print Post  
After diagram saving, grid becomes normal. This problems occurs on diagram autoresize (moving shape node to left edge)
  

diagram.zip ( 2 KB | 275 Downloads )
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 #37 - Mar 29th, 2017 at 8:13am
Print Post  
The AutoResize property is disabled in this xml. We cannot see problem if we enable it and drag node around. By auto resize do you mean setting new diagram.Bounds yourself from nodeModified event handler? Since you are using custom nodes, maybe check if there aren't some errors shown in console coming from custom drawing or interaction code. Such errors might stop subsequent code from executing, including auto-resize one.
  
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 #38 - Mar 29th, 2017 at 8:54am
Print Post  
It's weird, that autoresize property is disabled. Because in .aspx I have AutoResize="AllDirections". As I understand setting AutoResize="AllDirections" is enough for AutoResize to work. However, AutoResize="AllDirections" is not working for me, I'm dragging node off the left edge and diagram is not resizing.

So, I had to write special code for nodeModified event handler. Console shows no errors.

Code (Javascript)
Select All
function diagramView_OnNodeMove(sender, args) {

    var nodePosition = args.node.getBounds();

    var margin = nodePosition.width;

    var diagramView = sender._element;

    const increment = 25;
    var bounds = getDiagramBounds();
    var left = bounds.left()
    var right = bounds.right();
    var top = bounds.top();
    var bottom = bounds.bottom();

    if (nodePosition.x <= left) {
        left -= increment;
        setDiagramBounds(left, top, right, bottom);
    }
    else if (nodePosition.x >= right - margin) {
        right += increment;
        setDiagramBounds(left, top, right, bottom);
        sender.setScrollX(sender.getScrollX() + increment);
    }
    else if (nodePosition.y <= top) {
        top -= increment;
        setDiagramBounds(left, top, right, bottom);
    }
    else if (nodePosition.y >= bottom - margin) {
        bottom += increment;
        setDiagramBounds(left, top, right, bottom);
        sender.setScrollY(sender.getScrollY() + increment);
    }
}
 


  
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 #39 - Mar 29th, 2017 at 10:57am
Print Post  
AutoResize works fine for us in ASP.NET too, maybe check if it isn't changed by some initialization script later. What does your setDiagramBounds(left, top, right, bottom) method does? Check if you aren't passing right value as Rect constructor's width argument, and respectively bottom as height - won't be exactly the same when left and top are non-zero.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 2 [3] 
Send TopicPrint