rustfst/drawing_config.rs
1/// Struct to configure how the FST should be drawn.
2#[derive(Debug, Clone, PartialEq)]
3pub struct DrawingConfig {
4 /// Draw bottom-to-top instead of left-to-right.
5 pub vertical: bool,
6 /// Set pair (width, height)
7 pub size: Option<(f32, f32)>,
8 /// Set figure title.
9 pub title: String,
10 /// Portrait mode (def: landscape).
11 pub portrait: bool,
12 /// Set minimum separation between ranks (see dot documentation).
13 pub ranksep: Option<f32>,
14 /// Set minimum separation between nodes (see dot documentation).
15 pub nodesep: Option<f32>,
16 /// Set fontsize.
17 pub fontsize: u32,
18 /// Input in acceptor format.
19 pub acceptor: bool,
20 /// Print/draw transition weights and final weights equal to Weight::ONE.
21 pub show_weight_one: bool,
22 /// Print/draw transition weights and final weights.
23 pub print_weight: bool,
24}
25
26impl Default for DrawingConfig {
27 fn default() -> Self {
28 Self {
29 vertical: false,
30 size: None,
31 title: "".to_string(),
32 portrait: false,
33 ranksep: None,
34 nodesep: None,
35 fontsize: 14,
36 acceptor: false,
37 show_weight_one: true,
38 print_weight: true,
39 }
40 }
41}