Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Continuation to scatter the boxes in chart (Read 12151 times)
Keren
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Jun 6th, 2007
Continuation to scatter the boxes in chart
Jun 6th, 2007 at 8:07am
Print Post  
Hi,

I have a problem regarding the topic of “scatter the boxes in chart”.
I want to scatter my graph in a way that each box will not be run over by another box (each box is a node in the graph). I thought that by enlarging the setDistributionFactor I will achieve it, but it seems that only the center of the boxes are distributed, while the boxes boundaries are not taken in to consideration. Am I wrong, and are you planning to change the code?

Thanks
Keren 
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Continuation to scatter the boxes in chart
Reply #1 - Jun 6th, 2007 at 10:14am
Print Post  
Hi,

You are right; currently the node dimensions are ignored. We will change this in the next release.

Stoyan
  
Back to top
 
IP Logged
 
Keren
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Jun 6th, 2007
Re: Continuation to scatter the boxes in chart
Reply #2 - Jun 7th, 2007 at 3:20am
Print Post  
Thank you very much for the quick response  Smiley
Do you know where the next release is due to?

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Continuation to scatter the boxes in chart
Reply #3 - Jun 7th, 2007 at 5:15am
Print Post  
In 2-3 weeks... But we'll try to upload here a preview version with that implented in a couple of days.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Continuation to scatter the boxes in chart
Reply #4 - Jun 25th, 2007 at 10:31am
Print Post  
Hi,

This updated version now considers the node sizes when applying AnnealLayout :

http://www.mindfusion.org/_temp/JDiagram.jar

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Continuation to scatter the boxes in chart
Reply #5 - Jun 27th, 2007 at 12:01pm
Print Post  
Hi,

It seems that something went wrong with this fix.
The distribution is sparser due to this change - but again it brings us back the problem of large distance between boxes.
If in previous posts we've discussed this problem and discovered that running the layout several time solves all problem, now suddenly even running it a few time doesn't solve the problem - the layout stays sparse.

These are the parameters I am using:

AnnealLayout layout = new AnnealLayout();
layout.setIterationsPerStage(50);
layout.setStages(15);
layout.setInitialTemperature(200f);
layout.setTemperatureScale(0.75f);
layout.setArrowLengthFactor(0.001);
layout.setDistributionFactor(40000);
layout.setBoundaryFactor(50000);
layout.setNodeArrowDistFactor(0.35);
layout.setLayoutArea(this.getDocBounds());
layout.setCrossingArrowsCost(100000);
layout.arrange(this);

Any ideas?
Thanks,
Yoav
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Continuation to scatter the boxes in chart
Reply #6 - Jun 27th, 2007 at 1:03pm
Print Post  
Hi,

Previously the distance between nodes was considered the one between their centers, and now it is the one between their borders. That changes the effect that the cost parameters have on the graph layout, so you must tweak the ones related to node distances. E.g. now call setArrowLengthFactor with a value closer to 1. We used a value closer to 0 before because there wasn't other way to prevent node overlapping (arrow length was also measured as distance between node centers). You could also decrease the distribution cost if you need smaller distances between unconnected nodes.

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Continuation to scatter the boxes in chart
Reply #7 - Jul 1st, 2007 at 6:15am
Print Post  
Hi,

I've tried different parameters. First, changing the setArrowLengthFactor to a value closer to 1 didn't look well - the arrows became much shorter (almost disappearing).
Changing other parameters didn't do well also.
After inverstigating the issues further, it seems that when we don't consider the distance between nodes as the distance between the centers, we may have overlapping. If we do consider that - we have a sparse graph.
Is there a way to deterimine the method that is used? I nean, if we're using the center distance or not, or anything that will allow us to choose what we would prefer to use?

Thanks,
Yoav
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Continuation to scatter the boxes in chart
Reply #8 - Jul 2nd, 2007 at 7:04am
Print Post  
Hi,

We can get all sorts of arrow lengths by varying the ArrowLengthFactor between 0 and 1. What length you would like to get, on the average?

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Continuation to scatter the boxes in chart
Reply #9 - Jul 2nd, 2007 at 9:17am
Print Post  
Hi,

As I understand, I can determine the arrow length in code using the ArrowLengthFactor parameter as you described.
What currently can't be done is determining if the setDistributionFactor uses node dimensions in its calculations. Apparently this affects the distribution of the nodes.
Could this be determined by the user somehow?

Thanks,
Yoav
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Continuation to scatter the boxes in chart
Reply #10 - Jul 2nd, 2007 at 10:44am
Print Post  
Hi,

Currently the distances are always calculated between the node borders, and not their centers. Isn't that what you needed? There isn't any property that will make the algorithm use the coordinates of the node centers again.

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Continuation to scatter the boxes in chart
Reply #11 - Jul 2nd, 2007 at 12:59pm
Print Post  
The reason to calculate distances from center was to improve the layout.
Layout maladies were:
1) Nodes were sometimes overlapping
2) Graph was sparse (meaning - unconnected nodes were very far from each other). Re-running the algorithm a few times seems to fix it.

A suggestion was made, that maybe using the node's size will improve the layout.
After applying this fix, it seems that we don't have ovelrlapping nodes anymore, but on the other hand the distance between unconnected nodes became much larger, and re-runnnig the layout takes more rime to solve.

So this solution may not fix the layout problem, but it simply fixes one symptom (overlap) and makes one worse (spaces).

This is why I asked if user can decide they don't want to use this solution - since there's a price using it.
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Continuation to scatter the boxes in chart
Reply #12 - Jul 2nd, 2007 at 1:13pm
Print Post  
I think there should be a simple solution - I just don't know what it is.
I think so, because Every time I run the first layout, everything is sparse. After running, let's say, 10 times rebuild of graph - the layout is perfect!
Here's an Overview screenshot of first run:
http://albums.tapuz.co.il/Albums/getImage.aspa=1248443&b=0&c=124844320077218953....
And here's after 10 rebuilds:
http://albums.tapuz.co.il/Albums/getImage.aspa=1248443&b=0&c=1248443200772181018...
Much better!

What's weird is that I totally rebuild the graph each time - not just run the layout again.
I use:
chart.clearAll();
And than adds again all boxes and arrows in 0,0 position, and then runs the layout. After 10 times like that - Voila.
Can it be due to variables that are saved even during clearAll()? Some memory of the chart?

Thanks,
Yoav
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Continuation to scatter the boxes in chart
Reply #13 - Jul 2nd, 2007 at 1:30pm
Print Post  
Maybe you start with a big document size, and it gets smaller and smaller after each time running the layout?

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Continuation to scatter the boxes in chart
Reply #14 - Jul 2nd, 2007 at 1:59pm
Print Post  
I think you got it. It seems right.
This rellay solves a long mistery...  Cheesy
What may have happenned, is that on each iteration random layouting caused the layout area to be smaller than the chart.
Since I use :
chart.resizeToFitMinimum();
The chart gets smaller and smaller, and so a better layout is done.

So now comes the big question: can you find the correct size on a single layout runnnig? Is it possible?

Thanks,
Yoav
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint