Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
pack.h File Reference

support for connected components More...

#include <stdbool.h>
#include <stddef.h>
#include "types.h"
Include dependency graph for pack.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pack_info
 

Macros

#define PK_COL_MAJOR   (1 << 0)
 
#define PK_USER_VALS   (1 << 1)
 
#define PK_LEFT_ALIGN   (1 << 2)
 
#define PK_RIGHT_ALIGN   (1 << 3)
 
#define PK_TOP_ALIGN   (1 << 4)
 
#define PK_BOT_ALIGN   (1 << 5)
 
#define PK_INPUT_ORDER   (1 << 6)
 

Typedefs

typedef unsigned int packval_t
 

Enumerations

enum  pack_mode {
  l_undef , l_clust , l_node , l_graph ,
  l_array , l_aspect
}
 

Functions

pointfputRects (size_t ng, boxf *bbs, pack_info *pinfo)
 
int packRects (size_t ng, boxf *bbs, pack_info *pinfo)
 
pointfputGraphs (size_t, Agraph_t **, Agraph_t *, pack_info *)
 
int packGraphs (size_t, Agraph_t **, Agraph_t *, pack_info *)
 
int packSubgraphs (size_t, Agraph_t **, Agraph_t *, pack_info *)
 
int pack_graph (size_t ng, Agraph_t **gs, Agraph_t *root, bool *fixed)
 Pack subgraphs followed by postprocessing.
 
int shiftGraphs (size_t, Agraph_t **, pointf *, Agraph_t *, bool)
 
pack_mode getPackMode (Agraph_t *g, pack_mode dflt)
 
int getPack (Agraph_t *, int not_def, int dflt)
 
pack_mode getPackInfo (Agraph_t *g, pack_mode dflt, int dfltMargin, pack_info *)
 
pack_mode getPackModeInfo (Agraph_t *g, pack_mode dflt, pack_info *)
 
pack_mode parsePackModeInfo (const char *p, pack_mode dflt, pack_info *pinfo)
 
int isConnected (Agraph_t *)
 
Agraph_t ** ccomps (Agraph_t *, size_t *, char *)
 
Agraph_t ** cccomps (Agraph_t *, size_t *, char *)
 
Agraph_t ** pccomps (Agraph_t *, size_t *, char *, bool *)
 
Agraph_tmapClust (Agraph_t *)
 

Detailed Description

libpack supports the use of connected components in the context of laying out graphs using other graphviz libraries. One set of functions can be used to take a single graph and break it apart into connected components. A complementary set of functions takes a collection of graphs (not necessarily components of a single graph) which have been laid out separately, and packs them together.

As this library is meant to be used with libcommon, it relies on the Agraphinfo_t, Agnodeinfo_t and Agedgeinfo_t used in that library.

man 3 libpack

Definition in file pack.h.

Macro Definition Documentation

◆ PK_BOT_ALIGN

#define PK_BOT_ALIGN   (1 << 5)

Definition at line 62 of file pack.h.

◆ PK_COL_MAJOR

#define PK_COL_MAJOR   (1 << 0)

Definition at line 57 of file pack.h.

◆ PK_INPUT_ORDER

#define PK_INPUT_ORDER   (1 << 6)

Definition at line 63 of file pack.h.

◆ PK_LEFT_ALIGN

#define PK_LEFT_ALIGN   (1 << 2)

Definition at line 59 of file pack.h.

◆ PK_RIGHT_ALIGN

#define PK_RIGHT_ALIGN   (1 << 3)

Definition at line 60 of file pack.h.

◆ PK_TOP_ALIGN

#define PK_TOP_ALIGN   (1 << 4)

Definition at line 61 of file pack.h.

◆ PK_USER_VALS

#define PK_USER_VALS   (1 << 1)

Definition at line 58 of file pack.h.

Typedef Documentation

◆ packval_t

typedef unsigned int packval_t

Definition at line 65 of file pack.h.

Enumeration Type Documentation

◆ pack_mode

enum pack_mode
Enumerator
l_undef 
l_clust 
l_node 
l_graph 
l_array 
l_aspect 

Definition at line 55 of file pack.h.

Function Documentation

◆ cccomps()

Agraph_t ** cccomps ( Agraph_t g,
size_t *  ncc,
char *  pfx 
)

Definition at line 439 of file ccomps.c.

References agbindrec(), agclean(), agclose(), agdelete(), agfstnode(), aginit(), agnameof(), agnedges(), agnnodes(), AGNODE, agnxtnode(), AGRAPH, agsubg(), agxbfree(), agxbprint(), agxbuse(), clMarkFn(), deriveGraph(), dfs(), freeStk(), GD_cc_subg, graphviz_node_induce(), GRECNAME, initStk(), insertFn(), marked(), NRECNAME, NULL, out(), PRISIZE_T, setPrefix(), subGInduce(), unionNodes(), and Verbose.

Referenced by doDot().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ccomps()

Agraph_t ** ccomps ( Agraph_t g,
size_t *  ncc,
char *  pfx 
)

Definition at line 187 of file ccomps.c.

References agbindrec(), agfstnode(), agnnodes(), agnxtnode(), agsubg(), agxbfree(), agxbprint(), agxbuse(), dfs(), freeStk(), initStk(), insertFn(), marked(), markFn(), NULL, out(), PRISIZE_T, setPrefix(), and unmark().

