graphviz-2999.20.0.3: Bindings to Graphviz for graph visualisation.

Copyright(c) Ivan Lazar Miljenovic
License3-Clause BSD-style
MaintainerIvan.Miljenovic@gmail.com
Safe HaskellNone
LanguageHaskell2010

Data.GraphViz.Attributes.HTML

Description

This module is written to be imported qualified. It defines the syntax for HTML-like values for use in Graphviz. Please note that these values are not really HTML, but the term "HTML" is used throughout as it is less cumbersome than "HTML-like". To be able to use this, the version of Graphviz must be at least 1.10. For more information, please see: http://graphviz.org/doc/info/shapes.html#html

The actual definition of the syntax specifies that these types must be valid XML syntax. As such, this assumed when printing and parsing, though the correct escape/descaping for ", &, < and > are automatically done when printing and parsing.

Differences from how Graphviz treats HTML-like values:

  • Graphviz only specifies the above-listed characters must be escaped; however, internally it also escapes -, ' and multiple sequences of spaces. This library attempts to match this behaviour. Please let me know if this behaviour (especially about escaping multiple spaces) is unwanted.
  • When parsing escaped HTML characters, numeric escapes are converted to the corresponding character as are the various characters listed above; all other escaped characters (apart from those listed above) are silently ignored and removed from the input (since technically these must be valid XML, which doesn't recognise as many named escape characters as does HTML).
  • All whitespace read in is kept (even if Graphviz would ignore multiple whitespace characters); when printing them, however, they are replaced with non-breaking spaces. As such, if multiple literal whitespace characters are used in a sequence, then the result of parsing and then printing some Dot code will not be the same as the initial Dot code. Furthermore, all whitespace characters are printed as spaces.
  • It is assumed that all parsed & values are the beginning of an XML escape sequence (which must finish with a ; character).
  • There should be no pre-escaped characters in values; when printing, the & will get escaped without considering if that is an escaped character.
Synopsis

Documentation

data Label Source #

The overall type for HTML-like labels. Fundamentally, HTML-like values in Graphviz are either textual (i.e. a single element with formatting) or a table. Note that Label values can be nested via LabelCell.

Constructors

Text Text 
Table Table 

type Text = [TextItem] Source #

Represents a textual component of an HTML-like label. It is assumed that a Label list is non-empty. It is preferable to "group" Str values together rather than have individual ones. Note that when printing, the individual values are concatenated together without spaces, and when parsing anything that isn't a tag is assumed to be a Str: that is, something like "<BR/> <BR/>" is parsed as:

[Newline [], Str " ", Newline []]

data TextItem Source #

Textual items in HTML-like labels.

Constructors

Str Text 
Newline Attributes

Only accepts an optional Attribute Attribute; defined this way for ease of printing/parsing.

Font Attributes Text 
Format Format Text

Only available in Graphviz >= 2.28.0.

Instances
Eq TextItem Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Ord TextItem Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Read TextItem Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Show TextItem Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

ParseDot TextItem Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

PrintDot TextItem Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Labellable Text Source # 
Instance details

Defined in Data.GraphViz.Attributes

data Format Source #

Constructors

Italics 
Bold 
Underline 
Overline

Requires Graphviz >= 2.38.0.

Subscript 
Superscript 
Instances
Bounded Format Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Enum Format Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Eq Format Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

(==) :: Format -> Format -> Bool #

(/=) :: Format -> Format -> Bool #

Ord Format Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Read Format Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Show Format Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

ParseDot Format Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

PrintDot Format Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

data Table Source #

A table in HTML-like labels. Tables are optionally wrapped in overall FONT tags.

Constructors

HTable 

Fields

data Row Source #

A row in a Label. The list of Cell values is assumed to be non-empty.

Constructors

Cells [Cell] 
HorizontalRule

Should be between Cells values, requires Graphviz >= 2.29.0

Instances
Eq Row Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

(==) :: Row -> Row -> Bool #

(/=) :: Row -> Row -> Bool #

Ord Row Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

compare :: Row -> Row -> Ordering #

(<) :: Row -> Row -> Bool #

(<=) :: Row -> Row -> Bool #

(>) :: Row -> Row -> Bool #

(>=) :: Row -> Row -> Bool #

max :: Row -> Row -> Row #

min :: Row -> Row -> Row #

Read Row Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Show Row Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

showsPrec :: Int -> Row -> ShowS #

show :: Row -> String #

showList :: [Row] -> ShowS #

ParseDot Row Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

PrintDot Row Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

data Cell Source #

Cells either recursively contain another Label or else a path to an image file.

Constructors

LabelCell Attributes Label 
ImgCell Attributes Img 
VerticalRule

Should be between LabelCell or ImgCell values, requires Graphviz >= 2.29.0

newtype Img Source #

The path to an image; accepted Attributes are Attribute and Src.

Constructors

Img Attributes 
Instances
Eq Img Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

(==) :: Img -> Img -> Bool #

(/=) :: Img -> Img -> Bool #

Ord Img Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

compare :: Img -> Img -> Ordering #

(<) :: Img -> Img -> Bool #

(<=) :: Img -> Img -> Bool #

(>) :: Img -> Img -> Bool #

(>=) :: Img -> Img -> Bool #

max :: Img -> Img -> Img #

min :: Img -> Img -> Img #

Read Img Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Show Img Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

showsPrec :: Int -> Img -> ShowS #

show :: Img -> String #

showList :: [Img] -> ShowS #

ParseDot Img Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

PrintDot Img Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

type Attributes = [Attribute] Source #

The various HTML-like label-specific attributes being used.

data Attribute Source #

Note that not all Attribute values are valid everywhere: see the comments for each one on where it is valid.

Constructors

Align Align

Valid for: Label, Cell, Newline.

BAlign Align

Valid for: Cell.

BGColor Color

Valid for: Label (including tableFontAttrs), Cell, Font.

Border Word8

Valid for: Label, Cell. Default is 1; 0 represents no border.

CellBorder Word8

Valid for: Label. Default is 1; 0 represents no border.

CellPadding Word8

Valid for: Label, Cell. Default is 2.

CellSpacing Word8

Valid for: Label, Cell. Default is 2; maximum is 127.

Color Color

Valid for: Label, Cell.

ColSpan Word16

Valid for: Cell. Default is 1.

Columns CellFormat

Valid for: Label. Requires Graphviz >= 2.40.1

Face Text

Valid for: tableFontAttrs, Font.

FixedSize Bool

Valid for: Label, Cell. Default is False.

GradientAngle Int

Valid for: Label, Cell. Default is 0. Requires Graphviz >= 2.40.1

Height Word16

Valid for: Label, Cell.

HRef Text

Valid for: Label, Cell.

ID Text

Valid for: Label, Cell. Requires Graphviz >= 2.29.0

PointSize Double

Valid for: tableFontAttrs, Font.

Port PortName

Valid for: Label, Cell.

Rows CellFormat

Valid for: Label. Requires Graphviz >= 2.40.1

RowSpan Word16

Valid for: Cell.

Scale Scale

Valid for: Img.

Sides [Side]

Valid for: Label, Cell. Default is [LeftSide, TopSide, RightSide, BottomSide]. Requires Graphviz >= 2.40.1

Src FilePath

Valid for: Img.

Style Style

Valid for: Label, Cell. Requires Graphviz >= 2.40.1

Target Text

Valid for: Label, Cell.

Title Text

Valid for: Label, Cell. Has an alias of TOOLTIP.

VAlign VAlign

Valid for: Label, Cell.

Width Word16

Valid for: Label, Cell.

data Align Source #

Specifies horizontal placement. When an object is allocated more space than required, this value determines where the extra space is placed left and right of the object.

Constructors

HLeft 
HCenter

Default value.

HRight 
HText

LabelCell values only; aligns lines of text using the full cell width. The alignment of a line is determined by its (possibly implicit) associated Newline element.

Instances
Bounded Align Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Enum Align Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Eq Align Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

(==) :: Align -> Align -> Bool #

(/=) :: Align -> Align -> Bool #

Ord Align Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

compare :: Align -> Align -> Ordering #

(<) :: Align -> Align -> Bool #

(<=) :: Align -> Align -> Bool #

(>) :: Align -> Align -> Bool #

(>=) :: Align -> Align -> Bool #

max :: Align -> Align -> Align #

min :: Align -> Align -> Align #

Read Align Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Show Align Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

showsPrec :: Int -> Align -> ShowS #

show :: Align -> String #

showList :: [Align] -> ShowS #

ParseDot Align Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

PrintDot Align Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

data VAlign Source #

Specifies vertical placement. When an object is allocated more space than required, this value determines where the extra space is placed above and below the object.

Constructors

HTop 
HMiddle

Default value.

HBottom 
Instances
Bounded VAlign Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Enum VAlign Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Eq VAlign Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

(==) :: VAlign -> VAlign -> Bool #

(/=) :: VAlign -> VAlign -> Bool #

Ord VAlign Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Read VAlign Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Show VAlign Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

ParseDot VAlign Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

PrintDot VAlign Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

data CellFormat Source #

Constructors

RuleBetween 
Instances
Bounded CellFormat Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Enum CellFormat Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Eq CellFormat Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Ord CellFormat Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Read CellFormat Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Show CellFormat Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

ParseDot CellFormat Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

PrintDot CellFormat Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

data Scale Source #

Specifies how an image will use any extra space available in its cell. If undefined, the image inherits the value of the ImageScale attribute.

Instances
Bounded Scale Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Enum Scale Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Eq Scale Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

(==) :: Scale -> Scale -> Bool #

(/=) :: Scale -> Scale -> Bool #

Ord Scale Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

compare :: Scale -> Scale -> Ordering #

(<) :: Scale -> Scale -> Bool #

(<=) :: Scale -> Scale -> Bool #

(>) :: Scale -> Scale -> Bool #

(>=) :: Scale -> Scale -> Bool #

max :: Scale -> Scale -> Scale #

min :: Scale -> Scale -> Scale #

Read Scale Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Show Scale Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

showsPrec :: Int -> Scale -> ShowS #

show :: Scale -> String #

showList :: [Scale] -> ShowS #

ParseDot Scale Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

PrintDot Scale Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

data Side Source #

Which sides of a border in a cell or table should be drawn, if a border is drawn.

Instances
Bounded Side Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Enum Side Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

succ :: Side -> Side #

pred :: Side -> Side #

toEnum :: Int -> Side #

fromEnum :: Side -> Int #

enumFrom :: Side -> [Side] #

enumFromThen :: Side -> Side -> [Side] #

enumFromTo :: Side -> Side -> [Side] #

enumFromThenTo :: Side -> Side -> Side -> [Side] #

Eq Side Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

(==) :: Side -> Side -> Bool #

(/=) :: Side -> Side -> Bool #

Ord Side Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

compare :: Side -> Side -> Ordering #

(<) :: Side -> Side -> Bool #

(<=) :: Side -> Side -> Bool #

(>) :: Side -> Side -> Bool #

(>=) :: Side -> Side -> Bool #

max :: Side -> Side -> Side #

min :: Side -> Side -> Side #

Read Side Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Show Side Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

showsPrec :: Int -> Side -> ShowS #

show :: Side -> String #

showList :: [Side] -> ShowS #

ParseDot Side Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

PrintDot Side Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

data Style Source #

Constructors

Rounded

Valid for Label

Radial

Valid for Label, Cell.

Instances
Bounded Style Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Enum Style Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Eq Style Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

(==) :: Style -> Style -> Bool #

(/=) :: Style -> Style -> Bool #

Ord Style Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

compare :: Style -> Style -> Ordering #

(<) :: Style -> Style -> Bool #

(<=) :: Style -> Style -> Bool #

(>) :: Style -> Style -> Bool #

(>=) :: Style -> Style -> Bool #

max :: Style -> Style -> Style #

min :: Style -> Style -> Style #

Read Style Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Show Style Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

Methods

showsPrec :: Int -> Style -> ShowS #

show :: Style -> String #

showList :: [Style] -> ShowS #

ParseDot Style Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML

PrintDot Style Source # 
Instance details

Defined in Data.GraphViz.Attributes.HTML