]> pintos-os.org Git - pspp/commitdiff
update graphs notes
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 18 Aug 2026 21:37:46 +0000 (14:37 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 18 Aug 2026 21:37:46 +0000 (14:37 -0700)
rust/doc/src/spv/graphs.md

index bfc0d75348e373410acc0ec0ef5e78497ed35cf3..3d653fee8af89175570bac68e48ac85fa95a81c3 100644 (file)
@@ -163,6 +163,36 @@ derivedVariable
 => variable_extension* (format | stringFormat)? valueMapEntry*
 ```
 
+`value` takes one of the following forms:
+
+* `constant(0)`  
+  `constant(VARIABLE)`  
+  All zeros.  The reason why a variable is sometimes named is
+  unknown.  Sometimes the "variable name" has spaces in it.
+
+* `map(VARIABLE)`  
+  Transforms the values in the named VARIABLE using the
+  `valueMapEntry`s contained within the element.
+
+* `VARIABLE<RELOP>?IFTRUE:IFFALSE`  
+  where:
+
+  - `RELOP` is one of `<>`, `!=`, `>=`, `<=`, `==`, `=`, `<`, or `>`
+
+  - `OPERAND`, `IFTRUE`, and `IFFALSE` are each a number, a variable
+    name, or a string quoted with `"` or `'`.
+
+  Examples:
+
+  - `x>=0?"0positive":"1negative"`
+  - `xVariable<100?"a":"b"`
+
+* `a+b+c+...`  
+  where each of the operands is either a variable name or a `"`-quoted
+  string.  The variables and quoted strings get concatenated in some
+  nonobvious way.
+
+
 ```
 expressionVariable
     :id
@@ -186,8 +216,6 @@ Forms of value:
 * `label(variableName)`
 * `"quoted string"`
 * `rowIndex()`
-* `x>=0?"0positive":"1negative"`
-* `xVariable<100?"a":"b"`
 
 ## `categoricalDomain`
 
@@ -755,7 +783,16 @@ The following variations on `faceting` have been observed in the corpus:
 The possible `method`s are `cross`, `dot`, and `nest`.  `dot` means
 the same as `blend`.  All the methods appear in the corpus.  The
 methods are about combining the "main expression" with the faceting
-(but I'm not sure what that means).
+(but I'm not sure what that means).  Observed behavior:
+
+* `cross`: The facets are all forced to have the same domain and axes.
+  This is the common case for faceted data.
+
+* `nest`: The facets can have different domains and axes according to
+  whatever data is in them.  For example, this is used when the facets
+  contain different pie charts, where stacking of percentages in
+  different facets produces, say, a total of 55% in one facet and 45%
+  in another, but both pie charts should be out of 100%.
 
 In the corpus, `faceting` only has a single child.  The schema says
 that it can have statistics children, but these never appear in the