pub struct Layout {
pub id: String,
pub name: String,
pub kind: &'static str,
pub flip_y: bool,
pub nodes: BTreeMap<usize, (f64, f64)>,
pub edges: BTreeMap<usize, Vec<(f64, f64)>>,
pub sizes: BTreeMap<usize, (f64, f64)>,
pub unit: Option<f64>,
pub tracks: BTreeMap<usize, i32>,
}Expand description
Positions of nodes and routes of edges, in one diagram (DL) or one coordinate system (GL), as the data writes them.
Fields§
§id: String§name: String§kind: &'static strdiagram (x right, y as flip_y says) or geographic (x longitude,
y latitude, in degrees).
flip_y: boolA diagram whose y grows upwards (OrientationKind.positive).
nodes: BTreeMap<usize, (f64, f64)>Node index → position.
edges: BTreeMap<usize, Vec<(f64, f64)>>Edge index → its route, from its source’s end to its target’s.
sizes: BTreeMap<usize, (f64, f64)>Node index → its width and height, where the layout sizes it (a busbar, as long as the bays it joins).
unit: Option<f64>Pixels per unit, where the positions are to be drawn as they are;
None, to be scaled to fit.
tracks: BTreeMap<usize, i32>Edge index → how many line spacings aside it runs from its route, to the left of its way (negative: right); the views space them in pixels.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Layout
impl Freeze for Layout
impl Move for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnsafeUnpin for Layout
impl UnwindSafe for Layout
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