Graphviz 13.0.0~dev.20241220.2304
|
#include <common/render.h>
#include <cgraph/tokenize.h>
#include <common/htmltable.h>
#include <common/entities.h>
#include <limits.h>
#include <math.h>
#include <gvc/gvc.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include <unistd.h>
#include <util/agxbuf.h>
#include <util/alloc.h>
#include <util/gv_ctype.h>
#include <util/gv_math.h>
#include <util/startswith.h>
#include <util/strcasecmp.h>
#include <util/streq.h>
#include <util/strview.h>
Go to the source code of this file.
Data Structures | |
struct | fontinfo |
struct | item |
struct | cl_edge_t |
struct | clust_t |
Macros | |
#define | W_DEGREE 5 |
#define | PATHSEP ":" |
Functions | |
int | late_int (void *obj, attrsym_t *attr, int defaultValue, int minimum) |
double | late_double (void *obj, attrsym_t *attr, double defaultValue, double minimum) |
double | get_inputscale (graph_t *g) |
char * | late_string (void *obj, attrsym_t *attr, char *defaultValue) |
char * | late_nnstring (void *obj, attrsym_t *attr, char *defaultValue) |
bool | late_bool (void *obj, attrsym_t *attr, bool defaultValue) |
node_t * | UF_find (node_t *n) |
node_t * | UF_union (node_t *u, node_t *v) |
void | UF_singleton (node_t *u) |
void | UF_setname (node_t *u, node_t *v) |
pointf | coord (node_t *n) |
pointf | Bezier (pointf *V, double t, pointf *Left, pointf *Right) |
static strview_t * | mkDirlist (const char *list) |
static char * | findPath (const strview_t *dirs, const char *str) |
const char * | safefile (const char *filename) |
int | maptoken (char *p, char **name, int *val) |
bool | mapBool (const char *p, bool defaultValue) |
bool | mapbool (const char *p) |
pointf | dotneato_closest (splines *spl, pointf pt) |
void | gvToggle (int s) |
int | test_toggle (void) |
void | common_init_node (node_t *n) |
static void | initFontEdgeAttr (edge_t *e, struct fontinfo *fi) |
static void | initFontLabelEdgeAttr (edge_t *e, struct fontinfo *fi, struct fontinfo *lfi) |
static bool | noClip (edge_t *e, attrsym_t *sym) |
Return true if head/tail end of edge should not be clipped to node. | |
static port | chkPort (port(*pf)(node_t *, char *, char *), node_t *n, char *s) |
void | common_init_edge (edge_t *e) |
static boxf | addLabelBB (boxf bb, textlabel_t *lp, bool flipxy) |
boxf | polyBB (polygon_t *poly) |
void | updateBB (graph_t *g, textlabel_t *lp) |
void | compute_bb (graph_t *g) |
bool | is_a_cluster (Agraph_t *g) |
Agsym_t * | setAttr (graph_t *g, void *obj, char *name, char *value, Agsym_t *ap) |
static node_t * | clustNode (node_t *n, graph_t *cg, agxbuf *xb, graph_t *clg) |
static int | cmpItem (void *pp1, void *pp2) |
static void * | newItem (void *p, Dtdisc_t *disc) |
static edge_t * | cloneEdge (edge_t *e, node_t *ct, node_t *ch) |
Make a copy of e in e's graph but using ct and ch as nodes. | |
static void | insertEdge (Dt_t *map, void *t, void *h, edge_t *e) |
static item * | mapEdge (Dt_t *map, edge_t *e) |
Check if we already have cluster edge corresponding to t->h, and return it. | |
static graph_t * | mapc (Dt_t *cmap, node_t *n) |
static int | checkCompound (edge_t *e, graph_t *clg, agxbuf *xb, Dt_t *map, Dt_t *cmap) |
static int | num_clust_edges (graph_t *g) |
void | processClusterEdges (graph_t *g) |
static node_t * | mapN (node_t *n, graph_t *clg) |
static void | undoCompound (edge_t *e, graph_t *clg) |
void | undoClusterEdges (graph_t *g) |
attrsym_t * | safe_dcl (graph_t *g, int obj_kind, char *name, char *defaultValue) |
static int | comp_entities (const void *e1, const void *e2) |
char * | scanEntity (char *t, agxbuf *xb) |
static int | htmlEntity (char **s) |
static unsigned char | cvtAndAppend (unsigned char c, agxbuf *xb) |
char * | htmlEntityUTF8 (char *s, graph_t *g) |
char * | latin1ToUTF8 (char *s) |
Converts string from Latin1 encoding to utf8. Also translates HTML entities. | |
char * | utf8ToLatin1 (char *s) |
bool | overlap_node (node_t *n, boxf b) |
bool | overlap_label (textlabel_t *lp, boxf b) |
static bool | overlap_arrow (pointf p, pointf u, double scale, boxf b) |
static bool | overlap_bezier (bezier bz, boxf b) |
bool | overlap_edge (edge_t *e, boxf b) |
static int | edgeType (const char *s, int defaultValue) |
Convert string to edge type. | |
void | setEdgeType (graph_t *g, int defaultValue) |
void | get_gradient_points (pointf *A, pointf *G, size_t n, double angle, int flags) |
void | gv_free_splines (edge_t *e) |
void | gv_cleanup_edge (edge_t *e) |
void | gv_cleanup_node (node_t *n) |
void | gv_nodesize (node_t *n, bool flip) |
double | drand48 (void) |
static void | fillMap (Agraph_t *g, Dt_t *map) |
Dt_t * | mkClustMap (Agraph_t *g) |
Agraph_t * | findCluster (Dt_t *map, char *name) |
Variables | |
static int | Tflag |
static Dtdisc_t | mapDisc |
static Dtdisc_t | strDisc |
|
static |
Definition at line 564 of file utils.c.
References textlabel_t::dimen, boxf::LL, textlabel_t::pos, boxf::UR, pointf_s::x, and pointf_s::y.
Referenced by compute_bb(), and updateBB().
Definition at line 168 of file utils.c.
References NULL, V, W_DEGREE, pointf_s::x, and pointf_s::y.
Referenced by approx_bezier(), arrow_type_curve(), bezier_clip(), dotneato_closest(), fig_bezier(), findHorizontal(), findVertical(), gdgen_bezier(), pathtolines(), pic_bezier(), place_portlabel(), splineIntersectf(), splitBSpline(), and update_bb_bz().
If endpoint names a cluster, mark for temporary deletion and create special node and insert into cluster. Then clone the edge. Real edge will be deleted when we delete the original node. Invariant: new edge has same sense as old. That is, given t->h with t and h mapped to ct and ch, the new edge is ct->ch.
In the current model, we create a cluster node for each cluster edge between the cluster and some other node or cluster, treating the cluster node as a port on the cluster. This should help with better routing to avoid edge crossings. At present, this is not implemented, so we could use a simpler model in which we create a single cluster node for each cluster used in a cluster edge.
Return 1 if cluster edge is created.
Definition at line 852 of file utils.c.
References agcontains(), aghead, agnameof(), agtail, agwarningf(), cloneEdge(), clustNode(), item::h, insertEdge(), IS_CLUST_NODE, mapc(), mapEdge(), and item::t.
Referenced by processClusterEdges().
Definition at line 484 of file utils.c.
References port::name, and NULL.
Referenced by common_init_edge().
Definition at line 791 of file utils.c.
References agbindrec(), agcopyattr(), agedge(), agraphof(), ED_compound, and NULL.
Referenced by checkCompound(), and undoCompound().
Generate a special cluster node representing the end node of an edge to the cluster cg. n is a node whose name is the same as the cluster cg. clg is the subgraph of all of the original nodes, which will be deleted later.
Definition at line 724 of file utils.c.
References agbindrec(), agnameof(), agnode(), agraphof(), agroot(), agsubnode(), agxbprint(), agxbuse(), cg(), N_label, N_shape, N_style, SET_CLUST_NODE, and setAttr().
Referenced by checkCompound().
void common_init_edge | ( | edge_t * | e | ) |
Definition at line 504 of file utils.c.
References agget(), aghead, aghtmlstr(), agraphof(), agtail, agxget(), chkPort(), E_headclip, E_headlabel, E_label, E_label_float, E_tailclip, E_taillabel, E_xlabel, ED_head_label, ED_head_port, ED_label, ED_label_ontop, ED_tail_label, ED_tail_port, ED_xlabel, EDGE_LABEL, EDGE_XLABEL, fontinfo::fontcolor, fontinfo::fontname, fontinfo::fontsize, GD_has_labels, HEAD_ID, HEAD_LABEL, initFontEdgeAttr(), initFontLabelEdgeAttr(), late_string(), LT_HTML, LT_NONE, make_label(), mapbool(), ND_has_port, ND_shape, noClip(), NULL, str, TAIL_ID, and TAIL_LABEL.
Referenced by circular_init_edge(), cluster_init_graph(), dot_init_edge(), init_edge(), init_node_edge(), neato_init_edge(), sfdp_init_edge(), and twopi_init_edge().
void common_init_node | ( | node_t * | n | ) |
Definition at line 421 of file utils.c.
References aghtmlstr(), agraphof(), agxget(), bind_shape(), DEFAULT_COLOR, DEFAULT_FONTNAME, DEFAULT_FONTSIZE, DEFAULT_NODEHEIGHT, DEFAULT_NODESHAPE, DEFAULT_NODEWIDTH, fontinfo::fontcolor, fontinfo::fontname, fontinfo::fontsize, GD_has_labels, imin(), late_double(), late_int(), late_nnstring(), LT_HTML, LT_NONE, LT_RECD, make_label(), MIN_FONTSIZE, MIN_NODEHEIGHT, MIN_NODEWIDTH, N_fontcolor, N_fontname, N_fontsize, N_height, N_label, N_shape, N_showboxes, N_width, N_xlabel, ND_height, ND_label, ND_shape, ND_showboxes, ND_width, ND_xlabel, NODE_XLABEL, SH_RECORD, shapeOf(), and str.
Referenced by dot_init_node(), finishNode(), init_node(), and neato_init_node().
|
static |
Definition at line 1077 of file utils.c.
References entities_s::name, strview(), and strview_cmp().
Referenced by htmlEntity(), and scanEntity().
void compute_bb | ( | graph_t * | g | ) |
Compute bounding box of g using nodes, splines, and clusters. Assumes bb of clusters already computed. store in GD_bb.
Definition at line 628 of file utils.c.
References add_pointf(), addLabelBB(), AGDATA, agfstnode(), agfstout(), agnnodes(), agnxtnode(), agnxtout(), B2BF, coord(), ED_head_label, ED_label, ED_spl, ED_tail_label, ED_xlabel, EXPANDBB, EXPANDBP, GD_bb, GD_clust, GD_flip, GD_label, GD_n_cluster, boxf::LL, ND_xlabel, ND_xsize, ND_ysize, sub_pointf(), boxf::UR, pointf_s::x, and pointf_s::y.
Referenced by doEdges(), init_nop(), layout(), neato_layout(), packSubgraphs(), polyGraphs(), putGraphs(), and spline_edges().
Definition at line 150 of file utils.c.
References ND_pos, POINTS_PER_INCH, pointf_s::x, and pointf_s::y.
Referenced by average_edge_length(), compute_bb(), emit_begin_node(), fillEdge(), gen_fields(), genPoly(), node_data_new(), QuadTree_add(), QuadTree_add_internal(), QuadTree_get_nearest_internal(), QuadTree_get_quadrant(), QuadTree_get_supernodes_internal(), QuadTree_new_from_point_list(), QuadTree_print_internal(), and right_of().
|
static |
Definition at line 1171 of file utils.c.
References agxbputc(), free(), latin1ToUTF8(), and len().
Referenced by htmlEntityUTF8().
Definition at line 340 of file utils.c.
References Bezier(), DIST2, bezier::list, splines::list, NULL, bezier::size, splines::size, SIZE_MAX, pointf_s::x, and pointf_s::y.
Referenced by edgeMidpoint(), and emit_attachment().
double drand48 | ( | void | ) |
Definition at line 1561 of file utils.c.
Referenced by eval(), generateRandomOrdering(), initLayout(), initPositions(), jitter_d(), move_node(), randompos(), and stress_majorization_kD_mkernel().
|
static |
Definition at line 1385 of file utils.c.
References agwarningf(), EDGETYPE_COMPOUND, EDGETYPE_CURVED, EDGETYPE_LINE, EDGETYPE_NONE, EDGETYPE_ORTHO, EDGETYPE_PLINE, EDGETYPE_SPLINE, and NULL.
Referenced by setEdgeType().
Definition at line 1582 of file utils.c.
References agnameof(), agwarningf(), clust_t::clp, dtinsert, dtmatch, fillMap(), GD_clust, GD_n_cluster, gv_alloc(), and clust_t::name.
Referenced by fillMap(), and mkClustMap().
Definition at line 1613 of file utils.c.
References clust_t::clp, dtmatch, and NULL.
Referenced by getCluster(), and mapc().
|
static |
Definition at line 246 of file utils.c.
References agxbprint(), agxbuse(), DIRSEP, NULL, agxbuf::size, and str.
Referenced by safefile().
Evaluates the extreme points of an ellipse or polygon Determines the point at the center of the extreme points If isRadial is true,sets the inner radius to half the distance to the min point; else uses the angle parameter to identify two points on a line that defines the gradient direction By default, this assumes a left-hand coordinate system (for svg); if RHS = 2 flag is set, use standard coordinate system.
Definition at line 1457 of file utils.c.
References A, center(), flags, G, MAX, MIN, point::x, pointf_s::x, point::y, and pointf_s::y.
Referenced by cairo_gradient_fill(), svg_gradstyle(), and xdot_gradient_fillcolor().
double get_inputscale | ( | graph_t * | g | ) |
Return value for PSinputscale. If this is > 0, it has been set on the command line and this value is used. Otherwise, we check the graph's inputscale attribute. If this is not set or has a bad value, we return -1. If the value is 0, we return the default. Otherwise, we return the value. Set but negative values are treated like 0.
Definition at line 71 of file utils.c.
References agfindgraphattr, is_exactly_zero(), late_double(), POINTS_PER_INCH, and PSinputscale.
Referenced by fdp_layout(), and neato_layout().
void gv_cleanup_edge | ( | edge_t * | e | ) |
Definition at line 1524 of file utils.c.
References agdelrec(), ED_head_label, ED_label, ED_path, ED_tail_label, ED_xlabel, free(), free_label(), gv_free_splines(), and ps.
Referenced by circo_cleanup(), dot_cleanup(), fdp_cleanup(), neato_cleanup(), osage_cleanup(), patchwork_cleanup(), sfdp_cleanup(), twopi_cleanup(), and undoCompound().
void gv_cleanup_node | ( | node_t * | n | ) |
Definition at line 1536 of file utils.c.
References agdelrec(), free(), free_label(), ND_label, ND_pos, ND_shape, and ND_xlabel.
Referenced by circo_cleanup(), fdp_cleanup(), neato_cleanup(), osage_cleanup(), patchwork_cleanup(), sfdp_cleanup(), twopi_cleanup(), and undoClusterEdges().
void gv_free_splines | ( | edge_t * | e | ) |
Definition at line 1514 of file utils.c.
References ED_spl, free(), and NULL.
Referenced by freeEdgeInfo(), gv_cleanup_edge(), and user_spline().
void gv_nodesize | ( | node_t * | n, |
bool | flip | ||
) |
Definition at line 1547 of file utils.c.
References INCH2PS, ND_height, ND_ht, ND_lw, ND_rw, and ND_width.
Referenced by dot_init_node(), init_node(), neato_init_node(), translate_drawing(), and walkTree().
|
static |
Check for an HTML entity for a special character. Assume *s points to first byte after '&'. If successful, return the corresponding value and update s to point after the terminating ';'. On failure, return 0 and leave s unchanged.
Definition at line 1109 of file utils.c.
References comp_entities(), strview_t::data, entities, ENTITY_NAME_LENGTH_MAX, NR_OF_ENTITIES, strview_t::size, str, and entities_s::value.
Referenced by htmlEntityUTF8(), and latin1ToUTF8().
char * htmlEntityUTF8 | ( | char * | s, |
graph_t * | g | ||
) |
substitute html entities like: { and: & with the UTF8 equivalents check for invalid utf8. If found, treat a single byte as Latin-1, convert it to utf8 and warn the user.
Definition at line 1192 of file utils.c.
References agnameof(), agwarningf(), agxbdisown(), agxbputc(), cvtAndAppend(), and htmlEntity().
Referenced by make_html_label(), make_label(), and preprocessTooltip().
Definition at line 451 of file utils.c.
References DEFAULT_COLOR, DEFAULT_FONTNAME, DEFAULT_FONTSIZE, E_fontcolor, E_fontname, E_fontsize, fontinfo::fontcolor, fontinfo::fontname, fontinfo::fontsize, late_double(), late_nnstring(), and MIN_FONTSIZE.
Referenced by common_init_edge(), and initFontLabelEdgeAttr().
|
static |
Definition at line 459 of file utils.c.
References E_labelfontcolor, E_labelfontname, E_labelfontsize, fontinfo::fontcolor, fontinfo::fontname, fontinfo::fontsize, initFontEdgeAttr(), late_double(), late_nnstring(), and MIN_FONTSIZE.
Referenced by common_init_edge().
bool is_a_cluster | ( | Agraph_t * | g | ) |
Definition at line 690 of file utils.c.
References agget(), agnameof(), mapbool(), and Agraph_s::root.
Referenced by cloneSubg(), cntCluster(), compile_clusters(), compile_samerank(), deriveClusters(), dfs(), is_cluster(), mkClusters(), mkClusters(), mkClusters(), projectG(), and subgInduce().
bool late_bool | ( | void * | obj, |
attrsym_t * | attr, | ||
bool | defaultValue | ||
) |
Definition at line 91 of file utils.c.
References agxget(), mapbool(), and NULL.
Referenced by addXLabels(), find_blocks(), and getAttrBool().
double late_double | ( | void * | obj, |
attrsym_t * | attr, | ||
double | defaultValue, | ||
double | minimum | ||
) |
Definition at line 48 of file utils.c.
References ag_xget.
Referenced by arrow_length(), circular_init_edge(), common_init_node(), do_graph_label(), emit_begin_edge(), emit_clusters(), emit_edge_graphics(), fdp_initParams(), fullArea(), get_inputscale(), getArea(), graph_init(), init_edge(), init_gvc(), initFontEdgeAttr(), initFontLabelEdgeAttr(), initGraphAttrs(), majorization(), makeObstacle(), neato_init_edge(), place_portlabel(), point_gencode(), point_init(), point_inside(), poly_init(), poly_inside(), record_inside(), setClustNodes(), setPrismValues(), star_inside(), stylenode(), tuneControl(), twopi_init_edge(), and userSize().
int late_int | ( | void * | obj, |
attrsym_t * | attr, | ||
int | defaultValue, | ||
int | minimum | ||
) |
Definition at line 33 of file utils.c.
Referenced by adjustRanks(), checkExp(), clust_ht(), common_init_node(), contain_nodes(), contain_subclust(), dot_init_edge(), dotLayout(), emit_background(), emit_clusters(), fdp_init_graph(), fdp_initParams(), finalCC(), graph_init(), init_graph(), keepout_othernodes(), l_int(), layout(), neato_init_graph(), point_init(), poly_gencode(), poly_init(), record_gencode(), separate_subclust(), set_ycoords(), sfdp_init_graph(), and tuneControl().
char * late_nnstring | ( | void * | obj, |
attrsym_t * | attr, | ||
char * | defaultValue | ||
) |
Definition at line 84 of file utils.c.
References late_string().
Referenced by checkStyle(), common_init_node(), do_graph_label(), emit_edge_graphics(), findCharset(), findFillDflt(), init_gvc(), initFontEdgeAttr(), initFontLabelEdgeAttr(), isFilled(), penColor(), and write_plain().
char * late_string | ( | void * | obj, |
attrsym_t * | attr, | ||
char * | defaultValue | ||
) |
Definition at line 78 of file utils.c.
References agxget().
Referenced by clust_in_layer(), common_init_edge(), do_ordering_for_nodes(), dot_init_edge(), edge_in_layer(), emit_edge(), emit_edge_graphics(), emit_end_edge(), emit_graph(), emit_node(), getAttrStr(), getRankseps(), graph_init(), late_nnstring(), node_in_layer(), ordered_edges(), poly_gencode(), poly_init(), and record_init().
char * latin1ToUTF8 | ( | char * | s | ) |
Definition at line 1271 of file utils.c.
References agxbdisown(), agxbputc(), and htmlEntity().
Referenced by cvtAndAppend(), make_html_label(), make_label(), preprocessTooltip(), and stoj().
bool mapbool | ( | const char * | p | ) |
Definition at line 335 of file utils.c.
References mapBool().
Referenced by angleSet(), circularLayout(), common_init_edge(), dot_mincross(), dot_rank(), dotLayout(), emit_begin_edge(), emit_end_edge(), findRootNode(), gdgen_begin_page(), get_imagescale(), getAdjustMode(), graph_init(), init_nop(), initialPositions(), is_a_cluster(), is_a_strong_cluster(), is_nonconstraint(), late_bool(), majorization(), neato_layout(), noClip(), nonconstraint_edge(), poly_init(), record_init(), tuneControl(), user_pos(), and visible().
bool mapBool | ( | const char * | p, |
bool | defaultValue | ||
) |
Definition at line 319 of file utils.c.
References gv_isdigit().
Referenced by getAdjustMode(), mapbool(), and tuneControl().
Definition at line 829 of file utils.c.
References agnameof(), findCluster(), NULL, and startswith().
Referenced by checkCompound().
Convert cluster nodes back to ordinary nodes If n is already ordinary, return it. Otherwise, we know node's name is "__i:xxx" where i is some number and xxx is the nodes's original name. Create new node of name xxx if it doesn't exist and add n to clg for later deletion.
Definition at line 978 of file utils.c.
References agbindrec(), agfindnode, agnameof(), AGNODE, agnode(), agnxtattr(), agraphof(), agsubnode(), agxget(), agxset(), Agsym_s::defval, IS_CLUST_NODE, NULL, and SET_CLUST_NODE.
Referenced by undoCompound().
int maptoken | ( | char * | p, |
char ** | name, | ||
int * | val | ||
) |
Definition at line 309 of file utils.c.
References streq().
Referenced by graph_init(), and rank_set_class().
Generates a dictionary mapping cluster names to corresponding cluster. Used with cgraph as the latter does not support a flat namespace of clusters. Assumes G has already built a cluster tree using GD_n_cluster and GD_clust.
Definition at line 1603 of file utils.c.
References dtopen(), Dtoset, fillMap(), and strDisc.
Referenced by dot_compoundEdges(), and processClusterEdges().
|
static |
Definition at line 234 of file utils.c.
References cnt(), gv_calloc(), gv_recalloc(), PATHSEP, tok(), tok_end(), tok_get(), and tok_next().
Referenced by safefile().
|
static |
|
static |
Definition at line 922 of file utils.c.
References HAS_CLUST_EDGE, and cl_edge_t::n_cluster_edges.
Referenced by undoClusterEdges().
Definition at line 1341 of file utils.c.
References arrow_bb(), OVERLAP, and scale().
Referenced by overlap_bezier().
Definition at line 1347 of file utils.c.
References bezier::eflag, bezier::ep, lineToBox(), bezier::list, overlap_arrow(), bezier::sflag, bezier::size, and bezier::sp.
Referenced by overlap_edge().
Definition at line 1369 of file utils.c.
References splines::bb, boxf_overlap(), ED_label, ED_spl, splines::list, overlap_bezier(), overlap_label(), and splines::size.
Referenced by gvevent_find_obj().
bool overlap_label | ( | textlabel_t * | lp, |
boxf | b | ||
) |
Definition at line 1334 of file utils.c.
References add_pointf(), textlabel_t::dimen, boxf::LL, OVERLAP, textlabel_t::pos, sub_pointf(), pointf_s::x, and pointf_s::y.
Referenced by edge_in_box(), and overlap_edge().
Definition at line 1322 of file utils.c.
References boxf::LL, mid_pointf(), inside_t::n, ND_bb, ND_coord, ND_shape, OVERLAP, inside_t::s, sub_pointf(), and boxf::UR.
Referenced by gvevent_find_obj().
Compute the bounding box of a polygon. We only need to use the outer periphery.
Definition at line 599 of file utils.c.
References boxf::LL, MAX, MIN, boxf::UR, pointf_s::x, and pointf_s::y.
Referenced by makeObstacle(), and poly_inside().
void processClusterEdges | ( | graph_t * | g | ) |
Look for cluster edges. Replace cluster edge endpoints corresponding to a cluster with special cluster nodes. Delete original nodes. If cluster edges are found, a cl_edge_t record will be attached to the graph, containing the count of such edges.
Definition at line 936 of file utils.c.
References agbindrec(), agclose(), agdelete(), agfstnode(), agfstout(), agnxtnode(), agnxtout(), agsubg(), agxbfree(), checkCompound(), CL_EDGE_TAG, dtclose(), dtopen(), Dtoset, IS_CLUST_NODE, mapDisc, mkClustMap(), and cl_edge_t::n_cluster_edges.
Referenced by fdp_init_node_edge().
Find the attribute belonging to graph g for objects like obj with given name. If one does not exist, create it with the default value defaultValue.
Definition at line 1070 of file utils.c.
References agattr(), and NULL.
Referenced by attach_attrs_and_arrows(), xdot_begin_graph(), and xdot_end_graph().
const char * safefile | ( | const char * | filename | ) |
Definition at line 258 of file utils.c.
References agwarningf(), DIRSEP, findPath(), free(), Gvfilepath, Gvimagepath, HTTPServerEnVar, mkDirlist(), NULL, onetime, and str.
Referenced by bind_shape(), cat_libfile(), epsf_init(), gvloadimage_rsvg_load(), and gvusershape_file_access().
char * scanEntity | ( | char * | t, |
agxbuf * | xb | ||
) |
Scan non-numeric entity, convert to &#...; form and store in xbuf. t points to first char after '&'. Return after final semicolon. If unknown, we return t and let libexpat flag the error.
Definition at line 1087 of file utils.c.
References agxbprint(), agxbputc(), comp_entities(), strview_t::data, entities, ENTITY_NAME_LENGTH_MAX, NR_OF_ENTITIES, strview_t::size, strview(), and entities_s::value.
Sets object's name attribute to the given value. Creates the attribute if not already set.
Definition at line 699 of file utils.c.
References agattr(), AGEDGE, AGNODE, agobjkind(), AGRAPH, agxset(), and NULL.
Referenced by clustNode().
void setEdgeType | ( | graph_t * | g, |
int | defaultValue | ||
) |
Sets graph's edge type based on the "splines" attribute. If the attribute is not defined, use defaultValue. If the attribute is "", use NONE. If attribute value matches (case indepedent), use match. ortho => EDGETYPE_ORTHO none => EDGETYPE_NONE line => EDGETYPE_LINE polyline => EDGETYPE_PLINE spline => EDGETYPE_SPLINE If attribute is boolean, true means EDGETYPE_SPLINE, false means EDGETYPE_LINE. Else warn and use default.
Definition at line 1434 of file utils.c.
References agget(), edgeType(), EDGETYPE_NONE, and GD_flags.
Referenced by circo_init_graph(), cluster_init_graph(), dotLayout(), fdp_init_graph(), make_flat_adj_edges(), neato_init_graph(), neato_layout(), patchwork_init_graph(), sfdp_init_graph(), sfdp_layout(), and twopi_init_graph().
int test_toggle | ( | void | ) |
Definition at line 410 of file utils.c.
References Tflag.
Referenced by move_node().
Definition at line 98 of file utils.c.
References ND_UF_parent.
Referenced by class1(), class2(), decompose(), expand_ranksets(), interclust1(), leader_of(), minmax_edges(), minmax_edges2(), search_component(), UF_setname(), and UF_union().
Definition at line 143 of file utils.c.
References ND_UF_parent, ND_UF_size, and UF_find().
Referenced by mark_clusters().
void UF_singleton | ( | node_t * | u | ) |
Definition at line 136 of file utils.c.
References ND_ranktype, ND_UF_parent, ND_UF_size, NORMAL, and NULL.
Referenced by expand_ranksets(), and mark_clusters().
Definition at line 108 of file utils.c.
References ND_id, ND_UF_parent, ND_UF_size, NULL, and UF_find().
Referenced by cluster_leader(), and collapse_rankset().
void undoClusterEdges | ( | graph_t * | g | ) |
Replace cluster nodes with originals. Make sure original has no attributes. Replace original edges. Delete cluster nodes, which will also delete cluster edges.
Definition at line 1035 of file utils.c.
References agbindrec(), agclose(), agdelete(), agfstnode(), agfstout(), agnxtnode(), agnxtout(), agsubg(), ED_compound, free(), gv_calloc(), gv_cleanup_node(), num_clust_edges(), and undoCompound().
Referenced by attach_attrs_and_arrows(), and dot_begin_graph().
Definition at line 1005 of file utils.c.
References aghead, agtail, cloneEdge(), ED_head_label, ED_label, ED_spl, ED_tail_label, ED_xlabel, gv_cleanup_edge(), mapN(), and NULL.
Referenced by undoClusterEdges().
void updateBB | ( | graph_t * | g, |
textlabel_t * | lp | ||
) |
Reset graph's bounding box to include bounding box of the given label. Assume the label's position has been set.
Definition at line 619 of file utils.c.
References addLabelBB(), GD_bb, and GD_flip.
Referenced by addXLabels(), dot_splines_(), make_flat_adj_edges(), makePortLabels(), makeSelfArcs(), and setEdgeLabelPos().
char * utf8ToLatin1 | ( | char * | s | ) |
Converts string from utf8 encoding to Latin1 Note that it does not attempt to reproduce HTML entities. We assume the input string comes from latin1ToUTF8.
Definition at line 1304 of file utils.c.
References agxbdisown(), and agxbputc().
Referenced by ps_string().
|
static |
Definition at line 781 of file utils.c.
Referenced by processClusterEdges().
|
static |
Definition at line 1575 of file utils.c.
Referenced by mkClustMap().
|
static |
Definition at line 400 of file utils.c.
Referenced by gvToggle(), and test_toggle().