work
authorBen Pfaff <blp@cs.stanford.edu>
Wed, 24 Dec 2025 22:26:32 +0000 (14:26 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Wed, 24 Dec 2025 22:26:32 +0000 (14:26 -0800)
rust/pspp/src/output/pivot.rs
rust/pspp/src/spv/read/legacy_xml.rs
rust/pspp/src/spv/read/tests.rs
rust/pspp/src/spv/testdata/legacy8.expected [new file with mode: 0644]
rust/pspp/src/spv/testdata/legacy8.spv [new file with mode: 0644]

index 679ae347e1f13ffc8cd05981ad40c008f2f3f4c7..9b099e71d3d9bda4d5d4ae0b73e388de8f679d9d 100644 (file)
@@ -626,8 +626,14 @@ impl Dimension {
 
     /// Returns this dimension with [Dimension::hide_all_labels] set to true.
     pub fn with_all_labels_hidden(self) -> Self {
+        self.with_hide_all_labels(true)
+    }
+
+    /// Returns this dimension with [Dimension::hide_all_labels] set to
+    /// `hide_all_labels`.
+    pub fn with_hide_all_labels(self, hide_all_labels: bool) -> Self {
         Self {
-            hide_all_labels: true,
+            hide_all_labels,
             ..self
         }
     }
index 5b4a5473f74aab812e52dc2190dd75a6c2d7309b..428da5aebfbef85b1b5882968598a24c0fa3e9d6 100644 (file)
@@ -433,6 +433,15 @@ impl Visualization {
                 }
             }
 
+            let hide_all_labels = if let Some(axis) = axes.get(&base_level)
+                && let Some(style) = axis.major_ticks.style.get(styles)
+                && style.visible == Some(false)
+            {
+                true
+            } else {
+                false
+            };
+
             let variables = variables
                 .into_iter()
                 .map(|(series, _level)| *series)
@@ -522,7 +531,8 @@ impl Visualization {
                 )
                 .with_multiple(cats.into_iter().map(|cb| cb.category))
                 .with_show_label(show_label),
-            );
+            )
+            .with_hide_all_labels(hide_all_labels);
 
             for variable in &variables {
                 variable.dimension_index.set(Some(dims.len()));
index bf122980109d8ce1340bcc868720d0cd0bdb77c9..cf51c110d1af6c6d5c4ba1da33e00f3fc5f8377e 100644 (file)
@@ -49,6 +49,12 @@ fn legacy7() {
     test_raw_spvfile("legacy7");
 }
 
+/// Checks for `Dimension::hide_all_labels`.
+#[test]
+fn legacy8() {
+    test_raw_spvfile("legacy8");
+}
+
 fn test_raw_spvfile(name: &str) {
     let input_filename = Path::new("src/spv/testdata")
         .join(name)
diff --git a/rust/pspp/src/spv/testdata/legacy8.expected b/rust/pspp/src/spv/testdata/legacy8.expected
new file mode 100644 (file)
index 0000000..af8a9f6
--- /dev/null
@@ -0,0 +1,4 @@
+                    Warnings
+╭──────────────────────────────────────────────╮
+│The Independent Samples table is not produced.│
+╰──────────────────────────────────────────────╯
diff --git a/rust/pspp/src/spv/testdata/legacy8.spv b/rust/pspp/src/spv/testdata/legacy8.spv
new file mode 100644 (file)
index 0000000..f8daabf
Binary files /dev/null and b/rust/pspp/src/spv/testdata/legacy8.spv differ