pub struct Layout {Show 20 fields
pub target: Target,
pub title: String,
pub size: [f64; 2],
pub background: String,
pub frame: Rect,
pub window: Window,
pub whole: Window,
pub scale: [f64; 2],
pub exaggeration: Option<f64>,
pub exaggeration_text: String,
pub origin_text: String,
pub origin_x: f64,
pub x_axis: Axis,
pub y_axis: Axis,
pub layers: Vec<Layer>,
pub warnings: Vec<String>,
pub folded_labels: usize,
pub note_lines: usize,
pub metadata: Metadata,
pub left_shift: f64,
}Expand description
Everything the SVG writer needs, decided: positions in pixels, ticks, fills, labels, warnings.
Fields§
§target: TargetWhat is drawn.
title: StringThe drawing’s own title (“Long section”, “Cross section 2”, “Plan”).
size: [f64; 2]Width and height, pixels.
background: StringThe background colour.
frame: RectThe plot area, pixels.
window: WindowThe window really drawn (what View::window asked, or everything with a
margin; in the plan, widened to the frame’s proportions).
whole: WindowThe window this drawing would have with View::window unset: the whole
extent. The same whatever window was asked, so a front end that holds a
zoomed drawing still knows what to clamp its zooms to.
scale: [f64; 2]Pixels per unit of the window, [horizontal, vertical].
exaggeration: Option<f64>The vertical exaggeration those scales give - scale[1] / scale[0] -
for a section; None for the plan, which is equal on both axes.
exaggeration_text: StringWhat is written about it on the drawing: "vertical exaggeration ×2.5".
origin_text: StringThe position of the trace’s first point (s = 0) with its EPSG code,
written at the centre of the title band - shortened to the code, or left
out (and counted in the warnings), when the band is too narrow. Empty
when the view asks for none.
origin_x: f64Where that text starts, pixels: centred on the frame, clamped to the free space between the title and the exaggeration.
x_axis: AxisThe horizontal axis.
y_axis: AxisThe vertical axis.
layers: Vec<Layer>The layers, back to front.
warnings: Vec<String>What the drawing prints about itself: refused objects, wells set aside, a projection in time, an axis it could not draw, labels folded.
folded_labels: usizeHow many labels did not fit and were folded.
note_lines: usizeHow many lines of notes the drawing has room for under its plot -
what Layout::written_warnings writes. 0 when the view asks for no
notes.
metadata: MetadataWhat the SVG’s <metadata> carries.
left_shift: f64Pixels kept on the left of the axes for the strata legend; 0 when there
is none. The axes’ own furniture (the vertical title) moves by as much.
Implementations§
Source§impl Layout
impl Layout
Sourcepub fn written_warnings(&self) -> Vec<String>
pub fn written_warnings(&self) -> Vec<String>
The warnings as they are written under the plot: every one when they
fit in Layout::note_lines, else as many as fit less one, and a last
line counting the others - a note dropped is still said to exist.