Trait dotavious::attributes::NodeAttributes[][src]

pub trait NodeAttributes<'a> {
    fn add_attribute<S: Into<String>>(
        &mut self,
        key: S,
        value: AttributeText<'a>
    ) -> &mut Self;
fn add_attributes(
        &'a mut self,
        attributes: HashMap<String, AttributeText<'a>>
    ) -> &mut Self;
fn get_attributes_mut(&mut self) -> &mut IndexMap<String, AttributeText<'a>>;
fn add_validation_error(
        &mut self,
        field: &'static str,
        message: &'static str
    ); fn area(&mut self, area: f32) -> &mut Self { ... }
fn class(&mut self, class: String) -> &mut Self { ... }
fn color(&mut self, color: Color<'a>) -> &mut Self { ... }
fn color_scheme(&mut self, color_scheme: String) -> &mut Self { ... }
fn comment(&mut self, comment: String) -> &mut Self { ... }
fn distortion(&mut self, distortion: f32) -> &mut Self { ... }
fn fill_color(&mut self, fill_color: Color<'a>) -> &mut Self { ... }
fn fill_color_with_colorlist(
        &mut self,
        fill_colors: ColorList<'a>
    ) -> &mut Self { ... }
fn fill_color_with_iter<I>(&mut self, fill_colors: I) -> &mut Self
    where
        I: IntoIterator,
        I::Item: IntoWeightedColor<'a>
, { ... }
fn fixed_size(&mut self, fixed_size: bool) -> &mut Self { ... }
fn font_color(&mut self, font_color: Color<'a>) -> &mut Self { ... }
fn font_name(&mut self, font_name: String) -> &mut Self { ... }
fn font_size(&mut self, font_size: f32) -> &mut Self { ... }
fn gradient_angle(&mut self, gradient_angle: u32) -> &mut Self { ... }
fn group(&mut self, group: String) -> &mut Self { ... }
fn height(&mut self, height: f32) -> &mut Self { ... }
fn image(&mut self, image: String) -> &mut Self { ... }
fn image_pos(&mut self, image_pos: ImagePosition) -> &mut Self { ... }
fn image_scale_bool(&mut self, image_scale: bool) -> &mut Self { ... }
fn image_scale(&mut self, image_scale: ImageScale) -> &mut Self { ... }
fn label<S: Into<Cow<'a, str>>>(&mut self, text: S) -> &mut Self { ... }
fn label_location(&mut self, label_location: LabelLocation) -> &mut Self { ... }
fn layer(&mut self, layer: String) -> &mut Self { ... }
fn margin(&mut self, margin: f32) -> &mut Self { ... }
fn margin_point(&mut self, margin: Point) -> &mut Self { ... }
fn no_justify(&mut self, no_justify: bool) -> &mut Self { ... }
fn ordering(&mut self, ordering: Ordering) -> &mut Self { ... }
fn orientation(&mut self, orientation: f32) -> &mut Self { ... }
fn pen_width(&mut self, pen_width: f32) -> &mut Self { ... }
fn peripheries(&mut self, peripheries: u32) -> &mut Self { ... }
fn pos(&mut self, pos: Point) -> &mut Self { ... }
fn rects(&mut self, rect: Rectangle) -> &mut Self { ... }
fn regular(&mut self, regular: bool) -> &mut Self { ... }
fn sample_points(&mut self, sample_points: u32) -> &mut Self { ... }
fn shape(&mut self, shape: Shape) -> &mut Self { ... }
fn show_boxes(&mut self, show_boxes: u32) -> &mut Self { ... }
fn sides(&mut self, sides: u32) -> &mut Self { ... }
fn skew(&mut self, skew: f32) -> &mut Self { ... }
fn sortv(&mut self, sortv: u32) -> &mut Self { ... }
fn style(&mut self, style: NodeStyle) -> &mut Self { ... }
fn target(&mut self, target: String) -> &mut Self { ... }
fn tooltip(&mut self, tooltip: String) -> &mut Self { ... }
fn url(&mut self, url: String) -> &mut Self { ... }
fn vertices(&mut self, vertices: String) -> &mut Self { ... }
fn width(&mut self, width: f32) -> &mut Self { ... }
fn xlabel(&mut self, xlabel: String) -> &mut Self { ... }
fn xlp(&mut self, xlp: Point) -> &mut Self { ... } }

Required methods

fn add_attribute<S: Into<String>>(
    &mut self,
    key: S,
    value: AttributeText<'a>
) -> &mut Self
[src]

Add an attribute to the node.

fn add_attributes(
    &'a mut self,
    attributes: HashMap<String, AttributeText<'a>>
) -> &mut Self
[src]

Add multiple attribures to the node.

fn get_attributes_mut(&mut self) -> &mut IndexMap<String, AttributeText<'a>>[src]

fn add_validation_error(&mut self, field: &'static str, message: &'static str)[src]

Loading content...

Provided methods

fn area(&mut self, area: f32) -> &mut Self[src]

Indicates the preferred area for a node or empty cluster when laid out by patchwork. default: 1.0, minimum: > 0

fn class(&mut self, class: String) -> &mut Self[src]

Classnames to attach to the node’s SVG element. Combine with stylesheet for styling SVG output using CSS classnames. Multiple space-separated classes are supported.

fn color(&mut self, color: Color<'a>) -> &mut Self[src]

Basic drawing color for graphics, not text. For the latter, use the fontcolor attribute.

fn color_scheme(&mut self, color_scheme: String) -> &mut Self[src]

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”.

fn comment(&mut self, comment: String) -> &mut Self[src]

Comments are inserted into output. Device-dependent

fn distortion(&mut self, distortion: f32) -> &mut Self[src]

Distortion factor for shape=polygon. Positive values cause top part to be larger than bottom; negative values do the opposite.

fn fill_color(&mut self, fill_color: Color<'a>) -> &mut Self[src]

Color used to fill the background of a node or cluster assuming style=filled, or a filled arrowhead.

fn fill_color_with_colorlist(&mut self, fill_colors: ColorList<'a>) -> &mut Self[src]

Color used to fill the background, with a gradient, of a node or cluster assuming style=filled, or a filled arrowhead.

fn fill_color_with_iter<I>(&mut self, fill_colors: I) -> &mut Self where
    I: IntoIterator,
    I::Item: IntoWeightedColor<'a>, 
[src]

Color used to fill the background, with a gradient, of a node or cluster assuming style=filled, or a filled arrowhead. TODO: example

fn fixed_size(&mut self, fixed_size: bool) -> &mut Self[src]

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 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.

fn font_color(&mut self, font_color: Color<'a>) -> &mut Self[src]

Color used for text.

fn font_name(&mut self, font_name: String) -> &mut Self[src]

Font used for text.

fn font_size(&mut self, font_size: f32) -> &mut Self[src]

Font size, in points, used for text. default: 14.0, minimum: 1.0

fn gradient_angle(&mut self, gradient_angle: u32) -> &mut Self[src]

If a gradient fill is being used, this determines the angle of the fill.

fn group(&mut self, group: String) -> &mut Self[src]

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.

fn height(&mut self, height: f32) -> &mut Self[src]

Height of node, in inches. default: 0.5, minimum: 0.02

fn image(&mut self, image: String) -> &mut Self[src]

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.

fn image_pos(&mut self, image_pos: ImagePosition) -> &mut Self[src]

Controls how an image is positioned within its containing node. Only has an effect when the image is smaller than the containing node.

fn image_scale_bool(&mut self, image_scale: bool) -> &mut Self[src]

Controls how an image fills its containing node.

fn image_scale(&mut self, image_scale: ImageScale) -> &mut Self[src]

Controls how an image fills its containing node.

fn label<S: Into<Cow<'a, str>>>(&mut self, text: S) -> &mut Self[src]

Text label attached to objects.

fn label_location(&mut self, label_location: LabelLocation) -> &mut Self[src]

fn layer(&mut self, layer: String) -> &mut Self[src]

Specifies layers in which the node, edge or cluster is present.

fn margin(&mut self, margin: f32) -> &mut Self[src]

Sets x and y margins of canvas, in inches. Both margins are set equal to the given value. See crate::attributes::NodeAttributes::margin_point

fn margin_point(&mut self, margin: Point) -> &mut Self[src]

Sets x and y margins of canvas, in inches. Specifies space left around the node’s label. 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.

fn no_justify(&mut self, no_justify: bool) -> &mut Self[src]

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.

fn ordering(&mut self, ordering: Ordering) -> &mut Self[src]

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.

If ordering=“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.

fn orientation(&mut self, orientation: f32) -> &mut Self[src]

Angle, in degrees, to rotate polygon node shapes. For any number of polygon sides, 0 degrees rotation results in a flat base. Used only if rotate is not defined. Default: 0.0 and minimum: 360.0

fn pen_width(&mut self, pen_width: f32) -> &mut Self[src]

Specifies the width of the pen, in points, used to draw lines and curves, including the boundaries of edges and clusters. default: 1.0, minimum: 0.0

fn peripheries(&mut self, peripheries: u32) -> &mut Self[src]

Set number of peripheries used in polygonal shapes and cluster boundaries.

fn pos(&mut self, pos: Point) -> &mut Self[src]

Position of node, or spline control points. the position indicates the center of the node. On output, the coordinates are in points.

fn rects(&mut self, rect: Rectangle) -> &mut Self[src]

Rectangles for fields of records, in points.

fn regular(&mut self, regular: bool) -> &mut Self[src]

If true, force polygon to be regular, i.e., the vertices of the polygon will lie on a circle whose center is the center of the node.

fn sample_points(&mut self, sample_points: u32) -> &mut Self[src]

Gives the number of points used for a circle/ellipse node.

fn shape(&mut self, shape: Shape) -> &mut Self[src]

Sets the shape of a node.

fn show_boxes(&mut self, show_boxes: u32) -> &mut Self[src]

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

fn sides(&mut self, sides: u32) -> &mut Self[src]

Number of sides when shape=polygon.

fn skew(&mut self, skew: f32) -> &mut Self[src]

Skew factor for shape=polygon. Positive values skew top of polygon to right; negative to left. default: 0.0, minimum: -100.0

fn sortv(&mut self, sortv: u32) -> &mut Self[src]

If packmode indicates an array packing, sortv specifies an insertion order among the components, with smaller values inserted first. default: 0, minimum: 0

fn style(&mut self, style: NodeStyle) -> &mut Self[src]

Set style information for components of the graph.

fn target(&mut self, target: String) -> &mut Self[src]

If the object has a URL, this attribute determines which window of the browser is used for the URL.

fn tooltip(&mut self, tooltip: String) -> &mut Self[src]

Tooltip annotation attached to the node or edge. If unset, Graphviz will use the object’s label if defined. Note that if the label is a record specification or an HTML-like label, the resulting tooltip may be unhelpful. In this case, if tooltips will be generated, the user should set a tooltip attribute explicitly.

fn url(&mut self, url: String) -> &mut Self[src]

Hyperlinks incorporated into device-dependent output.

fn vertices(&mut self, vertices: String) -> &mut Self[src]

Sets the coordinates of the vertices of the node’s polygon, in inches. A list of points, separated by spaces.

fn width(&mut self, width: f32) -> &mut Self[src]

Width of node, in inches. This is taken as the initial, minimum width of the node. If fixedsize is true, this will be the final width of the node. Otherwise, if the node label requires more width to fit, the node’s width will be increased to contain the label.

fn xlabel(&mut self, xlabel: String) -> &mut Self[src]

External label for a node or edge. The label will be placed outside of the node but near it. 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, set forcelabels=true.

fn xlp(&mut self, xlp: Point) -> &mut Self[src]

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

Loading content...

Implementors

impl<'a> NodeAttributes<'a> for NodeAttributeStatementBuilder<'a>[src]

fn add_attributes(
    &'a mut self,
    attributes: HashMap<String, AttributeText<'a>>
) -> &mut Self
[src]

Add multiple attributes to the node.

impl<'a> NodeAttributes<'a> for NodeBuilder<'a>[src]

fn add_attributes(
    &'a mut self,
    attributes: HashMap<String, AttributeText<'a>>
) -> &mut Self
[src]

Add multiple attributes to the edge.

Loading content...