pub struct RenderOptions {
pub max_width: Option<usize>,
pub ascii: bool,
pub color: bool,
pub backend: LayoutBackend,
pub gaps_override: Option<(usize, usize)>,
}Expand description
Bundle of optional rendering knobs accepted by render_with_options.
All fields default to “off / unconstrained”: RenderOptions::default()
yields a result identical to [render].
ANSI color is opt-in. When color is false (the default) the output is
guaranteed to contain zero ANSI escape bytes, matching the historical
“deterministic, newline-delimited” contract.
Fields§
§max_width: Option<usize>Optional column budget. When Some(n), progressive compaction is
attempted to keep the longest line within n cells.
ascii: boolReplace Unicode box-drawing glyphs with ASCII equivalents (see
to_ascii). Composes freely with color.
color: boolEmit ANSI 24-bit color SGR sequences derived from style /
linkStyle directives. Off by default so existing callers see no
behaviour change.
backend: LayoutBackendChoose the layered-layout backend.
Defaults to LayoutBackend::Sugiyama since 0.17.0 — the
ascii-dag-backed layout with proper crossing minimisation,
long-edge dummy nodes, and Brandes-Köpf coordinate assignment.
Set to LayoutBackend::Native to use the in-house layered
layout explicitly (e.g. to keep byte-identical output with
pre-0.17.0 renders, or for edge-style features not yet fully
covered by the Sugiyama wrapper).
gaps_override: Option<(usize, usize)>Optional explicit (layer_gap, node_gap) override for flowchart
and state diagrams. When set, bypasses the
max_width-driven compaction pipeline entirely and renders
directly with the given gaps. Lets callers expose continuous
zoom/spacing controls (e.g. a +/- keymap in a viewer) without
being limited to the three preset compaction levels.
Ignored by sequence, pie, and erDiagram (those have their own layout pipelines).
Trait Implementations§
Source§impl Clone for RenderOptions
impl Clone for RenderOptions
Source§fn clone(&self) -> RenderOptions
fn clone(&self) -> RenderOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more