Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

Node_Node_Shape_ImagePosition_Size_Style_Attributes

mattt edited this page Mar 30, 2020 · 2 revisions

Node.Node.Shape.ImagePosition.Size.Style.Attributes

public struct Attributes: Hashable

Inheritance

Hashable

Initializers

init(stringLiteral:)

public init(stringLiteral value: String)

Properties

guideBoxLocation

showboxes Print guide boxes in PostScript at the beginning of routesplines if 1, or at the end if 2. (Debugging)

var guideBoxLocation: Location?
ENG    int    0    0    dot only

textColor

var textColor: Color?

The font color for object labels.

backgroundColor

var backgroundColor: Color?

When attached to the root graph, this color is used as the background for entire canvas. For a cluster, it is used as the initial background for the cluster. If a cluster has a filled style, the cluster's fillcolor will overlay the background color.

comment

Comments are inserted into output. Device-dependent

var comment: String?

fontSize

var fontSize: Double?

shape

var shape: Shape?

The shape of a node.

area

Indicates the preferred area for a node or empty cluster when laid out by patchwork. 1.0 >0 patchwork only

var area: Double?

label

var label: String?

fillColor

var fillColor: Color?

Important: Setting fillColor sets style to .filled; setting nil fillColor sets style to nil

size

The node size set by height and width is kept fixed and not expanded to contain the text label.

var size: Size?

If false, the size of a node is determined by smallest width and height needed to contain its label and image, if any, with a margin specified by the margin attribute. The width and height must also be at least as large as the sizes specified by the width and height attributes, which specify the minimum values for these parameters. If true, the node size is specified by the values of the width and height attributes only and is not expanded to contain the text label. There will be a warning if the label (with margin) cannot fit within these limits.

If the fixedsize attribute is set to shape, the width and height attributes also determine the size of the node shape, but the label can be much larger. Both the label and shape sizes are used when avoiding node overlap, but all edges to the node ignore the label and only contact the node shape. No warning is given if the label is too larg

strokeWidth

penwidth Specifies the width of the pen, in points, used to draw lines and curves, including the boundaries of edges and clusters. The value is inherited by subclusters. It has no effect on text.

var strokeWidth: Double?

dictionaryValue

var dictionaryValue: [String: Any]

sortValue

If packmode indicates an array packing, this attribute specifies an insertion order among the components, with smaller values inserted first.

var sortValue: Int?

GCN int 0 0

`class`

Unofficial, but supported by certain output formats, like svg.

var `class`: String?

root

This specifies nodes to be used as the center of the layout and the root of the generated spanning tree. As a graph attribute, this gives the name of the node. As a node attribute, it specifies that the node should be used as a central node. In twopi, this will actually be the central node. In circo, the block containing the node will be central in the drawing of its connected component. If not defined, twopi will pick a most central node, and circo will pick a random node. If the root attribute is defined as the empty string, twopi will reset it to name of the node picked as the root node.

var root: Bool?

For twopi, it is possible to have multiple roots, presumably one for each component. If more than one node in a component is marked as the root, twopi will pick one.

root GN string bool (graphs) false(nodes) circo, twopi only

imageURL

Gives the name of a file containing an image to be displayed inside a node. The image file must be in one of the recognized formats, typically JPEG, PNG, GIF, BMP, SVG or Postscript, and be able to be converted into the desired output format. The file must contain the image size information. This is usually trivially true for the bitmap formats. For PostScript, the file must contain a line starting with %%BoundingBox: followed by four integers specifying the lower left x and y coordinates and the upper right x and y coordinates of the bounding box for the image, the coordinates being in points. An SVG image file must contain width and height attributes, typically as part of the svg element. The values for these should have the form of a floating point number, followed by optional units, e.g., width="76pt". Recognized units are in, px, pc, pt, cm and mm for inches, pixels, picas, points, centimeters and millimeters, respectively. The default unit is points.

var imageURL: URL?

Unlike with the shapefile attribute, the image is treated as node content rather than the entire node. In particular, an image can be contained in a node of any shape, not just a rectangle.

noJustify

