Change ascii art to unicode art
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 15 Apr 2025 16:33:17 +0000 (09:33 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 15 Apr 2025 16:33:17 +0000 (09:33 -0700)
rust/pspp/src/output/pivot/mod.rs
rust/pspp/src/output/pivot/output.rs

index 4f4f49ca006a517ec51fa6713dfaf8551ec0f8b8..65905cced5e49fdc9d09dab2a4e8739908cd7259 100644 (file)
@@ -713,18 +713,16 @@ pub enum LabelPosition {
     /// labels, group labels appear to the left of the categories.
     ///
     /// ```text
-    ///                         +---------+----------+
-    ///                         |         | columns  |
-    /// +----+----+----+----+   +------+--+----------+
-    /// |    |    nested    |   |      |a1|...data...|
-    /// |    +----+----+----+   |nested|a2|...data...|
-    /// |    | a1 | a2 | a3 |   |      |a3|...data...|
-    /// +----+----+----+----+   +------+--+----------+
-    /// |    |data|data|data|
-    /// |    | .  | .  | .  |
-    /// |rows| .  | .  | .  |
-    /// |    | .  | .  | .  |
-    /// +----+----+----+----+
+    /// ┌────┬──────────────┐   ┌─────────┬──────────┐
+    /// │    │    nested    │   │         │ columns  │
+    /// │    ├────┬────┬────┤   ├──────┬──┼──────────┤
+    /// │    │ a1 │ a2 │ a3 │   │      │a1│...data...│
+    /// ├────┼────┼────┼────┤   │nested│a2│...data...│
+    /// │    │data│data│data│   │      │a3│...data...│
+    /// │    │ .  │ .  │ .  │   └──────┴──┴──────────┘
+    /// │rows│ .  │ .  │ .  │
+    /// │    │ .  │ .  │ .  │
+    /// └────┴────┴────┴────┘
     /// ```
     #[serde(rename = "nested")]
     Nested,
@@ -732,13 +730,13 @@ pub enum LabelPosition {
     /// In the corner (row labels only).
     ///
     /// ```text
-    /// +------+----------+
-    /// |corner| columns  |
-    /// +------+----------+
-    /// |    a1|...data...|
-    /// |    a2|...data...|
-    /// |    a3|...data...|
-    /// +------+----------+
+    /// ┌──────┬──────────┐
+    /// │corner│ columns  │
+    /// ├──────┼──────────┤
+    /// │    a1│...data...│
+    /// │    a2│...data...│
+    /// │    a3│...data...│
+    /// └──────┴──────────┘
     /// ```
     #[default]
     #[serde(rename = "inCorner")]
@@ -748,15 +746,15 @@ pub enum LabelPosition {
 /// The heading region of a rendered pivot table:
 ///
 /// ```text
-/// +------------------+-------------------------------------------------+
-/// |                  |                  column headings                |
-/// |                  +-------------------------------------------------+
-/// |      corner      |                                                 |
-/// |       and        |                                                 |
-/// |   row headings   |                      data                       |
-/// |                  |                                                 |
-/// |                  |                                                 |
-/// +------------------+-------------------------------------------------+
+/// ┌──────────────────┬─────────────────────────────────────────────────┐
+/// │                  │                  column headings                │
+/// │                  ├─────────────────────────────────────────────────┤
+/// │      corner      │                                                 │
+/// │       and        │                                                 │
+/// │   row headings   │                      data                       │
+/// │                  │                                                 │
+/// │                  │                                                 │
+/// └──────────────────┴─────────────────────────────────────────────────┘
 /// ```
 #[derive(Copy, Clone, Debug, PartialEq, Eq, Enum)]
 pub enum HeadingRegion {
index 8c769eee5f8516b86b734cc9daaa33177e7ccf17..fd63bf8174313772c3a92864b063e857a2d5b3e0 100644 (file)
@@ -443,19 +443,19 @@ impl<'a> Heading<'a> {
                 // than the far left and far right ones.  Only the ones that
                 // start in the last row of the heading are drawn with the
                 // "category" style, the rest with the "dimension" style,
-                // e.g. only the # below are category style:
+                // e.g. only the `║` below are category style:
                 //
                 // ```text
-                // +-----------------------------------------------------+
-                // |                         bbbb                        |
-                // +-----------------+-----------------+-----------------+
-                // |      bbbb1      |      bbbb2      |      bbbb3      |
-                // +-----------------+-----------------+-----------------+
-                // |       aaaa      |       aaaa      |       aaaa      |
-                // +-----+-----+-----+-----+-----+-----+-----+-----+-----+
-                // |aaaa1#aaaa2#aaaa3|aaaa1#aaaa2#aaaa3|aaaa1#aaaa2#aaaa3|
-                // +-----+-----+-----+-----+-----+-----+-----+-----+-----+
-                //     ```
+                // ┌─────────────────────────────────────────────────────┐
+                // │                         bbbb                        │
+                // ├─────────────────┬─────────────────┬─────────────────┤
+                // │      bbbb1      │      bbbb2      │      bbbb3      │
+                // ├─────────────────┼─────────────────┼─────────────────┤
+                // │       aaaa      │       aaaa      │       aaaa      │
+                // ├─────╥─────╥─────┼─────╥─────╥─────┼─────╥─────╥─────┤
+                // │aaaa1║aaaa2║aaaa3│aaaa1║aaaa2║aaaa3│aaaa1║aaaa2║aaaa3│
+                // └─────╨─────╨─────┴─────╨─────╨─────┴─────╨─────╨─────┘
+                //```
                 let row_col = RowColBorder(region, v);
                 let border = if row == self.height - 1 && inner {
                     Border::Category(row_col)
@@ -469,22 +469,22 @@ impl<'a> Heading<'a> {
                     }
                 }
 
-                // Draws the horizontal lines within a dimension, that is,
-                // those that separate a category (or group) from its parent
-                // group or dimension's label.  Our running example doesn't
-                // have groups but the `====` lines below show the
-                // separators between categories and their dimension label:
+                // Draws the horizontal lines within a dimension, that is, those
+                // that separate a category (or group) from its parent group or
+                // dimension's label.  Our running example doesn't have groups
+                // but the `═════` lines below show the separators between
+                // categories and their dimension label:
                 //
                 // ```text
-                // +-----------------------------------------------------+
-                // |                         bbbb                        |
-                // +=================+=================+=================+
-                // |      bbbb1      |      bbbb2      |      bbbb3      |
-                // +-----------------+-----------------+-----------------+
-                // |       aaaa      |       aaaa      |       aaaa      |
-                // +=====+=====+=====+=====+=====+=====+=====+=====+=====+
-                // |aaaa1|aaaa2|aaaa3|aaaa1|aaaa2|aaaa3|aaaa1|aaaa2|aaaa3|
-                // +-----+-----+-----+-----+-----+-----+-----+-----+-----+
+                // ┌─────────────────────────────────────────────────────┐
+                // │                         bbbb                        │
+                // ╞═════════════════╤═════════════════╤═════════════════╡
+                // │      bbbb1      │      bbbb2      │      bbbb3      │
+                // ├─────────────────┼─────────────────┼─────────────────┤
+                // │       aaaa      │       aaaa      │       aaaa      │
+                // ╞═════╤═════╤═════╪═════╤═════╤═════╪═════╤═════╤═════╡
+                // │aaaa1│aaaa2│aaaa3│aaaa1│aaaa2│aaaa3│aaaa1│aaaa2│aaaa3│
+                // └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
                 // ```
                 if row + 1 < self.height {
                     table.draw_line(Border::Category(RowColBorder(region, h)), (h, y2), {
@@ -608,15 +608,15 @@ impl<'a> Headings<'a> {
                 // line here:
                 //
                 // ```text
-                // +-----------------------------------------------------+ __
-                // |                         bbbb                        |  |
-                // +-----------------+-----------------+-----------------+  |dim "bbbb"
-                // |      bbbb1      |      bbbb2      |      bbbb3      | _|
-                // +=================+=================+=================+ __
-                // |       aaaa      |       aaaa      |       aaaa      |  |
-                // +-----+-----+-----+-----+-----+-----+-----+-----+-----+  |dim "aaaa"
-                // |aaaa1|aaaa2|aaaa3|aaaa1|aaaa2|aaaa3|aaaa1|aaaa2|aaaa3| _|
-                // +-----+-----+-----+-----+-----+-----+-----+-----+-----+
+                // ┌─────────────────────────────────────────────────────┐ __
+                // │                         bbbb                        │  │
+                // ├─────────────────┬─────────────────┬─────────────────┤  │dim "bbbb"
+                // │      bbbb1      │      bbbb2      │      bbbb3      │ _│
+                // ╞═════════════════╪═════════════════╪═════════════════╡ __
+                // │       aaaa      │       aaaa      │       aaaa      │  │
+                // ├─────┬─────┬─────┼─────┬─────┬─────┼─────┬─────┬─────┤  │dim "aaaa"
+                // │aaaa1│aaaa2│aaaa3│aaaa1│aaaa2│aaaa3│aaaa1│aaaa2│aaaa3│ _│
+                // └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
                 // ```
                 table.draw_line(
                     Border::Dimension(RowColBorder(region, h)),