]> pintos-os.org Git - pspp/commitdiff
figure out patterns
authorBen Pfaff <blp@cs.stanford.edu>
Wed, 29 Apr 2026 18:51:10 +0000 (11:51 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Wed, 29 Apr 2026 18:51:10 +0000 (11:51 -0700)
rust/doc/src/spv/graphs.md
rust/pspp/src/spv/read/graph/patterns.svg [new file with mode: 0644]

index a987580e15663aca4adc1d3052b51c4aa009e924..40f193a4c95f2fa8da4b199dc1366953cfa84267 100644 (file)
@@ -840,3 +840,67 @@ and the value rounds to 0, then the number will display as `0`
 |  0.123 |    0 | none | none |    1 |     `.1` |
 |  0.123 |    0 | none | none |    0 |      `0` |
 |   0.01 |    0 | none | none |    0 |      `0` |
+
+# patterns
+
+0. solid
+1. mesh
+2. diagonal
+3. vertical
+4. grid
+5. mesh2
+6. mesh3
+7. pluses
+8. diagonal2
+9. horizontal
+10. grid2
+11. grid3
+12. checkered
+13. mesh4
+14. diagonal3
+15. vertical2
+16. grid4
+17. diagonal4
+18. diagonal5
+19. mesh5
+20. pluses2
+21. diagonal6
+22. horizontal2
+23. grid5
+24. diagonal7
+
+pattern1 written as 12
+pattern2 written as 2
+pattern3 written as 3
+pattern4 written as 4
+pattern5 written as 5
+pattern6 written as 1
+pattern7 written as 7
+pattern8 written as 8
+pattern9 written as 9
+pattern10 written as 10
+pattern11 written as 11
+pattern12 written as 6
+pattern13 written as 13
+pattern14 written as 14
+pattern15 written as 27
+pattern16 written as 16
+pattern17 written as 17
+pattern18 written as 18
+pattern19 written as 19
+pattern20 written as 20
+pattern21 written as 15
+pattern22 written as 22
+pattern23 written as 23
+pattern24 written as 24
+pattern25 written as 25
+pattern26 written as 26
+pattern27 written as 21
+pattern28 written as 28
+pattern29 written as 29
+
+checkered => 12
+stripes like \ => 2
+stripes like / => 8
+stripes like | => 3
+stripes like - => 9
diff --git a/rust/pspp/src/spv/read/graph/patterns.svg b/rust/pspp/src/spv/read/graph/patterns.svg
new file mode 100644 (file)
index 0000000..e8ceef0
--- /dev/null
@@ -0,0 +1,155 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+  <defs>
+    <!--
+        An SVG <pattern> for each of the numbered patterns supported by VizML.
+        The pattern numbered `<n>` has id="pattern<n>".
+
+        SVG provides no way to parameterize patterns, so all of these are
+        designed to be recolorable by changing their `fill` attribute.  PSPP
+        instantiates a copy of a given pattern with a different `fill` for each
+        colored pattern it needs.
+    -->
+    <pattern id="pattern0" gifindex="0" width="1" height="1" patternUnits="userSpaceOnUse"/>
+    <pattern id="pattern1" gifindex="6" width="10" height="4" patternUnits="userSpaceOnUse" fill="black">
+      <circle cx="4.5" cy="3.5" r="0.5" height="1" />
+      <rect x="9" y="1" width="1" height="1" />
+    </pattern>
+    <pattern id="pattern2" gifindex="2" width="4" height="4" patternTransform="rotate(-45 0 0)" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="1" y="0" width="1" height="4"/>
+    </pattern>
+    <pattern id="pattern3" gifindex="3" width="4" height="4" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="1" y="0" width="1" height="4"/>
+    </pattern>
+    <pattern id="pattern4" gifindex="4" width="4" height="4" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="1" y="0" width="1" height="4"/>
+      <rect x="0" y="1" width="4" height="1"/>
+    </pattern>
+    <pattern id="pattern5" gifindex="5" width="4" height="4" patternTransform="rotate(-45 0 0)" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="1" y="0" width="1" height="4"/>
+      <rect x="0" y="1" width="4" height="1"/>
+    </pattern>
+    <pattern id="pattern6" gifindex="12" width="4" height="4" patternUnits="userSpaceOnUse" fill="black">
+      <circle cx="3.5" cy="1.5" r="0.5" height="1" />
+      <circle cx="1.5" cy="3.5" r="0.5" height="1" />
+    </pattern>
+    <pattern id="pattern7" gifindex="7" width="20" height="20" patternTransform="scale(0.5)" patternUnits="userSpaceOnUse" fill="black">
+      <path d="M8,0 h2 v1 h-2 z"/>
+      <path d="M18,0 h2 v11 h-2 v-5 h-5 v-2 h5 z"/>
+      <path d="M0,4 h5 v2 h-5 "/>
+      <path d="M8,9 h2 v5 h5 v2 h-5 v4 h-2 v-4 h-5 v-2 h5 z"/>
+    </pattern>
+    <pattern id="pattern8" gifindex="8" width="4" height="4" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="1" y="0" width="1" height="4"/>
+    </pattern>
+    <pattern id="pattern9" gifindex="9" width="4" height="4" patternTransform="rotate(90 0 0)" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="1" y="0" width="1" height="4"/>
+    </pattern>
+    <pattern id="pattern10" gifindex="10" width="6" height="6" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="0" y="1" width="6" height="1"/>
+      <rect x="1" y="0" width="1" height="6"/>
+    </pattern>
+    <pattern id="pattern11" gifindex="11" width="6" height="6" patternTransform="rotate(-45 0 0)" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="0" y="1" width="6" height="1"/>
+      <rect x="1" y="0" width="1" height="6"/>
+    </pattern>
+    <pattern id="pattern12" gifindex="1" width="8" height="8" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="0" y="0" width="1" height="4"/>
+      <rect x="5" y="0" width="3" height="4"/>
+      <rect x="1" y="4" width="4" height="4"/>
+    </pattern>
+    <pattern id="pattern13" gifindex="13" width="2" height="2" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="1" y="0" width="1" height="1" />
+      <rect x="0" y="1" width="1" height="1" />
+    </pattern>
+    <pattern id="pattern14" gifindex="14" width="4" height="4" patternTransform="rotate(-45 0 0)" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="1" y="0" width="3" height="4"/>
+    </pattern>
+    <pattern id="pattern15" gifindex="21" width="4" height="4" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="1" y="0" width="3" height="4"/>
+    </pattern>
+    <pattern id="pattern16" gifindex="16" width="4" height="4" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="0" y="0" width="1" height="3" />
+      <rect x="2" y="0" width="2" height="3" />
+    </pattern>
+    <pattern id="pattern17" gifindex="17" width="4" height="4" patternTransform="rotate(-45 0 0)" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="1" y="0" width="1.5" height="4"/>
+    </pattern>
+    <pattern id="pattern18" gifindex="18" width="10" height="4" patternUnits="userSpaceOnUse" fill="black">
+      <path d="M0,0 h5 v1 h-1 v1 h1 v2 h-5 z"/>
+      <path d="M4,0 h6 v3 h-1 v1 h-5 v-2 h1 v-1 h-1 z"/>
+    </pattern>
+    <pattern id="pattern19" gifindex="19" width="20" height="20" patternTransform="scale(0.5)" patternUnits="userSpaceOnUse" fill="black">
+      <path d="M0,0 h8 v1 h2 v-1 h8 v4 h-5 v2 h5 v5 h2 v9 h-10 v-4 h5 v-2 h-5 v-5 h-2 v5 h-5 v2 h5 v4 h-8 v-14 h5 v-2 h-5 z"/>
+    </pattern>
+    <pattern id="pattern20" gifindex="20" width="4" height="4" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="1" y="0" width="3" height="4"/>
+    </pattern>
+    <pattern id="pattern21" gifindex="27" width="1" height="4" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="0" y="0" width="1" height="1"/>
+      <rect x="0" y="2" width="1" height="2"/>
+    </pattern>
+    <pattern id="pattern22" gifindex="22" width="5" height="5" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="1" y="1" width="4" height="4" />
+    </pattern>
+    <pattern id="pattern23" gifindex="23" width="4" height="4" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="1" y="0" width="1.5" height="4"/>
+    </pattern>
+    <pattern id="pattern24" gifindex="24" width="4" height="4" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="0" y="0" width="4" height="1" />
+      <rect x="0" y="1" width="1" height="1" />
+      <rect x="2" y="1" width="2" height="1" />
+      <rect x="0" y="2" width="4" height="1" />
+      <rect x="0" y="3" width="3" height="1" />
+    </pattern>
+    <pattern id="pattern25" gifindex="25" width="4" height="4" patternTransform="rotate(-45 0 0)" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="1" y="0" width="2" height="4"/>
+    </pattern>
+    <pattern id="pattern26" gifindex="26" width="4" height="4" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="1" y="0" width="2" height="4"/>
+    </pattern>
+    <pattern id="pattern27" gifindex="15" width="2" height="1" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="0" y="0" width="1" height="1" />
+    </pattern>
+    <pattern id="pattern28" gifindex="28" width="8" height="8" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="0" y="0" width="8" height="1"/>
+      <rect x="0" y="1" width="1" height="7"/>
+      <rect x="5" y="0" width="3" height="8"/>
+      <rect x="1" y="5" width="4" height="3"/>
+    </pattern>
+    <pattern id="pattern29" gifindex="29" width="5" height="5" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" fill="black">
+      <rect x="1" y="1" width="4" height="4" />
+    </pattern>
+  </defs>
+
+  <!-- A palette of pattern samples. -->
+  <rect x="0" y="0" width="20" height="20" fill="url(#pattern0)" />
+  <rect x="20" y="0" width="20" height="20" fill="url(#pattern1)" />
+  <rect x="40" y="0" width="20" height="20" fill="url(#pattern2)" />
+  <rect x="60" y="0" width="20" height="20" fill="url(#pattern3)" />
+  <rect x="80" y="0" width="20" height="20" fill="url(#pattern4)" />
+  <rect x="100" y="0" width="20" height="20" fill="url(#pattern5)" />
+  <rect x="0" y="20" width="20" height="20" fill="url(#pattern6)" />
+  <rect x="20" y="20" width="20" height="20" fill="url(#pattern7)" />
+  <rect x="40" y="20" width="20" height="20" fill="url(#pattern8)" />
+  <rect x="60" y="20" width="20" height="20" fill="url(#pattern9)" />
+  <rect x="80" y="20" width="20" height="20" fill="url(#pattern10)" />
+  <rect x="100" y="20" width="20" height="20" fill="url(#pattern11)" />
+  <rect x="0" y="40" width="20" height="20" fill="url(#pattern12)" />
+  <rect x="20" y="40" width="20" height="20" fill="url(#pattern13)" />
+  <rect x="40" y="40" width="20" height="20" fill="url(#pattern14)" />
+  <rect x="60" y="40" width="20" height="20" fill="url(#pattern15)" />
+  <rect x="80" y="40" width="20" height="20" fill="url(#pattern16)" />
+  <rect x="100" y="40" width="20" height="20" fill="url(#pattern17)" />
+  <rect x="0" y="60" width="20" height="20" fill="url(#pattern18)" />
+  <rect x="20" y="60" width="20" height="20" fill="url(#pattern19)" />
+  <rect x="40" y="60" width="20" height="20" fill="url(#pattern20)" />
+  <rect x="60" y="60" width="20" height="20" fill="url(#pattern21)" />
+  <rect x="80" y="60" width="20" height="20" fill="url(#pattern22)" />
+  <rect x="100" y="60" width="20" height="20" fill="url(#pattern23)" />
+  <rect x="0" y="80" width="20" height="20" fill="url(#pattern24)" />
+  <rect x="20" y="80" width="20" height="20" fill="url(#pattern25)" />
+  <rect x="40" y="80" width="20" height="20" fill="url(#pattern26)" />
+  <rect x="60" y="80" width="20" height="20" fill="url(#pattern27)" />
+  <rect x="80" y="80" width="20" height="20" fill="url(#pattern28)" />
+  <rect x="100" y="80" width="20" height="20" fill="url(#pattern29)" />
+</svg>