C# Class Smrf.NodeXL.Layouts.EdgeBundler

EdgeBundler class is intended to be used for bundling and straightening of the edges of the graph. The goal is to get the layout that is less clutered and more suitable for analiyzing. This class is based on the paper "Force-Directed Edge Bundling for Graph Visualization" by Danny Holten and Jarke J. van Wijk. http://www.win.tue.nl/~dholten/papers/forcebundles_eurovis.pdf It was implemented and modified by Luka Potkonjak.
显示文件 Open project: 2014-sed-team3/term-project Class Usage Examples

Public Methods

Method Description
BundleAllEdges ( IGraph graph, Rectangle rectangle ) : void

Bundles edges of the graph.

BundleEdges ( IGraph graph, IEnumerable edges, Rectangle rectangle ) : void

Bundles specified edges. Shapes of all the other edges remain the same, so this method is faster than the one for bundling all edges, but also produces less optimal layout.

StraightenEdges ( IGraph graph, float s ) : void

Moves the control points of all the edges of the graph closer to their original position on the straight edge

Private Methods

Method Description
AddAllExistingData ( IEdgeCollection edges ) : void

Collects edge data from all edges in the specified collection. Used for edges that already have control points metadata.

AddDataForAllEdges ( IEdgeCollection edges ) : void

Collects edge data from all edges in the specified collection. Used by the BundleAllEdges method.

AddEdgeData ( IEdge e ) : void

Collects data from the specified edge

AddEdgeDataForMovedEdges ( IEnumerable edges ) : void

Collects edge data from the specified edges

AddExistingData ( IEdge e ) : void

Collects data from the specified edge. Used for edges that already have control points metadata.

AngleCompatibility ( EdgeGroupData ed1, EdgeGroupData ed2 ) : float

Calculates angle compatibility of the two edges

CalculateCompatibility ( EdgeGroupData ed1, EdgeGroupData ed2 ) : float

Calculates compatibility of the two edges. Combines angle, position, scale, and visibility compatibility coefficient.

CalculateDirectedness ( EdgeGroupData ed1, EdgeGroupData ed2 ) : bool

Calculates directedness of the two edges.

CalculateNewControlPoints ( Object o ) : void

Calculates new positions for the control points of an edge by applying elastic and electrostatic forces to them

DivideAllEdges ( int subdivisionPointsNum ) : void

Divides edges into segments by adding subdivision points to them

DivideEdge ( EdgeGroupData ed, int subdivisionPointsNum ) : void

Divides an edge into segments by adding subdivision points to it

DoubleSubdivisionPoints ( EdgeGroupData ed ) : void

Doubles subdivision points for an edge by adding one new subdivision point between each two

DoubleSubdivisionPointsForAllEdges ( ) : void

Doubles subdivision points for all edges

FindCompatibleEdges ( EdgeGroupData>.Dictionary edgeSet ) : void

Finds compatible edges for the specified set of edges

Intersects ( PointF p1, PointF p2, PointF q1, PointF q2, PointF &intersection, float &rp ) : bool

Finds an intersection point of the two lines

MoveControlPoints ( EdgeGroupData>.Dictionary groupsToMove ) : void

Moves control points for the specified edges

PositionCompatibility ( EdgeGroupData ed1, EdgeGroupData ed2 ) : float

Calculates position compatibility of the two edges

ResetMovedEdges ( ) : void

Straightens moved edges.

ScaleCompatibility ( EdgeGroupData ed1, EdgeGroupData ed2 ) : float

Calculates scale compatibility of the two edges

StraightenEdgesInternally ( EdgeGroupData>.Dictionary groupsToStraighten, float s ) : void

Straightens the edges using internal data sturctures

VisibilityCoefficient ( EdgeGroupData ed1, EdgeGroupData ed2 ) : float

Calculates visibility coefficient of the two edges.

VisibilityCompatibility ( EdgeGroupData ed1, EdgeGroupData ed2 ) : float

Calculates visibility compatibility of the two edges. Uses lower of the two calculated visibility coefficients.

Method Details

BundleAllEdges() public method

Bundles edges of the graph.
public BundleAllEdges ( IGraph graph, Rectangle rectangle ) : void
graph IGraph /// Graph whose edges should be bundled ///
rectangle System.Drawing.Rectangle /// Rectangle in which the graph is laid out. /// Control points of bundled edges should not fall outside of this rectangle. ///
return void

BundleEdges() public method

Bundles specified edges. Shapes of all the other edges remain the same, so this method is faster than the one for bundling all edges, but also produces less optimal layout.
public BundleEdges ( IGraph graph, IEnumerable edges, Rectangle rectangle ) : void
graph IGraph /// Parent graph of the edge set ///
edges IEnumerable /// Edges that should be bundled ///
rectangle System.Drawing.Rectangle /// Rectangle in which the graph is laid out. /// Control points of bundled edges should not fall outside of this rectangle. ///
return void

StraightenEdges() public method

Moves the control points of all the edges of the graph closer to their original position on the straight edge
public StraightenEdges ( IGraph graph, float s ) : void
graph IGraph /// Graph whose edges should be straightened ///
s float /// Specifies the amount of straightening, from 0 to 1 ///
return void