Adaptagrams
Classes | Typedefs | Functions
cola Namespace Reference

libcola: Force-directed network layout subject to separation constraints library. More...

Classes

class  AlignmentConstraint
 An alignment constraint specifies a alignment line that a set of nodes must be constrained to by an exact amount. More...
 
class  BoundaryConstraint
 A boundary constraint specifies a bounding line that a set of nodes must be either to the left or right of. More...
 
class  Box
 A box consisting of four edge values for representing padding or margins for rectangles. More...
 
class  Cluster
 A cluster defines a hierarchical partitioning over the nodes which should be kept disjoint by the layout somehow. More...
 
class  CompoundConstraint
 An abstract base class for all high-level compound constraints. More...
 
class  ConstrainedFDLayout
 Implements a constrained force-directed layout algorithm. More...
 
class  ConstrainedMajorizationLayout
 Implements the Constrained Majorization graph layout algorithm (deprecated). More...
 
class  ConvexCluster
 Defines a cluster that will be treated as a convex boundary around the child nodes and clusters. More...
 
class  DistributionConstraint
 A distribution constraint specifies an ordered set of alignment constraints and a fixed separation required between them. More...
 
class  FixedRelativeConstraint
 A fixed-relative constraint specifies that a group of nodes are constrained to be fixed in position relative to each other. More...
 
class  Lock
 A Lock specifies a required position for a node. More...
 
class  MultiSeparationConstraint
 A multi-separation constraint Specifies a set of horizontal or vertical equal spacing constraints between pairs of alignment constraints. More...
 
class  PageBoundaryConstraints
 A page boundary contraint specifies constraints that attempt to keep the given nodes within a defined rectangular region. More...
 
class  PreIteration
 A default functor that is called before each iteration in the main loop of the ConstrainedFDLayout::run() method. More...
 
class  RectangularCluster
 Defines a rectangular cluster, either variable-sized with floating sides or a fixed size based on a particular rectangle. More...
 
class  Resize
 A Resize specifies a new required bounding box for a node. More...
 
class  RootCluster
 Holds the cluster hierarchy specification for a diagram. More...
 
class  SeparationConstraint
 A separation constraint specifies a simple horizontal or vertical spacing constraint between 2 nodes or alignment constraints. More...
 
class  TestConvergence
 A default functor that is called after each iteration of the layout algorithm. More...
 
class  TopologyAddonInterface
 Interface for writing COLA addons to handle topology preserving layout. More...
 
class  UnsatisfiableConstraintInfo
 Info about constraints that could not be satisfied in gradient projection process. More...
 
class  VariableIDMap
 Holds a mapping between two sets of Variable indices. More...
 

Typedefs

typedef std::vector< unsigned > NodeIndexes
 A vector of node Indexes.
 
typedef std::vector< NodeIndexesListOfNodeIndexes
 A vector of NodeIndexes.
 
typedef std::pair< unsigned, unsigned > Edge
 Edges are simply a pair of indices to entries in the Node vector.
 
typedef std::vector< double > EdgeLengths
 
typedef std::vector< cola::LockLocks
 A vector of Lock objects.
 
typedef std::vector< cola::ResizeResizes
 A vector of Resize objects.
 
typedef std::vector< CompoundConstraint * > CompoundConstraints
 A vector of pointers to CompoundConstraint objects.
 
typedef std::vector< UnsatisfiableConstraintInfo * > UnsatisfiableConstraintInfos
 A vector of pointers to UnsatisfiableConstraintInfo objects.
 

Functions

ProjectionResult projectOntoCCs (vpsc::Dim dim, vpsc::Rectangles &rs, cola::CompoundConstraints ccs, bool preventOverlaps, int accept=0, unsigned debugLevel=0)
 Attempt to do a projection onto a vector of cola CompoundConstraints. More...
 
ProjectionResult solve (vpsc::Variables &vs, vpsc::Constraints &cs, vpsc::Rectangles &rs, unsigned debugLevel=0)
 Constructs a solver and attempts to solve the passed constraints on the passed vars. More...
 
void generateVariablesAndConstraints (CompoundConstraints &ccs, const vpsc::Dim dim, vpsc::Variables &vars, vpsc::Constraints &cs, vpsc::Rectangles &bbs)
 Generate all the variables and constraints for a collection of CompoundConstraints.
 
void generateVariables (CompoundConstraints &ccs, const vpsc::Dim dim, vpsc::Variables &vars)
 Generate just all the variables for a collection of CompoundConstraints.
 

Detailed Description

libcola: Force-directed network layout subject to separation constraints library.

You should use COLA via an instance of the ConstrainedFDLayout class.

Typedef Documentation

◆ EdgeLengths

typedef std::vector<double> cola::EdgeLengths

EdgeLengths is a vector of ideal lengths for edges corresponding to edges in the edge list.

Function Documentation

◆ projectOntoCCs()

ProjectionResult cola::projectOntoCCs ( vpsc::Dim  dim,
vpsc::Rectangles rs,
cola::CompoundConstraints  ccs,
bool  preventOverlaps,
int  accept = 0,
unsigned  debugLevel = 0 
)

Attempt to do a projection onto a vector of cola CompoundConstraints.

Parameters
dimthe dimension in which to perform the projection
rsthe rectangles representing the nodes
ccsthe constraints
preventOverlapsboolean saying whether you want overlap prevention constraints to be automatically generated
acceptan integer indicating which types of infeasibilities you will accept. The default value of 0 means you accept no infeasibility. For other values, see the description of the "errorLevel" in the doctext for the solve function below.
debugLevelsee solve function below
Note
Rectangle positions are updated if and only if the error level is less than or equal to the accept level.
Returns
a ProjectionResult indicating whether the projection was feasible or not.
See also
solve

◆ solve()

ProjectionResult cola::solve ( vpsc::Variables vs,
vpsc::Constraints cs,
vpsc::Rectangles rs,
unsigned  debugLevel = 0 
)

Constructs a solver and attempts to solve the passed constraints on the passed vars.

Parameters
debugLevelcontrols how much information comes back when the projection fails. See below.
Returns
a ProjectionResult, containing: errorLevel: 0: all constraints were satisfiable. 1: some constraints were unsatisfiable, but they were all nonoverlap constraints. 2: some constraints were unsatisfiable which were /not/ nonoverlap constraints. unsatinfo: The amount of information reported depends on the debugLevel: 0: nothing reported (empty string) 1: description of the unsatisfied constraints 2: the info from level 1, plus a description of all "related" constraints (those sharing a variable). This is useful for understanding the conflicts.