#[derive(Default, Debug)]
struct Target<'a> {
- graph: Option<&'a Style>,
labeling: Option<&'a Style>,
- interval: Option<&'a Style>,
major_ticks: Option<&'a Style>,
frame: Option<&'a Style>,
format: Option<(&'a SetFormat, Option<TargetType>)>,
has_cell_footnotes: bool,
) {
let mut wheres = Vec::new();
- let mut alternating = false;
for child in &intersect.children {
match child {
IntersectChild::Where(w) => wheres.push(w),
IntersectChild::IntersectWhere(_) => {
// Presumably we should do something (but we don't).
}
- IntersectChild::Alternating => alternating = true,
- IntersectChild::Empty => (),
+ IntersectChild::Alternating | IntersectChild::Empty => (),
}
}
dbg!(&scp.id, self, intersect);
match self {
- Self {
- graph: Some(_),
- labeling: None,
- interval: None,
- major_ticks: None,
- frame: None,
- format: None,
- } => {
- // `graph.width` likely just sets the width of the table as a whole.
- }
- Self {
- graph: None,
- labeling: None,
- interval: None,
- major_ticks: None,
- frame: None,
- format: None,
- } => {
- // No-op. (Presumably there's a setMetaData we don't care about.)
- }
Self {
format: Some((_, Some(TargetType::MajorTicks))),
..
| Self {
major_ticks: Some(_),
..
- }
- | Self { frame: Some(_), .. }
- if !wheres.is_empty() =>
- {
+ } if !wheres.is_empty() => {
// Formatting for individual row or column labels.
dbg!();
for w in &wheres {
}
| Self {
labeling: Some(_), ..
- }
- | Self {
- interval: Some(_), ..
} => {
// Formatting for individual cells or groups of them
// with some dimensions in common.
Set::SetStyle(set_style) => {
if let Some(style) = set_style.style.get(&styles) {
match TargetType::from_id(&set_style.target, graph, &major_ticks) {
- Some(TargetType::Graph) => target.graph = Some(style),
- Some(TargetType::Interval) => target.interval = Some(style),
Some(TargetType::Labeling) => target.labeling = Some(style),
Some(TargetType::MajorTicks) => target.major_ticks = Some(style),
- None => (),
+ Some(TargetType::Interval) | Some(TargetType::Graph) | None => (),
}
}
}
.format
.is_some_and(|(_sf, target_type)| target_type == Some(TargetType::Labeling))
|| target.labeling.is_some()
- || target.interval.is_some()
{
for value in data.values_mut() {
Style::apply_to_value(