lichtung_plot/layout/
facet_binding.rs1use crate::data::KeyValues;
4
5#[derive(Debug, Clone, PartialEq, Eq)]
7pub enum FacetBinding {
8 Wrap(KeyValues),
10 Grid {
12 row: KeyValues,
14 column: KeyValues,
16 },
17}
18
19impl FacetBinding {
20 pub fn get_wrap(&self) -> Option<&KeyValues> {
22 match self {
23 Self::Wrap(values) => Some(values),
24 Self::Grid { .. } => None,
25 }
26 }
27
28 pub fn get_grid(&self) -> Option<(&KeyValues, &KeyValues)> {
30 match self {
31 Self::Grid { row, column } => Some((row, column)),
32 Self::Wrap(_) => None,
33 }
34 }
35}