Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
DotIO.c File Reference
#include <cgraph/agxbuf.h>
#include <cgraph/alloc.h>
#include <cgraph/startswith.h>
#include <cgraph/unreachable.h>
#include <sparse/general.h>
#include <sparse/DotIO.h>
#include <sparse/clustering.h>
#include <math.h>
#include <sparse/mq.h>
#include <sparse/color_palette.h>
#include <sparse/colorutil.h>
#include <stdbool.h>
#include <string.h>
Include dependency graph for DotIO.c:

Go to the source code of this file.

Data Structures

struct  Agnodeinfo_t
 

Macros

#define STANDALONE
 
#define ND_id(n)   (((Agnodeinfo_t*)((n)->base.data))->id)
 

Functions

static void color_string (agxbuf *buf, int dim, double *color)
 
void attach_edge_colors (Agraph_t *g, int dim, double *colors)
 
SparseMatrix SparseMatrix_import_dot (Agraph_t *g, int dim, double **x, int format)
 
int Import_dot_splines (Agraph_t *g, int *ne, char ***xsplines)
 
static int hex2int (char h)
 
static float hexcol2rgb (const char *h)
 
void Dot_SetClusterColor (Agraph_t *g, float *rgb_r, float *rgb_g, float *rgb_b, int *clusters)
 
SparseMatrix Import_coord_clusters_from_dot (Agraph_t *g, int maxcluster, int dim, int *nn, double **label_sizes, double **x, int **clusters, float **rgb_r, float **rgb_g, float **rgb_b, float **fsz, char ***labels, int default_color_scheme, int clustering_scheme, int useClusters)
 
void attached_clustering (Agraph_t *g, int maxcluster, int clustering_scheme)
 
void initDotIO (Agraph_t *g)
 
void setDotNodeID (Agnode_t *n, int v)
 
int getDotNodeID (Agnode_t *n)
 

Macro Definition Documentation

◆ ND_id

#define ND_id (   n)    (((Agnodeinfo_t*)((n)->base.data))->id)

Definition at line 31 of file DotIO.c.

◆ STANDALONE

#define STANDALONE

Definition at line 11 of file DotIO.c.

Function Documentation

◆ attach_edge_colors()

void attach_edge_colors ( Agraph_t g,
int  dim,
double *  colors 
)

Definition at line 50 of file DotIO.c.

References agattr(), AGEDGE, agfstnode(), agfstout(), aghead, agnxtnode(), agnxtout(), agxbfree(), agxbuse(), agxset(), color_string(), ND_id, and row.

Referenced by edge_distinct_coloring().

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

◆ attached_clustering()

void attached_clustering ( Agraph_t g,
int  maxcluster,
int  clustering_scheme 
)

Definition at line 568 of file DotIO.c.

References A, agattr(), AGEDGE, agfstnode(), agfstout(), aghead, agnedges(), agnnodes(), AGNODE, agnxtnode(), agnxtout(), agxbfree(), agxbprint(), agxbuse(), agxget(), agxset(), CLUSTERING_MODULARITY, CLUSTERING_MQ, free(), gv_calloc(), I, MATRIX_TYPE_REAL, modularity_clustering(), mq_clustering(), ND_id, nedges, NULL, row, SparseMatrix_delete(), SparseMatrix_from_coordinate_arrays(), type, UNREACHABLE, and Verbose.

Referenced by clusterGraph().

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

◆ color_string()

static void color_string ( agxbuf buf,
int  dim,
double *  color 
)
static

Definition at line 33 of file DotIO.c.

References agxbprint(), color(), and MIN.

Referenced by attach_edge_colors().

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

◆ Dot_SetClusterColor()

void Dot_SetClusterColor ( Agraph_t g,
float *  rgb_r,
float *  rgb_g,
float *  rgb_b,
int *  clusters 
)

Definition at line 268 of file DotIO.c.

References agattr(), agfstnode(), AGNODE, agnxtnode(), agxbfree(), agxbuse(), agxset(), ND_id, NULL, and rgb2hex().

Referenced by makeMap().

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

◆ getDotNodeID()

int getDotNodeID ( Agnode_t n)

Definition at line 664 of file DotIO.c.

References ND_id.

Referenced by bundle().

Here is the caller graph for this function:

◆ hex2int()

static int hex2int ( char  h)
static

Definition at line 257 of file DotIO.c.

Referenced by hexcol2rgb().

Here is the caller graph for this function:

◆ hexcol2rgb()

static float hexcol2rgb ( const char *  h)
static

Definition at line 264 of file DotIO.c.

References hex2int().

Referenced by Import_coord_clusters_from_dot().

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

◆ Import_coord_clusters_from_dot()

SparseMatrix Import_coord_clusters_from_dot ( Agraph_t g,
int  maxcluster,
int  dim,
int *  nn,
double **  label_sizes,
double **  x,
int **  clusters,
float **  rgb_r,
float **  rgb_g,
float **  rgb_b,
float **  fsz,
char ***  labels,
int  default_color_scheme,
int  clustering_scheme,
int  useClusters 
)

◆ Import_dot_splines()

int Import_dot_splines ( Agraph_t g,
int *  ne,
char ***  xsplines 
)

Definition at line 217 of file DotIO.c.

References agattr(), AGEDGE, agfstnode(), agfstout(), agnedges(), agnxtnode(), agnxtout(), agxget(), gv_calloc(), ND_id, and nedges.

Referenced by edge_distinct_coloring().

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

◆ initDotIO()

void initDotIO ( Agraph_t g)

Definition at line 654 of file DotIO.c.

References aginit(), and AGNODE.

Referenced by bundle(), clarify(), clusterGraph(), and mapFromGraph().

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

◆ setDotNodeID()

void setDotNodeID ( Agnode_t n,
int  v 
)

Definition at line 659 of file DotIO.c.

References ND_id.

Referenced by bundle().

Here is the caller graph for this function:

◆ SparseMatrix_import_dot()

SparseMatrix SparseMatrix_import_dot ( Agraph_t g,
int  dim,
double **  x,
int  format 
)

Definition at line 80 of file DotIO.c.

References A, agattr(), AGEDGE, agerrorf(), agfstnode(), agfstout(), aghead, agnameof(), agnedges(), agnnodes(), AGNODE, agnxtnode(), agnxtout(), agxget(), format, FORMAT_COORD, FORMAT_CSR, free(), graphviz_exit(), gv_calloc(), I, MATRIX_TYPE_REAL, ND_id, nedges, NULL, row, SparseMatrix_delete(), SparseMatrix_from_coordinate_arrays(), SparseMatrix_new(), and type.

Referenced by bundle(), and edge_distinct_coloring().

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