pub trait RailroadNode: Debug {
    fn entry_height(&self) -> i64;
    fn height(&self) -> i64;
    fn width(&self) -> i64;
    fn draw(&self, x: i64, y: i64) -> Element;

    fn height_below_entry(&self) -> i64 { ... }
}
Expand description

A diagram is built from a set of primitives which implement RailroadNode.

A primitive is a geometric box, within which it can draw whatever it wants. Simple primitives (e.g. Start) have fixed width, height etc.. Complex primitives, which wrap other primitives, (e.g. Sequence) use the methods defined here to compute their own geometry. When the time comes for a primitive to be drawn, the wrapping primitive computes the desired location of the wrapped primitive(s) and calls .draw() on them. It is the primitive’s job to ensure that it uses only the space it announced.

Required Methods

The vertical distance from this element’s top to where the entering, connecting path is drawn.

By convention, the path connecting primitives enters from the left.

This primitives’s total height.

This primitive’s total width.

Draw this element as an svg::Element.

Provided Methods

source

fn height_below_entry(&self) -> i64

The vertical distance from the height of the connecting path to the bottom.

Implementations on Foreign Types

Implementors