improved styling
authorBen Pfaff <blp@cs.stanford.edu>
Wed, 24 Dec 2025 23:24:01 +0000 (15:24 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Wed, 24 Dec 2025 23:24:01 +0000 (15:24 -0800)
rust/pspp/src/spv/read/legacy_xml.rs
rust/pspp/src/spv/testdata/legacy3.expected

index 428da5aebfbef85b1b5882968598a24c0fa3e9d6..d707bb54ee38d90a95830f156aee41e8966544e9 100644 (file)
@@ -397,29 +397,32 @@ impl Visualization {
             dims: &mut Vec<Dim<'a>>,
         ) {
             let base_level = variables[0].1;
-            let show_label = if let Ok(a) = Axis2::try_from(a)
+            let (show_label, dimension_style) = if let Ok(a) = Axis2::try_from(a)
                 && let Some(axis) = axes.get(&(base_level + variables.len()))
                 && let Some(label) = &axis.label
             {
-                let out = &mut look.areas[Area::Labels(a)];
-                *out = AreaStyle::default_for_area(Area::Labels(a));
+                let mut dimension_style = AreaStyle::default_for_area(Area::Labels(a));
                 let style = label.style.get(&styles);
+                dbg!(variables, label, style);
                 Style::decode_area(
                     style,
                     label.text_frame_style.as_ref().and_then(|r| r.get(styles)),
-                    out,
+                    &mut dimension_style,
                 );
-                style.is_some_and(|s| s.visible.unwrap_or(true))
+                (
+                    style.is_some_and(|s| s.visible.unwrap_or(true)),
+                    Some(dimension_style),
+                )
             } else {
-                false
+                (false, None)
             };
-            if a == Axis3::Y
+            if let Ok(a) = Axis2::try_from(a)
                 && let Some(axis) = axes.get(&(base_level + variables.len() - 1))
             {
                 Style::decode_area(
                     axis.major_ticks.style.get(&styles),
                     axis.major_ticks.tick_frame_style.get(&styles),
-                    &mut look.areas[Area::Labels(Axis2::Y)],
+                    &mut look.areas[Area::Labels(a)],
                 );
             }
 
@@ -522,15 +525,22 @@ impl Visualization {
                 cats = next_cats;
             }
 
+            let dimension_label = variables[0]
+                .label
+                .as_ref()
+                .map_or_else(|| Value::new_empty(), |label| Value::new_user_text(label));
+            let dimension_label = if let Some(style) = dimension_style {
+                dimension_label
+                    .with_cell_style(style.cell_style)
+                    .with_font_style(style.font_style)
+            } else {
+                dimension_label
+            };
+
             let dimension = Dimension::new(
-                Group::new(
-                    variables[0]
-                        .label
-                        .as_ref()
-                        .map_or_else(|| Value::new_empty(), |label| Value::new_user_text(label)),
-                )
-                .with_multiple(cats.into_iter().map(|cb| cb.category))
-                .with_show_label(show_label),
+                Group::new(dimension_label)
+                    .with_multiple(cats.into_iter().map(|cb| cb.category))
+                    .with_show_label(show_label),
             )
             .with_hide_all_labels(hide_all_labels);
 
index 22821935f1dedf48e77da254dc7c31fcc2a3306d..457ebbb2ea35b6acb365fc338593df677b6155b9 100644 (file)
@@ -1,8 +1,8 @@
                            Excluded Variables[d]
 ╭───────┬────────┬──────┬────┬───────────────────┬───────────────────────╮
-│       │        │      │    │                   │Collinearity Statistics│
+│Model  │        │      │    │                   │Collinearity Statistics│
 │       │        │      │    │                   ├───────────────────────┤
-│Model  │ Beta In│   t  │Sig.│Partial Correlation│       Tolerance       │
+│       │ Beta In│   t  │Sig.│Partial Correlation│       Tolerance       │
 ├───────┼────────┼──────┼────┼───────────────────┼───────────────────────┤
 │1     A│-.304[a]│-2.216│.032│              -.317│                   .987│
 │      B│ .611[a]│ 5.532│.000│               .641│                   .999│