HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulegraphviz-2999.20.2.0Haskell2010

Data.GraphViz.Attributes

There are almost 150 possible attributes available for Dot graphs, and it can be difficult to know which ones to use. This module provides helper functions for the most commonly used ones.

The complete list of all possible attributes can be found in Data.GraphViz.Attributes.Complete; it is possible to use both of these modules if you require specific extra attributes that are not provided here.

  • 9 types
  • 1 class
  • 49 values

The definition of attributes

2 declarations
datadata Attribute
#

Attributes are used to customise the layout and design of Dot graphs. Care must be taken to ensure that the attribute you use is valid, as not all attributes can be used everywhere.

Instances6Eq, Ord, Read, Show, ParseDot, PrintDot
  • Eq AttributeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Complete
  • Ord AttributeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Complete
  • Read AttributeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Complete
  • Show AttributeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Complete
  • ParseDot AttributeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Complete
  • PrintDot AttributeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Complete

Creating labels

7 declarations

The following escape codes are available for labels (where applicable):

\N

Replace with the name of the node.

\G

Replace with the name of the graph (for node attributes) or the name of the graph or cluster, whichever is applicable (for graph, cluster and edge attributes).

\E

Replace with the name of the edge, formed by the two adjoining nodes and the edge type.

\T

Replace with the name of the node the edge is coming from.

\H

Replace with the name of the node the edge is going to.

\n

Centered newline.

\l

Left-justified newline.

\r

Right-justified newline.

valuexLabel :: Labellable a => a -> Attribute
#

Create a label outside of a node/edge. Currently only in the Graphviz development branch (2.29.*).

classclass Labellable a where
#

A convenience class to make it easier to create labels. It is highly recommended that you make any other types that you wish to create labels from an instance of this class, preferably via the String or Text instances.

Methods

Instances14Labellable, …

Colors

8 declarations

The recommended way of dealing with colors in Dot graphs is to use the named X11Colors rather than explicitly specifying RGB, RGBA or HSV colors.

These functions also allow you to use SVG and Brewer colors, but X11 colors are generally preferable. If you wish to use SVG colors, either import this module hiding X11Color or import the SVG module qualified.

datadata X11Color
#

The X11 colors that Graphviz uses. Note that these are slightly different from the "normal" X11 colors used (e.g. the inclusion of Crimson). Graphviz's list of colors also duplicated almost all Gray colors with Grey ones; parsing of an X11Color which is specified using "grey" will succeed, even for those that don't have the duplicate spelling (e.g. DarkSlateGray1).

Constructors

Instances9Bounded, Enum, Eq, Ord, Read, Show, …
  • Bounded X11ColorDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Colors.X11
  • Enum X11ColorDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Colors.X11
  • Eq X11ColorDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Colors.X11
  • Ord X11ColorDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Colors.X11
  • Read X11ColorDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Colors.X11
  • Show X11ColorDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Colors.X11
  • ParseDot X11ColorDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Colors.X11
  • PrintDot X11ColorDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Colors.X11
  • NamedColor X11ColorDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Colors
valuefillColor :: NamedColor nc => nc -> Attribute
#

Specify the fill color of a node, cluster or arrowhead. Requires style filled for nodes and clusters. For nodes and edges, if this isn't set then the color value is used instead; for clusters, bgColor is used.

valuecolor :: NamedColor nc => nc -> Attribute
#

The color attribute serves several purposes. As such care must be taken when using it, and it is preferable to use those alternatives that are available when they exist.

  • The color of edges;

  • The bounding color of nodes;

  • The bounding color of clusters (i.e. equivalent to penColor);

  • If the filled Style is set, then it defines the background color of nodes and clusters unless fillColor or bgColor respectively is set.

Stylistic attributes

17 declarations

Various stylistic attributes to customise how items are drawn. Unless specified otherwise, all Styles are available for nodes; those specified also can be used for edges and clusters.

valuestriped :: Style
#

Only available for rectangularly-shaped nodes and clusters. Requires Graphviz >= 2.30.0.

valuewedged :: Style
#

Only available for elliptically-shaped nodes. Requires Graphviz >= 2.30.0.

valuetapered :: Style
#

Only available for edges; creates a tapered edge between the two nodes. Requires Graphviz >= 2.29.0.

valueradial :: Style
#

Available for nodes, clusters and edges. When using gradientAngle, indicates that a radial gradient should be used. Requires Graphviz >= 2.29.0.

Node shapes

2 declarations
datadata Shape
#

Geometries of shapes are affected by the attributes Regular, Peripheries and Orientation.

Constructors

Instances8Bounded, Enum, Eq, Ord, Read, Show, …
  • Bounded ShapeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Enum ShapeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Eq ShapeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Ord ShapeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Read ShapeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Show ShapeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot ShapeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • PrintDot ShapeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values

Edge arrows

2 declarations

Specifying where to draw arrows on an edge.

datadata DirType
#

Specify where to place arrow heads on an edge.

Constructors

  • Forward

    Draw a directed edge with an arrow to the node it's pointing go.

  • Back

    Draw a reverse directed edge with an arrow to the node it's coming from.

  • Both

    Draw arrows on both ends of the edge.

  • NoDir

    Draw an undirected edge.

Instances8Bounded, Enum, Eq, Ord, Read, Show, …
  • Bounded DirTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Enum DirTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Eq DirTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Ord DirTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Read DirTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Show DirTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot DirTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • PrintDot DirTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values

Default arrow types.

typetype Arrow = ArrowType
#

A particular way of drawing the end of an edge.

The 9 primitive arrows.

5 derived arrows.

Layout

4 declarations
valueordering :: Order -> Attribute
#

Specify an ordering of edges of a node: either the outgoing or the incoming edges of a node must appear left-to-right in the same order in which they are defined in the input.

When specified as both a global graph or sub-graph level attribute, then it takes precedence over an attribute specified for an individual node.

datadata Order
#

Constructors

  • OutEdges

    Draw outgoing edges in order specified.

  • InEdges

    Draw incoming edges in order specified.

Instances8Bounded, Enum, Eq, Ord, Read, Show, …
  • Bounded OrderDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Enum OrderDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Eq OrderDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Ord OrderDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Read OrderDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Show OrderDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot OrderDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • PrintDot OrderDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
valuerank :: RankType -> Attribute
#

When using dot, this allows you to control relative placement of sub-graphs and clusters.

datadata RankType
#
Instances8Bounded, Enum, Eq, Ord, Read, Show, …
  • Bounded RankTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Enum RankTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Eq RankTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Ord RankTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Read RankTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • Show RankTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot RankTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • PrintDot RankTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values