diff options
Diffstat (limited to 'src/attributes/splines.rs')
-rw-r--r-- | src/attributes/splines.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/attributes/splines.rs b/src/attributes/splines.rs new file mode 100644 index 0000000..5ac9b65 --- /dev/null +++ b/src/attributes/splines.rs @@ -0,0 +1,31 @@ +use crate::dot::DotString; +use std::borrow::Cow; + +/// Spline, edges are drawn as splines routed around nodes +/// Line, edges are drawn as line segments +/// Polygon, specifies that edges should be drawn as polylines. +/// Ortho, specifies edges should be routed as polylines of axis-aligned segments. +/// Curved, specifies edges should be drawn as curved arcs. +/// splines=line and splines=spline can be used as synonyms for +/// splines=false and splines=true, respectively. +pub enum Splines { + Line, + Spline, + None, + Curved, + Polyline, + Ortho, +} + +impl<'a> DotString<'a> for Splines { + fn dot_string(&self) -> Cow<'a, str> { + match self { + Splines::Line => "line".into(), + Splines::Spline => "spline".into(), + Splines::None => "none".into(), + Splines::Curved => "curved".into(), + Splines::Polyline => "polyline".into(), + Splines::Ortho => "ortho".into(), + } + } +} |