Maintainer | Ivan.Miljenovic@gmail.com |
---|
This module defines the various attributes that different parts of a GraphViz graph can have. These attributes are based on the documentation found at:
http://graphviz.org/doc/info/attrs.html
For more information on usage, etc. please see that document.
A summary of known current constraints/limitations/differences:
- Parsing of quoted strings might not always work if they are a
sub-part of another Attribute (e.g. a quoted name in
LayerList
). In fact, parsing with quotes is iffy for everything; specifically when they are and aren't allowed. -
ColorScheme
is ignored when parsingColor
values - ColorList and PointfList are defined as actual lists (but
LayerList
is not). - A lot of values have a possible value of
none
. These now have custom constructors. In fact, most constructors have been expanded upon to give an idea of what they represent rather than using generic terms. -
PointF
andPoint
have been combined, and feature support for pureInt
-based co-ordinates as well asDouble
ones (i.e. no floating point-only points for Point). The optional!
and third value for Point are not available. -
Rect
uses twoPoint
values to denote the lower-left and top-right corners. - The two
LabelLoc
attributes have been combined. - The defined
LayerSep
is not used to parseLayerRange
orLayerList
; the default ([' ',
) is instead used.:
, '\t'] -
SplineType
has been replaced with[
.Spline
] - Only polygon-based
Shape
s are available. - Device-dependent
StyleName
values are not available. -
PortPos
only has theCompassPoint
option, notPortName[:CompassPoint]
(since record shapes aren't allowed, and parsing HTML-like labels could be problematic). - Not every
Attribute
is fully documented/described. In particular, a lot of them are listed as having aString
value, when actually only certain Strings are allowed.
- data Attribute
- = Damping Double
- | K Double
- | URL URL
- | ArrowHead ArrowType
- | ArrowSize Double
- | ArrowTail ArrowType
- | Aspect AspectType
- | Bb Rect
- | BgColor Color
- | Center Bool
- | Charset String
- | ClusterRank ClusterMode
- | Color (Either Color [Color])
- | ColorScheme String
- | Comment String
- | Compound Bool
- | Concentrate Bool
- | Constraint Bool
- | Decorate Bool
- | DefaultDist Double
- | Dim Int
- | Dimen Int
- | Dir DirType
- | DirEdgeConstraints (Either String Bool)
- | Distortion Double
- | DPI Double
- | EdgeURL URL
- | EdgeHref URL
- | EdgeTarget String
- | EdgeTooltip String
- | Epsilon Double
- | ESep (Either Double Point)
- | FillColor Color
- | FixedSize Bool
- | FontColor Color
- | FontName String
- | FontNames String
- | FontPath String
- | FontSize Double
- | Group String
- | HeadURL URL
- | HeadClip Bool
- | HeadHref URL
- | HeadLabel (Either String URL)
- | HeadPort PortPos
- | HeadTarget QuotedString
- | HeadTooltip QuotedString
- | Height Double
- | Href URL
- | ID (Either String URL)
- | Image String
- | ImageScale ScaleType
- | Label (Either String URL)
- | LabelURL URL
- | LabelAngle Double
- | LabelDistance Double
- | LabelFloat Bool
- | LabelFontColor Color
- | LabelFontName String
- | LabelFontSize Double
- | LabelHref URL
- | LabelJust Justification
- | LabelLoc VerticalPlacement
- | LabelTarget String
- | LabelTooltip String
- | Landscape Bool
- | Layer LayerRange
- | Layers LayerList
- | LayerSep String
- | Layout String
- | Len Double
- | Levels Int
- | LevelsGap Double
- | LHead String
- | LP Point
- | LTail String
- | Margin (Either Double Point)
- | MaxIter Int
- | MCLimit Double
- | MinDist Double
- | MinLen Int
- | Mode String
- | Model String
- | Mosek Bool
- | NodeSep Double
- | NoJustify Bool
- | Normalize Bool
- | Nslimit Double
- | Nslimit1 Double
- | Ordering String
- | Orientation Double
- | OrientationGraph String
- | OutputOrder OutputMode
- | Overlap (Either String Bool)
- | OverlapScaling Double
- | Pack (Either Bool Int)
- | PackMode PackMode
- | Pad (Either Double Point)
- | Page Point
- | PageDir PageDir
- | PenColor Color
- | PenWidth Double
- | Peripheries Int
- | Pin Bool
- | Pos (Either Point [Spline])
- | QuadTree (Either QuadType Bool)
- | Quantum Double
- | Rank RankType
- | RankDir RankDir
- | Ranksep Double
- | Ratio Ratios
- | Rects Rect
- | Regular Bool
- | ReMinCross Bool
- | RepulsiveForce Double
- | Resolution Double
- | Root (Either String Bool)
- | Rotate Int
- | SameHead String
- | SameTail String
- | SamplePoints Int
- | SearchSize Int
- | Sep (Either Double Point)
- | Shape Shape
- | ShapeFile String
- | ShowBoxes Int
- | Sides Int
- | Size Point
- | Skew Double
- | Smoothing SmoothType
- | SortV Int
- | Splines (Either Bool String)
- | Start StartType
- | Style Style
- | StyleSheet String
- | TailURL URL
- | TailClip Bool
- | TailHref URL
- | TailLabel (Either String URL)
- | TailPort PortPos
- | TailTarget String
- | TailTooltip String
- | Target String
- | Tooltip String
- | TrueColor Bool
- | Vertices [Point]
- | ViewPort ViewPort
- | VoroMargin Double
- | Weight Double
- | Width Double
- | Z Double
- usedByGraphs :: Attribute -> Bool
- usedByClusters :: Attribute -> Bool
- usedBySubGraphs :: Attribute -> Bool
- usedByNodes :: Attribute -> Bool
- usedByEdges :: Attribute -> Bool
- newtype URL = UStr {}
- data ArrowType
- data AspectType
- data Rect = Rect Point Point
- data Color
- showColor :: Color -> String
- showWord8Pad :: Word8 -> String -> String
- parseColor :: Parse Color
- data ClusterMode
- data DirType
- data Point
- showPoint :: Point -> String
- parsePoint :: Parse Point
- data LayerRange
- parseLayerSep :: Parse String
- defLayerSep :: [Char]
- parseLayerName :: Parse String
- data LayerID
- data LayerList = LL String [(String, String)]
- data OutputMode
- = BreadthFirst
- | NodesFirst
- | EdgesFirst
- data PackMode
- data PageDir
- data Spline = Spline (Maybe Point) (Maybe Point) [Point]
- showSpline :: Spline -> String
- parseSpline :: Parse Spline
- data QuadType
- data RankType
- = SameRank
- | MinRank
- | SourceRank
- | MaxRank
- | SinkRank
- data RankDir
- = FromTop
- | FromLeft
- | FromBottom
- | FromRight
- data Shape
- = BoxShape
- | Polygon
- | Ellipse
- | Circle
- | PointShape
- | Egg
- | Triangle
- | Plaintext
- | DiamondShape
- | Trapezium
- | Parallelogram
- | House
- | Pentagon
- | Hexagon
- | Septagon
- | Octagon
- | Doublecircle
- | Doubleoctagon
- | Tripleoctagon
- | Invtriangle
- | Invtrapezium
- | Invhouse
- | Mdiamond
- | Msquare
- | Mcircle
- | Rectangle
- | NoShape
- | Note
- | Tab
- | Folder
- | Box3d
- | Component
- data SmoothType
- data StartType = ST (Maybe STStyle) (Maybe Int)
- data STStyle
- = RegularStyle
- | Self
- | Random
- data Style = Stl StyleName (Maybe String)
- data StyleName
- newtype PortPos = PP CompassPoint
- data CompassPoint
- data ViewPort = VP {}
- data FocusType
- data VerticalPlacement
- data ScaleType
- = UniformScale
- | NoScale
- | FillWidth
- | FillHeight
- | FillBoth
- data Justification
- data Ratios
- = AspectRatio Double
- | FillRatio
- | CompressRatio
- | ExpandRatio
- | AutoRatio
- newtype QuotedString = QS {}
Documentation
These attributes have been implemented in a permissive manner: that is, rather than split them up based on which type of value they are allowed, they have all been included in the one data type, with functions to determine if they are indeed valid for what they're being applied to.
To interpret the Valid for listings:
G
- Valid for Graphs.
C
- Valid for Clusters.
S
- Valid for Sub-Graphs (and also Clusters).
N
- Valid for Nodes.
E
- Valid for Edges.
Note also that the default values are taken from the specification page listed above, and might not correspond fully with the names of the permitted values.
Damping Double | Valid for: G; Default: 0.99; Minimum: 0.0; Notes: neato only |
K Double | Valid for: GC; Default: 0.3; Minimum: 0; Notes: sfdp, fdp only |
URL URL | Valid for: ENGC; Default: <none>; Notes: svg, postscript, map only |
ArrowHead ArrowType | Valid for: E; Default: Normal |
ArrowSize Double | Valid for: E; Default: 1.0; Minimum: 0.0 |
ArrowTail ArrowType | Valid for: E; Default: Normal |
Aspect AspectType | Valid for: G; Notes: dot only |
Bb Rect | Valid for: G; Notes: write only |
BgColor Color | Valid for: GC; Default: <none> |
Center Bool | Valid for: G; Default: false |
Charset String | Valid for: G; Default: "UTF-8" |
ClusterRank ClusterMode | Valid for: G; Default: local; Notes: dot only |
Color (Either Color [Color]) | Valid for: ENC; Default: black |
ColorScheme String | Valid for: ENCG; Default: "" |
Comment String | Valid for: ENG; Default: "" |
Compound Bool | Valid for: G; Default: false; Notes: dot only |
Concentrate Bool | Valid for: G; Default: false |
Constraint Bool | Valid for: E; Default: true; Notes: dot only |
Decorate Bool | Valid for: E; Default: false |
DefaultDist Double | Valid for: G; Default: 1+(avg. len)*sqrt(|V|); Minimum: epsilon; Notes: neato only |
Dim Int | Valid for: G; Default: 2; Minimum: 2; Notes: sfdp, fdp, neato only |
Dimen Int | Valid for: G; Default: 2; Minimum: 2; Notes: sfdp, fdp, neato only |
Dir DirType | Valid for: E; Default: forward(directed)/none(undirected) |
DirEdgeConstraints (Either String Bool) | Valid for: G; Default: false; Notes: neato only |
Distortion Double | Valid for: N; Default: 0.0; Minimum: -100.0 |
DPI Double | Valid for: G; Default: 96.0 | 0.0; Notes: svg, bitmap output only |
EdgeURL URL | Valid for: E; Default: ""; Notes: svg, map only |
EdgeHref URL | Valid for: E; Default: ""; Notes: svg, map only |
EdgeTarget String | Valid for: E; Default: <none>; Notes: svg, map only |
EdgeTooltip String | Valid for: E; Default: ""; Notes: svg, cmap only |
Epsilon Double | Valid for: G; Default: .0001 * # nodes(mode == KK) | .0001(mode == major); Notes: neato only |
ESep (Either Double Point) | Valid for: G; Default: +3; Notes: not dot |
FillColor Color | Valid for: NC; Default: lightgrey(nodes) | black(clusters) |
FixedSize Bool | Valid for: N; Default: false |
FontColor Color | Valid for: ENGC; Default: black |
FontName String | Valid for: ENGC; Default: "Times-Roman" |
FontNames String | Valid for: G; Default: ""; Notes: svg only |
FontPath String | Valid for: G; Default: system-dependent |
FontSize Double | Valid for: ENGC; Default: 14.0; Minimum: 1.0 |
Group String | Valid for: N; Default: ""; Notes: dot only |
HeadURL URL | Valid for: E; Default: ""; Notes: svg, map only |
HeadClip Bool | Valid for: E; Default: true |
HeadHref URL | Valid for: E; Default: ""; Notes: svg, map only |
HeadLabel (Either String URL) | Valid for: E; Default: "" |
HeadPort PortPos | Valid for: E; Default: center |
HeadTarget QuotedString | Valid for: E; Default: <none>; Notes: svg, map only |
HeadTooltip QuotedString | Valid for: E; Default: ""; Notes: svg, cmap only |
Height Double | Valid for: N; Default: 0.5; Minimum: 0.02 |
Href URL | Valid for: E; Default: ""; Notes: svg, postscript, map only |
ID (Either String URL) | Valid for: GNE; Default: ""; Notes: svg, postscript, map only |
Image String | Valid for: N; Default: "" |
ImageScale ScaleType | Valid for: N; Default: false |
Label (Either String URL) | Valid for: ENGC; Default: "N" (nodes) | "" (otherwise) |
LabelURL URL | Valid for: E; Default: ""; Notes: svg, map only |
LabelAngle Double | Valid for: E; Default: -25.0; Minimum: -180.0 |
LabelDistance Double | Valid for: E; Default: 1.0; Minimum: 0.0 |
LabelFloat Bool | Valid for: E; Default: false |
LabelFontColor Color | Valid for: E; Default: black |
LabelFontName String | Valid for: E; Default: "Times-Roman" |
LabelFontSize Double | Valid for: E; Default: 14.0; Minimum: 1.0 |
LabelHref URL | Valid for: E; Default: ""; Notes: svg, map only |
LabelJust Justification | Valid for: GC; Default: "c" |
LabelLoc VerticalPlacement | Valid for: GCN; Default: "t"(clusters) | "b"(root graphs) | "c"(clusters) |
LabelTarget String | Valid for: E; Default: <none>; Notes: svg, map only |
LabelTooltip String | Valid for: E; Default: ""; Notes: svg, cmap only |
Landscape Bool | Valid for: G; Default: false |
Layer LayerRange | Valid for: EN; Default: "" |
Layers LayerList | Valid for: G; Default: "" |
LayerSep String | Valid for: G; Default: " :t" |
Layout String | Valid for: G; Default: "" |
Len Double | Valid for: E; Default: 1.0(neato)0.3(fdp); Notes/: fdp, neato only |
Levels Int | Valid for: G; Default: MAXINT; Minimum: 0.0; Notes: sfdp only |
LevelsGap Double | Valid for: G; Default: 0.0; Notes: neato only |
LHead String | Valid for: E; Default: ""; Notes: dot only |
LP Point | Valid for: EGC; Notes: write only |
LTail String | Valid for: E; Default: ""; Notes: dot only |
Margin (Either Double Point) | Valid for: NG; Default: <device-dependent> |
MaxIter Int | Valid for: G; Default: 100 * # nodes(mode == KK) | 200(mode == major) | 600(fdp); Notes: fdp, neato only |
MCLimit Double | Valid for: G; Default: 1.0; Notes: dot only |
MinDist Double | Valid for: G; Default: 1.0; Minimum: 0.0; Notes: circo only |
MinLen Int | Valid for: E; Default: 1; Minimum: 0; Notes: dot only |
Mode String | Valid for: G; Default: "major"; Notes: neato only |
Model String | Valid for: G; Default: "shortpath"; Notes: neato only |
Mosek Bool | Valid for: G; Default: false; Notes: neato only; requires the Mosek software |
NodeSep Double | Valid for: G; Default: 0.25; Minimum: 0.02; Notes: dot only |
NoJustify Bool | Valid for: GCNE; Default: false |
Normalize Bool | Valid for: G; Default: false; Notes: not dot |
Nslimit Double | Valid for: G; Notes: dot only |
Nslimit1 Double | Valid for: G; Notes: dot only |
Ordering String | Valid for: G; Default: ""; Notes: dot only |
Orientation Double | Valid for: N; Default: 0.0; Minimum: 360.0 |
OrientationGraph String | Valid for: G; Default: ""; Notes: Landscape if "[lL]*" and rotate not defined |
OutputOrder OutputMode | Valid for: G; Default: breadthfirst |
Overlap (Either String Bool) | Valid for: G; Default: true; Notes: not dot |
OverlapScaling Double | Valid for: G; Default: -4; Minimum: -1.0e10; Notes: prism only |
Pack (Either Bool Int) | Valid for: G; Default: false; Notes: not dot |
PackMode PackMode | Valid for: G; Default: node; Notes: not dot |
Pad (Either Double Point) | Valid for: G; Default: 0.0555 (4 points) |
Page Point | Valid for: G |
PageDir PageDir | Valid for: G; Default: BL |
PenColor Color | Valid for: C; Default: black |
PenWidth Double | Valid for: CNE; Default: 1.0; Minimum: 0.0 |
Peripheries Int | Valid for: NC; Default: shape default(nodes) | 1(clusters); Minimum: 0 |
Pin Bool | Valid for: N; Default: false; Notes: fdp, neato only |
Pos (Either Point [Spline]) | Valid for: EN |
QuadTree (Either QuadType Bool) | Valid for: G; Default: "normal"; Notes: sfdp only |
Quantum Double | Valid for: G; Default: 0.0; Minimum: 0.0 |
Rank RankType | Valid for: S; Notes: dot only |
RankDir RankDir | Valid for: G; Default: TB; Notes: dot only |
Ranksep Double | Valid for: G; Default: 0.5(dot) | 1.0(twopi); Minimum: 0.02; Notes: twopi, dot only |
Ratio Ratios | Valid for: G |
Rects Rect | Valid for: N; Notes: write only |
Regular Bool | Valid for: N; Default: false |
ReMinCross Bool | Valid for: G; Default: false; Notes: dot only |
RepulsiveForce Double | Valid for: G; Default: 1.0; Minimum: 0.0; Notes: sfdp only |
Resolution Double | Valid for: G; Default: 96.0 | 0.0; Notes: svg, bitmap output only |
Root (Either String Bool) | Valid for: GN; Default: ""(graphs) | false(nodes); Notes: circo, twopi only |
Rotate Int | Valid for: G; Default: 0 |
SameHead String | Valid for: E; Default: ""; Notes: dot only |
SameTail String | Valid for: E; Default: ""; Notes: dot only |
SamplePoints Int | Valid for: N; Default: 8(output) | 20(overlap and image maps) |
SearchSize Int | Valid for: G; Default: 30; Notes: dot only |
Sep (Either Double Point) | Valid for: G; Default: +4; Notes: not dot |
Shape Shape | Valid for: N; Default: ellipse |
ShapeFile String | Valid for: N; Default: "" |
ShowBoxes Int | Valid for: ENG; Default: 0; Minimum: 0; Notes: dot only |
Sides Int | Valid for: N; Default: 4; Minimum: 0 |
Size Point | Valid for: G |
Skew Double | Valid for: N; Default: 0.0; Minimum: -100.0 |
Smoothing SmoothType | Valid for: G; Default: "none"; Notes: sfdp only |
SortV Int | Valid for: GCN; Default: 0; Minimum: 0 |
Splines (Either Bool String) | Valid for: G |
Start StartType | Valid for: G; Default: ""; Notes: fdp, neato only |
Style Style | Valid for: ENC |
StyleSheet String | Valid for: G; Default: ""; Notes: svg only |
TailURL URL | Valid for: E; Default: ""; Notes: svg, map only |
TailClip Bool | Valid for: E; Default: true |
TailHref URL | Valid for: E; Default: ""; Notes: svg, map only |
TailLabel (Either String URL) | Valid for: E; Default: "" |
TailPort PortPos | Valid for: E; Default: center |
TailTarget String | Valid for: E; Default: <none>; Notes: svg, map only |
TailTooltip String | Valid for: E; Default: ""; Notes: svg, cmap only |
Target String | Valid for: ENGC; Default: <none>; Notes: svg, map only |
Tooltip String | Valid for: NEC; Default: ""; Notes: svg, cmap only |
TrueColor Bool | Valid for: G; Notes: bitmap output only |
Vertices [Point] | Valid for: N; Notes: write only |
ViewPort ViewPort | Valid for: G; Default: "" |
VoroMargin Double | Valid for: G; Default: 0.05; Minimum: 0.0; Notes: not dot |
Weight Double | Valid for: E; Default: 1.0; Minimum: 0(dot) | 1(neato,fdp,sfdp) |
Width Double | Valid for: N; Default: 0.75; Minimum: 0.01 |
Z Double | Valid for: N; Default: 0.0; Minimum: -MAXFLOAT | -1000 |
usedByGraphs :: Attribute -> BoolSource
Determine if this Attribute is valid for use with Graphs.
usedByClusters :: Attribute -> BoolSource
Determine if this Attribute is valid for use with Clusters.
usedBySubGraphs :: Attribute -> BoolSource
Determine if this Attribute is valid for use with SubGraphs.
usedByNodes :: Attribute -> BoolSource
Determine if this Attribute is valid for use with Nodes.
usedByEdges :: Attribute -> BoolSource
Determine if this Attribute is valid for use with Edges.
data AspectType Source
showWord8Pad :: Word8 -> String -> StringSource
data ClusterMode Source
data LayerRange Source
defLayerSep :: [Char]Source
The list represent (Separator, Name)
data OutputMode Source
Upper-case first character is major order; lower-case second character is minor order.
The number of points in the list must be equivalent to 1 mod 3; note that this is not checked.
showSpline :: Spline -> StringSource
data SmoothType Source
It it assumed that at least one of these is Just{}
.
data CompassPoint Source
data VerticalPlacement Source
Note that VCenter
is only valid for Nodes.
data Justification Source
newtype QuotedString Source
Represents String
s that definitely have quotes around them.