Hi again!
I have the need to set bounds for a layout, and started with a square contour. On a basic home made force layout, I applied a brutal force that forbids node to go out of the desired bounds by just sticking them on the border.
The problem with this approch is that strongly connected components approching a corner get sticked in: most of the node repel each other toward exterior which maintain some of the nodes in the corner. The nodes that do not stick to the corner get so much repulsion that they got rejected in the diagonal corner, and layout blinks this way.
I could try to tune the force parameters more smartly, but I think bounds with progressive force would avoid such schemas. Are there any other methods to cleanly bound layouts?
Regards,
Martin
Layout with bounds
- martin.pernollet
- Posts:18
- Joined:05 Oct 2010 12:42 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
- martin.pernollet
- Posts:18
- Joined:05 Oct 2010 12:42 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: Layout with bounds
Applying a strict border force on ForceAtlas works really perfectly: nodes will stick and smoothly slide along the border if there is too much repulsion coming from interior of the bounds.
The work is trivial to do, so I only send a picture, but ask me if you want a sample code.
Martin
The work is trivial to do, so I only send a picture, but ask me if you want a sample code.
Martin
- rotten
- Posts:34
- Joined:27 Aug 2010 14:42
- Location:Columbus, Ohio [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: Layout with bounds
You could use "Gravity" to represent an attraction force to the graph origin. You could try defining your Gravity so that it gets stronger the further away you get.
Depending on the shape of your gravity curve you would be able to define a "soft border", where tiny increments in distance from the origin would require significantly increasing forces to achieve.
You could also probably get fancy and have a multi-axis Gravity function so that you approximate a rectangle instead of a circle.
Depending on the shape of your gravity curve you would be able to define a "soft border", where tiny increments in distance from the origin would require significantly increasing forces to achieve.
You could also probably get fancy and have a multi-axis Gravity function so that you approximate a rectangle instead of a circle.
- rotten
- Posts:34
- Joined:27 Aug 2010 14:42
- Location:Columbus, Ohio [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: Layout with bounds
Now you have me thinking about using overloaded gravity functions to maybe do other things with force-layout (which don't necessarily make any sense, but could be fun exercises) such as:
- Concentrate nodes in radial or concentric "bands".
Represent some sort of surface topology so that nodes tend to slide into "valleys" or "holes".
Simulate non-euclidean geometric surfaces.
'Taxicab' path visualizations by pushing nodes land on a grid.
Re: Layout with bounds
These could make a lot of sense in certain use cases.rotten wrote:Now you have me thinking about using overloaded gravity functions to maybe do other things with force-layout (which don't necessarily make any sense, but could be fun exercises) such as:
- Concentrate nodes in radial or concentric "bands".
Represent some sort of surface topology so that nodes tend to slide into "valleys" or "holes".
Simulate non-euclidean geometric surfaces.
'Taxicab' path visualizations by pushing nodes land on a grid.
- martin.pernollet
- Posts:18
- Joined:05 Oct 2010 12:42 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: Layout with bounds
Right! I will most probably try to have nodes with a common "look" (e.g. degree and common neighbour) gathered so that they always appear closed in a region, and no other "kind of node" in the region. I'll tell you if I go further on this attempt.rotten wrote: Concentrate nodes in radial or concentric "bands".
That sound interesting!rotten wrote: Represent some sort of surface topology so that nodes tend to slide into "valleys" or "holes".
Simulate non-euclidean geometric surfaces.
Sorry, I don't understand what you meanrotten wrote: 'Taxicab' path visualizations by pushing nodes land on a grid.

Martin
- rotten
- Posts:34
- Joined:27 Aug 2010 14:42
- Location:Columbus, Ohio [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: Layout with bounds
Taxicab Geometry:
https://secure.wikimedia.org/wikipedia/ ... b_geometry
https://secure.wikimedia.org/wikipedia/ ... b_geometry