Edge Attributes

Attributes you can set on graph edges

Examples of edge statements:

edge [name0=val0] sets default edge attribute name0 to val0. Any edge appearing after this inherits the new default attributes.

n1 -> n2 [name1=val1] or n1 \-\- n2 [name1=val1] creates directed or undirected edge between nodes n1 and n2 and sets its attributes according to the optional list and default attributes for edges.

  • arrowhead – Style of arrowhead on the head node of an edge.
  • arrowsize – Multiplicative scale factor for arrowheads.
  • arrowtail – Style of arrowhead on the tail node of an edge.
  • class – Classnames to attach to the node, edge, graph, or cluster’s SVG element. For svg only.
  • color – Basic drawing color for graphics, not text.
  • colorscheme – A color scheme namespace: the context for interpreting color names.
  • comment – Comments are inserted into output.
  • constraint – If false, the edge is not used in ranking the nodes. For dot only.
  • decorate – Whether to connect the edge label to the edge with a line.
  • dir – Edge type for drawing arrowheads.
  • edgehref – Synonym for edgeURL. For map, svg only.
  • edgetarget – Browser window to use for the edgeURL link. For map, svg only.
  • edgetooltip – Tooltip annotation attached to the non-label part of an edge. For cmap, svg only.
  • edgeURL – The link for the non-label parts of an edge. For map, svg only.
  • fillcolor – Color used to fill the background of a node or cluster.
  • fontcolor – Color used for text.
  • fontname – Font used for text.
  • fontsize – Font size, in points, used for text.
  • head_lp – Center position of an edge’s head label. For write only.
  • headclip – If true, the head of an edge is clipped to the boundary of the head node.
  • headhref – Synonym for headURL. For map, svg only.
  • headlabel – Text label to be placed near head of edge.
  • headport – Indicates where on the head node to attach the head of the edge.
  • headtarget – Browser window to use for the headURL link. For map, svg only.
  • headtooltip – Tooltip annotation attached to the head of an edge. For cmap, svg only.
  • headURL – If defined, headURL is output as part of the head label of the edge. For map, svg only.
  • href – Synonym for URL. For map, postscript, svg only.
  • id – Identifier for graph objects. For map, postscript, svg only.
  • label – Text label attached to objects.
  • labelangle – The angle (in degrees) in polar coordinates of the head & tail edge labels.
  • labeldistance – Scaling factor for the distance of headlabel / taillabel from the head / tail nodes.
  • labelfloat – If true, allows edge labels to be less constrained in position.
  • labelfontcolor – Color used for headlabel and taillabel.
  • labelfontname – Font for headlabel and taillabel.
  • labelfontsize – Font size of headlabel and taillabel.
  • labelhref – Synonym for labelURL. For map, svg only.
  • labeltarget – Browser window to open labelURL links in. For map, svg only.
  • labeltooltip – Tooltip annotation attached to label of an edge. For cmap, svg only.
  • labelURL – If defined, labelURL is the link used for the label of an edge. For map, svg only.
  • layer – Specifies layers in which the node, edge or cluster is present.
  • len – Preferred edge length, in inches. For neato, fdp only.
  • lhead – Logical head of an edge. For dot only.
  • lp – Label center position. For write only.
  • ltail – Logical tail of an edge. For dot only.
  • minlen – Minimum edge length (rank difference between head and tail). For dot only.
  • nojustify – Whether to justify multiline text vs the previous text line (rather than the side of the container).
  • penwidth – Specifies the width of the pen, in points, used to draw lines and curves.
  • pos – Position of node, or spline control points. For neato, fdp only.
  • samehead – Edges with the same head and the same samehead value are aimed at the same point on the head. For dot only.
  • sametail – Edges with the same tail and the same sametail value are aimed at th. For dot only.
  • showboxes – Print guide boxes for debugging. For dot only.
  • style – Set style information for components of the graph.
  • tail_lp – Position of an edge’s tail label, in points. For write only.
  • tailclip – If true, the tail of an edge is clipped to the boundary of the tail node.
  • tailhref – Synonym for tailURL. For map, svg only.
  • taillabel – Text label to be placed near tail of edge.
  • tailport – Indicates where on the tail node to attach the tail of the edge.
  • tailtarget – Browser window to use for the tailURL link. For map, svg only.
  • tailtooltip – Tooltip annotation attached to the tail of an edge. For cmap, svg only.
  • tailURL – If defined, tailURL is output as part of the tail label of th. For map, svg only.
  • target – If the object has a URL, this attribute determines which window of the browser is used for the URL. For map, svg only.
  • tooltip – Tooltip (mouse hover text) attached to the node, edge, cluster, or graph. For cmap, svg only.
  • URL – Hyperlinks incorporated into device-dependent output. For map, postscript, svg only.
  • weight – Weight of edge.
  • xlabel – External label for a node or edge.
  • xlp – Position of an exterior label, in points. For write only.
Last modified September 17, 2022: Update _index.md: remove stray code tag (ac45e30)