Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Custom layout and coordinates calculation (Read 161 times)
Anna Malashkina
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 26
Joined: Sep 22nd, 2019
Custom layout and coordinates calculation
Aug 13th, 2020 at 9:18pm
Print Post  
Hello,

I implemented custom layout and was able to deploy it via arrange() function. In this way I had got graph in the function instead of diagram.


As far as I can see vertex width and height have come from owner's bounds. But I'm not sure how vertex.x and vertex.y are being transformed back to diagram's coordinates. Could you please explain?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 2279
Joined: Oct 19th, 2005
Re: Custom layout and coordinates calculation
Reply #1 - Aug 14th, 2020 at 6:19am
Print Post  
Hi Anna,

Set vertex' X and Y to the center of wanted node position. If inside ContainerNode, positions should be relative to its top/left. Final coordinates are also translated by layout.margins value and other subgraphs' bounds depending on multipleGraphsPlacement. If you don't want your diagram to be split into subgraphs and multipleGraphsPlacement applied, set requiresConnectedGraph field of your layout class to false.

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