Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Reframing the diagram based on user's node addition/deletion (Read 4292 times)
Chris B.
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 15
Joined: May 30th, 2013
Reframing the diagram based on user's node addition/deletion
Oct 16th, 2013 at 3:16am
Print Post  
Hi MindFusion!

      Is there a way for us to reframe the diagram after a user deletes (or adds) a node?

      There are a lot of unnecessary white spaces left out especially after a user deletes a node that was placed at a very far distant from the rest of the nodes in some corner of the diagram. Deleting that node makes the effective area of the diagram much smaller if we exclude the whitespaces.

      Our objective is to reframe the diagram to remove white spaces so that the outermost nodes almost touch the edge of the diagram. Can we do that at the client-side script? We would like to avoid rearranging the layout since we want to keep position of existing nodes intact.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Reframing the diagram based on user's node addition/deletion
Reply #1 - Oct 16th, 2013 at 6:07am
Print Post  
Hi,

Call diagram.resizeToFitItems() from the NodeDeleted event handler.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Chris B.
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 15
Joined: May 30th, 2013
Re: Reframing the diagram based on user's node addition/deletion
Reply #2 - Oct 28th, 2013 at 7:40am
Print Post  
Hi Stoyo,

       diagram.resizeToFitItems() works beautifully on the diagram. However, there seems to be an issue with reflecting the same changes on the overview after calling resizeToFitItems().

        Unnecessary whitespace created by deletion of a node in that area has been removed nicely in the diagram while in the overview, it still remains. However, overview seems to notice width and height change of the diagram and it changes its width and height accordingly, creating a cropped representation inside overview.

        The issue only occurs if nodes are deleted one by one from left to right or top to bottom. If we delete nodes from right to left or bottom to top, there is no issue because the whitespace is automatically removed by reduced width and height.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Reframing the diagram based on user's node addition/deletion
Reply #3 - Oct 28th, 2013 at 9:02am
Print Post  
Hi,

Have you moved to the released 1.6 version? In older versions the Overview did not work correctly with non-zero diagram.Bounds origin.

Stoyan
  
Back to top
 
IP Logged
 
Chris B.
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 15
Joined: May 30th, 2013
Re: Reframing the diagram based on user's node addition/deletion
Reply #4 - Oct 29th, 2013 at 1:39am
Print Post  
Hi Stoyo,

      By version 1.6, you meant the one you sent via PM that uses canvas for drawing overview? If it is the one, we are using that version. We confirm that the issue is still there with that version.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Reframing the diagram based on user's node addition/deletion
Reply #5 - Oct 29th, 2013 at 6:32am
Print Post  
Hi Chris,

What I sent you was a pre-release build to fix the overview's tracker rectangle if I recall correctly. We released version 1.6 later and it should contain some more Overview fixes (http://mindfusion.eu/Forum/YaBB.pl?num=1382622248), you should have access to it from your account page at http://clientsarea.eu/.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint