wolf-graph-mermaid 0.1.0

Adds support for generating Mermaid diagrams from wolf-graph graphs.
Documentation
use std::fmt;

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum LayoutDirection {
    TopToBottom,
    LeftToRight,
    BottomToTop,
    RightToLeft,
}

impl LayoutDirection {
    pub fn direction(&self) -> &'static str {
        match self {
            LayoutDirection::TopToBottom => "TB",
            LayoutDirection::LeftToRight => "LR",
            LayoutDirection::BottomToTop => "BT",
            LayoutDirection::RightToLeft => "RL",
        }
    }
}

impl fmt::Display for LayoutDirection {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{}", self.direction())
    }
}