pub struct GraphAttributeStatementBuilder<'a> {
pub attributes: IndexMap<String, AttributeText<'a>>,
/* private fields */
}
Fields§
§attributes: IndexMap<String, AttributeText<'a>>
Implementations§
Source§impl<'a> GraphAttributeStatementBuilder<'a>
impl<'a> GraphAttributeStatementBuilder<'a>
pub fn new() -> Self
pub fn build(&self) -> ValidationResult<IndexMap<String, AttributeText<'a>>>
pub fn build_ignore_validation(&self) -> IndexMap<String, AttributeText<'a>>
Trait Implementations§
Source§impl<'a> GraphAttributes<'a> for GraphAttributeStatementBuilder<'a>
impl<'a> GraphAttributes<'a> for GraphAttributeStatementBuilder<'a>
Source§fn add_attributes(
&'a mut self,
attributes: HashMap<String, AttributeText<'a>>,
) -> &mut Self
fn add_attributes( &'a mut self, attributes: HashMap<String, AttributeText<'a>>, ) -> &mut Self
Add multiple attributes to the node.
Source§fn add_attribute<S: Into<String>>(
&mut self,
key: S,
value: AttributeText<'a>,
) -> &mut Self
fn add_attribute<S: Into<String>>( &mut self, key: S, value: AttributeText<'a>, ) -> &mut Self
Add an attribute to the node.
fn get_attributes_mut(&mut self) -> &mut IndexMap<String, AttributeText<'a>>
fn add_validation_error(&mut self, field: &'static str, message: &'static str)
fn background(&mut self, background: String) -> &mut Self
Source§fn background_color(&mut self, background_color: Color<'a>) -> &mut Self
fn background_color(&mut self, background_color: Color<'a>) -> &mut Self
The color used as the background for entire canvas.
Source§fn background_colorlist(
&mut self,
background_colors: ColorList<'a>,
) -> &mut Self
fn background_colorlist( &mut self, background_colors: ColorList<'a>, ) -> &mut Self
The color used as the background for entire canvas with a gradient fill.
A colon-separated list of weighted color values: WC(:WC)* where each WC has the form C(;F)?
with C a color value and the optional F a floating-point number, 0 ≤ F ≤ 1.
The sum of the floating-point numbers in a colorList must sum to at most 1.
Source§fn bounding_box(&mut self, bounding_box: String) -> &mut Self
fn bounding_box(&mut self, bounding_box: String) -> &mut Self
Type: rect which is “%f,%f,%f,%f”
The rectangle llx,lly,urx,ury gives the coordinates, in points, of the lower-left corner (llx,lly)
and the upper-right corner (urx,ury).
Source§fn center(&mut self, center: bool) -> &mut Self
fn center(&mut self, center: bool) -> &mut Self
If true, the drawing is centered in the output canvas.
Source§fn charset(&mut self, charset: String) -> &mut Self
fn charset(&mut self, charset: String) -> &mut Self
Specifies the character encoding used when interpreting string input as a text label.
Source§fn class(&mut self, class: String) -> &mut Self
fn class(&mut self, class: String) -> &mut Self
Classnames to attach to the node, edge, graph, or cluster’s SVG element.
Combine with stylesheet for styling SVG output using CSS classnames.
Multiple space-separated classes are supported.
Source§fn cluster_rank(&mut self, cluster_rank: ClusterMode) -> &mut Self
fn cluster_rank(&mut self, cluster_rank: ClusterMode) -> &mut Self
Mode used for handling clusters.
If clusterrank=local, a subgraph whose name begins with cluster is given special treatment.
The subgraph is laid out separately, and then integrated as a unit into its parent graph,
with a bounding rectangle drawn about it.
If the cluster has a label parameter, this label is displayed within the rectangle.
Note also that there can be clusters within clusters.
The modes clusterrank=global and clusterrank=none appear to be identical, both turning off the special cluster processing.
Source§fn color(&mut self, color: Color<'a>) -> &mut Self
fn color(&mut self, color: Color<'a>) -> &mut Self
Basic drawing color for graphics, not text. For the latter, use the fontcolor attribute.
If any fraction is used, the colors are drawn in series, with each color being given
roughly its specified fraction of the edge.
Source§fn color_scheme(&mut self, color_scheme: String) -> &mut Self
fn color_scheme(&mut self, color_scheme: String) -> &mut Self
This attribute specifies a color scheme namespace: the context for interpreting color names.
In particular, if a color value has form “xxx” or “//xxx”, then the color xxx will be evaluated
according to the current color scheme. If no color scheme is set, the standard X11 naming is used.
For example, if colorscheme=bugn9, then color=7 is interpreted as color=“/bugn9/7”.
Source§fn comment(&mut self, comment: String) -> &mut Self
fn comment(&mut self, comment: String) -> &mut Self
Comments are inserted into output. Device-dependent
fn compound(&mut self, compound: String) -> &mut Self
fn concentrate(&mut self, concentrate: String) -> &mut Self
Source§fn dpi(&mut self, dpi: f32) -> &mut Self
fn dpi(&mut self, dpi: f32) -> &mut Self
Specifies the expected number of pixels per inch on a display device.
Also known as resolution
Source§fn fill_color(&mut self, fill_color: Color<'a>) -> &mut Self
fn fill_color(&mut self, fill_color: Color<'a>) -> &mut Self
Color used to fill the background of a node or cluster assuming style=filled, or a filled arrowhead.
Source§fn fill_color_with_colorlist(&mut self, fill_colors: ColorList<'a>) -> &mut Self
fn fill_color_with_colorlist(&mut self, fill_colors: ColorList<'a>) -> &mut Self
Color used to fill the background, with a gradient, of a node or cluster assuming
style=filled, or a filled arrowhead.
Source§fn fill_color_with_iter<I>(&mut self, fill_colors: I) -> &mut Self
fn fill_color_with_iter<I>(&mut self, fill_colors: I) -> &mut Self
Color used to fill the background, with a gradient, of a node or cluster assuming
style=filled, or a filled arrowhead.
TODO: example
crate::attributes::GraphAttributes::dpi
Source§fn font_color(&mut self, font_color: Color<'a>) -> &mut Self
fn font_color(&mut self, font_color: Color<'a>) -> &mut Self
Color used for text.
fn font_names(&mut self, font_names: String) -> &mut Self
fn font_path(&mut self, font_path: String) -> &mut Self
Source§fn font_size(&mut self, font_size: f32) -> &mut Self
fn font_size(&mut self, font_size: f32) -> &mut Self
Font size, in points, used for text.
default: 14.0, minimum: 1.0
fn force_label(&mut self, force_label: bool) -> &mut Self
Source§fn gradient_angle(&mut self, gradient_angle: u32) -> &mut Self
fn gradient_angle(&mut self, gradient_angle: u32) -> &mut Self
If a gradient fill is being used, this determines the angle of the fill.
fn image_path(&mut self, image_path: String) -> &mut Self
Source§fn label_justification(
&mut self,
label_justification: LabelJustification,
) -> &mut Self
fn label_justification( &mut self, label_justification: LabelJustification, ) -> &mut Self
If labeljust=r, the label is right-justified within bounding rectangle
If labeljust=l, left-justified
Else the label is centered.
fn label_location(&mut self, label_location: LabelLocation) -> &mut Self
fn landscape(&mut self, landscape: bool) -> &mut Self
Source§fn layer_list_sep(&mut self, layer_list_sep: String) -> &mut Self
fn layer_list_sep(&mut self, layer_list_sep: String) -> &mut Self
Specifies the separator characters used to split an attribute of type layerRange into a
list of ranges.
Source§fn layers(&mut self, layers: String) -> &mut Self
fn layers(&mut self, layers: String) -> &mut Self
Specifies a linearly ordered list of layer names attached to the graph
The graph is then output in separate layers.
Only those components belonging to the current output layer appear.
Source§fn layer_select(&mut self, layer_select: String) -> &mut Self
fn layer_select(&mut self, layer_select: String) -> &mut Self
Selects a list of layers to be emitted.
Source§fn layer_sep(&mut self, layer_sep: String) -> &mut Self
fn layer_sep(&mut self, layer_sep: String) -> &mut Self
Specifies the separator characters used to split the layers attribute into a list of layer names.
default: “:\t “
Source§fn label_position(&mut self, lp: Point) -> &mut Self
fn label_position(&mut self, lp: Point) -> &mut Self
Label position
The position indicates the center of the label.
Source§fn margin(&mut self, margin: f32) -> &mut Self
fn margin(&mut self, margin: f32) -> &mut Self
Sets x and y margins of canvas, in inches.
Both margins are set equal to the given value.
See
crate::attributes::GraphAttributes::margin_point
Source§fn margin_point(&mut self, margin: Point) -> &mut Self
fn margin_point(&mut self, margin: Point) -> &mut Self
Sets x and y margins of canvas, in inches.
Note that the margin is not part of the drawing but just empty space left around the drawing.
The margin basically corresponds to a translation of drawing, as would be necessary to
center a drawing on a page. Nothing is actually drawn in the margin.
To actually extend the background of a drawing, see the pad attribute.
Whilst it is possible to create a Point value with either a third co-ordinate
or a forced position, these are ignored for printing.
By default, the value is 0.11,0.055.
Source§fn mclimit(&mut self, mclimit: f32) -> &mut Self
fn mclimit(&mut self, mclimit: f32) -> &mut Self
Multiplicative scale factor used to alter the MinQuit (default = 8) and
MaxIter (default = 24) parameters used during crossing minimization.
These correspond to the number of tries without improvement before quitting and the
maximum number of iterations in each pass.
Source§fn mindist(&mut self, mindist: u32) -> &mut Self
fn mindist(&mut self, mindist: u32) -> &mut Self
Specifies the minimum separation between all nodes.
Source§fn newrank(&mut self, newrank: bool) -> &mut Self
fn newrank(&mut self, newrank: bool) -> &mut Self
Whether to use a single global ranking, ignoring clusters.
The original ranking algorithm in dot is recursive on clusters.
This can produce fewer ranks and a more compact layout, but sometimes at the cost of a
head node being place on a higher rank than the tail node.
It also assumes that a node is not constrained in separate, incompatible subgraphs.
For example, a node cannot be in a cluster and also be constrained by rank=same with
a node not in the cluster.
This allows nodes to be subject to multiple constraints.
Rank constraints will usually take precedence over edge constraints.
Source§fn nodesep(&mut self, nodesep: f32) -> &mut Self
fn nodesep(&mut self, nodesep: f32) -> &mut Self
specifies the minimum space between two adjacent nodes in the same rank, in inches.
default: 0.25, minimum: 0.02
Source§fn no_justify(&mut self, no_justify: bool) -> &mut Self
fn no_justify(&mut self, no_justify: bool) -> &mut Self
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=true, multi-line labels will be justified in the context of itself.
For example, if nojustify 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.
Source§fn nslimit(&mut self, nslimit: f32) -> &mut Self
fn nslimit(&mut self, nslimit: f32) -> &mut Self
Sets number of iterations in network simplex applications.
nslimit is used in computing node x coordinates.
If defined, # iterations = nslimit * # nodes; otherwise, # iterations = MAXINT.
Source§fn ordering(&mut self, ordering: Ordering) -> &mut Self
fn ordering(&mut self, ordering: Ordering) -> &mut Self
If ordering=“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. Read more
Source§fn orientation(&mut self, orientation: f32) -> &mut Self
fn orientation(&mut self, orientation: f32) -> &mut Self
Used only if rotate is not defined.
Default: 0.0 and minimum: 360.0
Source§fn output_order(&mut self, output_order: OutputMode) -> &mut Self
fn output_order(&mut self, output_order: OutputMode) -> &mut Self
Specify order in which nodes and edges are drawn.
default: breadthfirst
Source§fn pack(&mut self, pack: bool) -> &mut Self
fn pack(&mut self, pack: bool) -> &mut Self
Whether each connected component of the graph should be laid out separately, and then the
graphs packed together.
If false, the entire graph is laid out together.
The granularity and method of packing is influenced by the packmode attribute.
Source§fn pack_int(&mut self, pack: u32) -> &mut Self
fn pack_int(&mut self, pack: u32) -> &mut Self
Whether each connected component of the graph should be laid out separately, and then
the graphs packed together.
This is used as the size, in points,of a margin around each part; otherwise, a default
margin of 8 is used.
pack is treated as true if the value of pack iso a non-negative integer.
Source§fn pack_mode(&mut self, pack_mode: PackMode) -> &mut Self
fn pack_mode(&mut self, pack_mode: PackMode) -> &mut Self
This indicates how connected components should be packed (cf. packMode).
Note that defining packmode will automatically turn on packing as though one had set pack=true.
Source§fn pad(&mut self, pad: f32) -> &mut Self
fn pad(&mut self, pad: f32) -> &mut Self
Specifies how much, in inches, to extend the drawing area around the minimal area needed
to draw the graph.
Both the x and y pad values are set equal to the given value.
See
crate::attributes::GraphAttributes::pad_point
Source§fn pad_point(&mut self, pad: Point) -> &mut Self
fn pad_point(&mut self, pad: Point) -> &mut Self
Specifies how much, in inches, to extend the drawing area around the minimal area needed to
draw the graph.
This area is part of the drawing and will be filled with the background color, if appropriate.
default: 0.0555
Source§fn page(&mut self, page: f32) -> &mut Self
fn page(&mut self, page: f32) -> &mut Self
Width and height of output pages, in inches.
Value given is used for both the width and height.
Source§fn page_point(&mut self, page: Point) -> &mut Self
fn page_point(&mut self, page: Point) -> &mut Self
Width and height of output pages, in inches.
Source§fn page_dir(&mut self, page_dir: PageDirection) -> &mut Self
fn page_dir(&mut self, page_dir: PageDirection) -> &mut Self
The order in which pages are emitted.
Used only if page is set and applicable.
Limited to one of the 8 row or column major orders.
Source§fn quantum(&mut self, quantum: f32) -> &mut Self
fn quantum(&mut self, quantum: f32) -> &mut Self
If quantum > 0.0, node label dimensions will be rounded to integral multiples of the quantum.
default: 0.0, minimum: 0.0
Source§fn rank_dir(&mut self, rank_dir: RankDir) -> &mut Self
fn rank_dir(&mut self, rank_dir: RankDir) -> &mut Self
Sets direction of graph layout.
For example, if rankdir=“LR”, and barring cycles, an edge T -> H; will go from left to right.
By default, graphs are laid out from top to bottom.
This attribute also has a side-effect in determining how record nodes are interpreted.
See record shapes.
Source§fn rank_sep(&mut self, rank_sep: String) -> &mut Self
fn rank_sep(&mut self, rank_sep: String) -> &mut Self
sets the desired rank separation, in inches.
This is the minimum vertical distance between the bottom of the nodes in one rank
and the tops of nodes in the next. If the value contains equally,
the centers of all ranks are spaced equally apart.
Note that both settings are possible, e.g., ranksep=“1.2 equally”.
Source§fn ratio(&mut self, ratio: Ratio) -> &mut Self
fn ratio(&mut self, ratio: Ratio) -> &mut Self
Sets the aspect ratio (drawing height/drawing width) for the drawing.
Note that this is adjusted before the size attribute constraints are enforced.
Source§fn remincross(&mut self, remincross: bool) -> &mut Self
fn remincross(&mut self, remincross: bool) -> &mut Self
If true and there are multiple clusters, run crossing minimization a second time.
Source§fn rotate(&mut self, rotate: u32) -> &mut Self
fn rotate(&mut self, rotate: u32) -> &mut Self
If rotate=90, sets drawing orientation to landscape.
Source§fn show_boxes(&mut self, show_boxes: u32) -> &mut Self
fn show_boxes(&mut self, show_boxes: u32) -> &mut Self
Print guide boxes in PostScript at the beginning of routesplines if showboxes=1, or at
the end if showboxes=2.
(Debugging, TB mode only!)
default: 0, minimum: 0
Source§fn size(&mut self, size: u32, desired_min: bool) -> &mut Self
fn size(&mut self, size: u32, desired_min: bool) -> &mut Self
Maximum width and height of drawing, in inches.
Value used for both the width and the height.
If defined and the drawing is larger than the given size, the drawing
is uniformly scaled down so that it fits within the given size.
If desired_min is true, and both both dimensions of the drawing
are less than size, the drawing is scaled up uniformly until at
least one dimension equals its dimension in size.
See
crate::attributes::GraphAttributes::size_point
Source§fn size_point(&mut self, size: Point) -> &mut Self
fn size_point(&mut self, size: Point) -> &mut Self
Maximum width and height of drawing, in inches.
If defined and the drawing is larger than the given size, the drawing
is uniformly scaled down so that it fits within the given size.
If desired_min is true, and both both dimensions of the drawing
are less than size, the drawing is scaled up uniformly until at
least one dimension equals its dimension in size.
Source§fn sortv(&mut self, sortv: u32) -> &mut Self
fn sortv(&mut self, sortv: u32) -> &mut Self
If packmode indicates an array packing, sortv specifies an insertion order
among the components, with smaller values inserted first.
default: 0, minimum: 0
Source§fn splines(&mut self, splines: Splines) -> &mut Self
fn splines(&mut self, splines: Splines) -> &mut Self
Controls how, and if, edges are represented.
Source§fn style(&mut self, style: GraphStyle) -> &mut Self
fn style(&mut self, style: GraphStyle) -> &mut Self
Set style information for components of the graph.
Source§fn stylesheet(&mut self, stylesheet: String) -> &mut Self
fn stylesheet(&mut self, stylesheet: String) -> &mut Self
A URL or pathname specifying an XML style sheet, used in SVG output.
Combine with class to style elements using CSS selectors.
Source§fn target(&mut self, target: String) -> &mut Self
fn target(&mut self, target: String) -> &mut Self
If the object has a URL, this attribute determines which window of the browser is used for the URL.
Source§fn true_color(&mut self, true_color: bool) -> &mut Self
fn true_color(&mut self, true_color: bool) -> &mut Self
Whether internal bitmap rendering relies on a truecolor color model or uses a color palette.
If truecolor is unset, truecolor is not used unless there is a shapefile property
for some node in the graph.
The output model will use the input model when possible.
Source§fn url(&mut self, url: String) -> &mut Self
fn url(&mut self, url: String) -> &mut Self
Hyperlinks incorporated into device-dependent output.
Source§fn viewport(&mut self, viewport: ViewPort) -> &mut Self
fn viewport(&mut self, viewport: ViewPort) -> &mut Self
Clipping window on final drawing.
viewport supersedes any size attribute.
The width and height of the viewport specify precisely the final size of the output.
The viewPort W,H,Z,x,y or W,H,Z,N specifies a viewport for the final image.
The pair (W,H) gives the dimensions (width and height) of the final image, in points.
The optional Z is the zoom factor, i.e., the image in the original layout will be
W/Z by H/Z points in size. By default, Z is 1.
The optional last part is either a pair (x,y) giving a position in the original layout
of the graph,
in points, of the center of the viewport, or the name N of a node whose center should used
as the focus.
Auto Trait Implementations§
impl<'a> Freeze for GraphAttributeStatementBuilder<'a>
impl<'a> RefUnwindSafe for GraphAttributeStatementBuilder<'a>
impl<'a> Send for GraphAttributeStatementBuilder<'a>
impl<'a> Sync for GraphAttributeStatementBuilder<'a>
impl<'a> Unpin for GraphAttributeStatementBuilder<'a>
impl<'a> UnwindSafe for GraphAttributeStatementBuilder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more