By default, the justification of multi-line labels is done within the largest context that makes sense. Thus, in the label of a polygonal node, a left-justified line will align with the left side of the node (shifted by the prescribed margin). In record nodes, left-justified line will line up with the left side of the enclosing column of fields. If nojustify is "true", multi-line labels will be justified in the context of itself. For example, if the attribute is set, the first label line is long, and the second is shorter and left-justified, the second will align with the left-most character in the first line, regardless of how large the node might be.

var noJustify: Bool?

samplePoints

If the input graph defines the vertices attribute, and output is dot or xdot, this gives the number of points used for a node whose shape is a circle or ellipse. It plays the same role in neato, when adjusting the layout to avoid overlapping nodes, and in image maps.

var samplePoints: Int?

samplepoints N int 8(output) 20(overlap and image maps)

pin

If true and the node has a pos attribute on input, neato or fdp prevents the node from moving from the input position. This property can also be specified in the pos attribute itself (cf. the point type). Note: Due to an artifact of the implementation, previous to 27 Feb 2014, final coordinates are translated to the origin. Thus, if you look at the output coordinates given in the (x)dot or plain format, pinned nodes will not have the same output coordinates as were given on input. If this is important, a simple workaround is to maintain the coordinates of a pinned node. The vector difference between the old and new coordinates will give the translation, which can then be subtracted from all of the appropriate coordinates.

var pin: Bool?

After 27 Feb 2014, this translation can be avoided in neato by setting the notranslate to TRUE. However, if the graph specifies node overlap removal or a change in aspect ratio, node coordinates may still change.

N bool false fdp, neato only

exteriorLabelPosition

Position of an exterior label, in points. The position indicates the center of the label.

var exteriorLabelPosition: Point?

style

var style: Style?

Defines the graphic style on an object.

imagePosition

Attribute controlling how an image is positioned within its containing node. This only has an effect when the image is smaller than the containing node. The default is to be centered both horizontally and vertically. Valid values: tl Top Left tc Top Centered tr Top Right ml Middle Left mc Middle Centered (the default) mr Middle Right bl Bottom Left bc Bottom Centered br Bottom Right

var imagePosition: ImagePosition?

position

Position of node, or spline control points. For nodes, the position indicates the center of the node. On output, the coordinates are in points. In neato and fdp, pos can be used to set the initial position of a node. By default, the coordinates are assumed to be in inches. However, the -s command line flag can be used to specify different units. As the output coordinates are in points, feeding the output of a graph laid out by a Graphviz program into neato or fdp will almost always require the -s flag.

var position: Position?

When the -n command line flag is used with neato, it is assumed the positions have been set by one of the layout programs, and are therefore in points. Thus, neato -n can accept input correctly without requiring a -s flag and, in fact, ignores any such flag.

exteriorLabel

External label for a node or edge. For nodes, the label will be placed outside of the node but near it. For edges, the label will be placed near the center of the edge. This can be useful in dot to avoid the occasional problem when the use of edge labels distorts the layout. For other layouts, the xlabel attribute can be viewed as a synonym for the label attribute. These labels are added after all nodes and edges have been placed. The labels will be placed so that they do not overlap any node or label. This means it may not be possible to place all of them. To force placing all of them, use the forcelabels attribute.

var exteriorLabel: String?

fontName

var fontName: String?

The name of the used font. (System dependend) The font size for object labels.

url

var url: URL?

group

If the end points of an edge belong to the same group, i.e., have the same group attribute, parameters are set to avoid crossings and keep the edges straight.

var group: String?
N    string    ""        dot only

strokeColor

var strokeColor: Color?

Basic drawing color for graphics.

href

var href: String?

ordering

If the value of the attribute is "out", then the outedges of a node, that is, edges with the node as its tail node, must appear left-to-right in the same order in which they are defined in the input. If the value of the attribute is "in", then the inedges of a node must appear left-to-right in the same order in which they are defined in the input. If defined as a graph or subgraph attribute, the value is applied to all nodes in the graph or subgraph. Note that the graph attribute takes precedence over the node attribute.

var ordering: Ordering?
Clone this wiki locally