hydro_lang/graph/
config.rs

1use clap::{Parser, ValueEnum};
2
3/// Enum for choosing between mermaid, dot, and reactflow graph writing.
4#[derive(Copy, Clone, Debug, ValueEnum)]
5pub enum GraphType {
6    /// Mermaid graphs.
7    Mermaid,
8    /// Dot (Graphviz) graphs.
9    Dot,
10    /// Reactflow.js interactive graphs.
11    Reactflow,
12}
13
14impl std::fmt::Display for GraphType {
15    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16        write!(f, "{:?}", self)
17    }
18}
19
20/// Configuration for graph generation in examples.
21#[derive(Parser, Debug, Default)]
22pub struct GraphConfig {
23    /// Graph format to generate and display
24    #[clap(long)]
25    pub graph: Option<GraphType>,
26
27    /// Don't show metadata in graph nodes
28    #[clap(long)]
29    pub no_metadata: bool,
30
31    /// Don't show location groups
32    #[clap(long)]
33    pub no_location_groups: bool,
34
35    /// Don't include tee IDs in nodes
36    #[clap(long)]
37    pub no_tee_ids: bool,
38
39    /// Use full/long labels instead of short ones
40    #[clap(long)]
41    pub long_labels: bool,
42}