Referenced by circomps(), main(), sfdp_layout(), and twopi_layout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPack()

int getPack ( Agraph_t g,
int  not_def,
int  dflt 
)

Definition at line 1266 of file pack.c.

References agget().

Referenced by compoundEdges(), doDot(), getPackInfo(), and neato_layout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPackInfo()

pack_mode getPackInfo ( Agraph_t g,
pack_mode  dflt,
int  dfltMargin,
pack_info pinfo 
)

Definition at line 1281 of file pack.c.

References pack_info::doSplines, pack_info::fixed, getPack(), getPackModeInfo(), pack_info::margin, pack_info::mode, NULL, and Verbose.

Referenced by circoLayout(), doDot(), init_info(), layout(), pack_graph(), sfdp_layout(), and twopi_layout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPackMode()

pack_mode getPackMode ( Agraph_t g,
pack_mode  dflt 
)

Definition at line 1257 of file pack.c.

References getPackModeInfo().

Here is the call graph for this function:

◆ getPackModeInfo()

pack_mode getPackModeInfo ( Agraph_t g,
pack_mode  dflt,
pack_info pinfo 
)

Definition at line 1253 of file pack.c.

References agget(), and parsePackModeInfo().

Referenced by doDot(), getPackInfo(), getPackMode(), and neato_layout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isConnected()

int isConnected ( Agraph_t g)

Definition at line 508 of file ccomps.c.

References agfstnode(), agnnodes(), agnxtnode(), cnt(), dfs(), freeStk(), initStk(), markFn(), NULL, and unmark().

Here is the call graph for this function:

◆ mapClust()

Agraph_t * mapClust ( Agraph_t cl)

Definition at line 366 of file ccomps.c.

References aggetrec(), orig_t::orig, and ORIG_REC.

Referenced by copyCluster(), and copyClusterInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pack_graph()

int pack_graph ( size_t  ng,
Agraph_t **  gs,
Agraph_t root,
bool *  fixed 
)

Definition at line 1127 of file pack.c.

References CL_OFFSET, dotneato_postprocess(), getPackInfo(), l_graph, and packSubgraphs().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ packGraphs()

int packGraphs ( size_t  ng,
Agraph_t **  gs,
Agraph_t root,
pack_info info 
)

Definition at line 1089 of file pack.c.

References free(), putGraphs(), and shiftGraphs().

Referenced by main(), neato_layout(), and packSubgraphs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ packRects()

int packRects ( size_t  ng,
boxf bbs,
pack_info pinfo 
)

Definition at line 948 of file pack.c.

References add_pointf(), free(), boxf::LL, putRects(), and boxf::UR.

Here is the call graph for this function:

◆ packSubgraphs()

int packSubgraphs ( size_t  ng,
Agraph_t **  gs,
Agraph_t root,
pack_info info 
)

Definition at line 1104 of file pack.c.

References compute_bb(), EXPANDBB, GD_bb, GD_clust, GD_n_cluster, and packGraphs().

Referenced by circoLayout(), doDot(), pack_graph(), sfdp_layout(), and twopi_layout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parsePackModeInfo()

pack_mode parsePackModeInfo ( const char *  p,
pack_mode  dflt,
pack_info pinfo 
)

Definition at line 1208 of file pack.c.

References pack_info::aspect, chkFlags(), pack_info::flags, l_array, l_aspect, l_clust, l_graph, l_node, pack_info::mode, mode2Str(), NULL, startswith(), streq(), pack_info::sz, pack_info::vals, and Verbose.

Referenced by getPackModeInfo(), and init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pccomps()

Agraph_t ** pccomps ( Agraph_t g,
size_t *  ncc,
char *  pfx,
bool *  pinned 
)

Definition at line 125 of file ccomps.c.

References agbindrec(), agfstnode(), agnnodes(), agnxtnode(), agsubg(), agxbfree(), agxbprint(), agxbuse(), dfs(), freeStk(), initStk(), insertFn(), isPinned, marked(), markFn(), NULL, out(), PRISIZE_T, setPrefix(), and unmark().

Referenced by neato_layout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ putGraphs()

pointf * putGraphs ( size_t  ng,
Agraph_t **  gs,
Agraph_t root,
pack_info pinfo 
)

Definition at line 888 of file pack.c.

References agget(), arrayRects(), compute_bb(), pack_info::flags, free(), GD_bb, gv_calloc(), l_array, l_graph, pack_info::mode, NULL, PK_USER_VALS, polyGraphs(), and pack_info::vals.

Referenced by layout(), and packGraphs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ putRects()

pointf * putRects ( size_t  ng,
boxf bbs,
pack_info pinfo 
)

Definition at line 927 of file pack.c.

References arrayRects(), l_array, l_clust, l_graph, l_node, pack_info::mode, NULL, and polyRects().

Referenced by layout(), and packRects().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shiftGraphs()

int shiftGraphs ( size_t  ng,
Agraph_t **  gs,
pointf pp,
Agraph_t root,
bool  doSplines 
)

Definition at line 1037 of file pack.c.

References agfstnode(), agfstout(), agnxtnode(), agnxtout(), dx, dy, MOVEPT, ND_coord, ND_pos, ND_xlabel, PS2INCH, shiftEdge(), shiftGraph(), pointf_s::x, and pointf_s::y.

Referenced by packGraphs().

Here is the call graph for this function:
Here is the caller graph for this function: