prographs 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/README.md +6 -4
  3. package/dist/AutoGraph-PDPEAIXL.cjs +145 -0
  4. package/dist/GraphType.js +19 -0
  5. package/dist/autograph/chartIndex.js +521 -0
  6. package/dist/autograph/chartModules.js +2 -1
  7. package/dist/autograph/index.cjs +98 -93
  8. package/dist/catalog-DI4XZ46L.cjs +142 -0
  9. package/dist/catalog.js +2 -1
  10. package/dist/charts/biologycharts/BiologySamples.js +59 -0
  11. package/dist/charts/biologycharts/PunnettSquare.js +342 -0
  12. package/dist/charts/biologycharts/biologyEnums.js +22 -1
  13. package/dist/charts/biologycharts/index.js +5 -3
  14. package/dist/charts/doecharts/DoeSamples.js +78 -0
  15. package/dist/charts/doecharts/SipocDiagram.js +453 -0
  16. package/dist/charts/doecharts/index.js +4 -2
  17. package/dist/charts/fieldcharts/SpeciesAccumulationCurve.js +350 -0
  18. package/dist/charts/fieldcharts/fieldEnums.js +8 -1
  19. package/dist/charts/fieldcharts/index.js +5 -3
  20. package/dist/charts/signals/AntennaPatternChart.js +492 -0
  21. package/dist/charts/signals/SignalSamples.js +17 -0
  22. package/dist/charts/signals/index.js +5 -3
  23. package/dist/charts/softwarediagrams/ComponentDiagram.js +504 -0
  24. package/dist/charts/softwarediagrams/DeploymentDiagram.js +419 -0
  25. package/dist/charts/softwarediagrams/SoftwareSamples.js +283 -1
  26. package/dist/charts/softwarediagrams/index.js +7 -3
  27. package/dist/charts/softwarediagrams/softwareEnums.js +45 -1
  28. package/dist/charts/sportscharts/PowerDurationCurve.js +301 -0
  29. package/dist/charts/sportscharts/SportsSamples.js +102 -0
  30. package/dist/charts/sportscharts/TrainingLoadChart.js +325 -0
  31. package/dist/charts/sportscharts/index.js +6 -2
  32. package/dist/charts/strategycharts/BassDiffusionChart.js +362 -0
  33. package/dist/charts/strategycharts/BassModel.js +96 -0
  34. package/dist/charts/strategycharts/BurnRunwayChart.js +284 -0
  35. package/dist/charts/strategycharts/CapTableChart.js +366 -0
  36. package/dist/charts/strategycharts/KanbanBoard.js +324 -0
  37. package/dist/charts/strategycharts/OkrTree.js +339 -0
  38. package/dist/charts/strategycharts/StrategyPane.js +27 -0
  39. package/dist/charts/strategycharts/StrategySamples.js +251 -0
  40. package/dist/charts/strategycharts/index.js +15 -3
  41. package/dist/charts/threefields/BsfcMap3DChart.js +231 -0
  42. package/dist/charts/threefields/CompressorMap3DChart.js +217 -0
  43. package/dist/charts/threefields/FieldGrid.js +50 -0
  44. package/dist/charts/threefields/LossLandscape3DChart.js +201 -0
  45. package/dist/charts/threefields/MapSheet.js +77 -0
  46. package/dist/charts/threefields/TerrainRoute3DChart.js +201 -0
  47. package/dist/charts/threefields/TerrainRouteMath.js +40 -0
  48. package/dist/charts/threefields/ThreeFieldBase.js +117 -0
  49. package/dist/charts/threefields/ThreeFieldsSamples.js +80 -0
  50. package/dist/charts/threefields/WaferMap3DChart.js +218 -0
  51. package/dist/charts/threefields/index.js +19 -0
  52. package/dist/charts/threesurfaces/index.js +2 -2
  53. package/dist/charts/tradingcharts/KeltnerChannelChart.js +171 -0
  54. package/dist/charts/tradingcharts/TradingMath.js +20 -0
  55. package/dist/charts/tradingcharts/index.js +4 -2
  56. package/dist/{chunk-ZL6XDXMK.cjs → chunk-26PSLEP4.cjs} +8 -8
  57. package/dist/{chunk-W3US6EFP.cjs → chunk-2BO5DZUP.cjs} +12 -12
  58. package/dist/{chunk-5DP7OUSE.cjs → chunk-2GG5YYSC.cjs} +6 -6
  59. package/dist/{chunk-7FG4JSVO.cjs → chunk-2GL2VNJU.cjs} +253 -33
  60. package/dist/{chunk-LCWMRCLF.cjs → chunk-2PYOI7OY.cjs} +21 -21
  61. package/dist/{chunk-JFWJAEBD.cjs → chunk-3U4MCSKI.cjs} +4 -4
  62. package/dist/{chunk-CUPLHZRR.cjs → chunk-3ZMM3FSK.cjs} +4 -4
  63. package/dist/{chunk-L2AV62DP.cjs → chunk-4767WQJ7.cjs} +6 -6
  64. package/dist/{chunk-DA2EYIIP.cjs → chunk-4E7FSSBF.cjs} +1210 -168
  65. package/dist/{chunk-VS5LQEZB.cjs → chunk-526STI2S.cjs} +5 -5
  66. package/dist/{chunk-RXIMEK6C.cjs → chunk-55767YPI.cjs} +20 -20
  67. package/dist/{chunk-JXLSKIUV.cjs → chunk-5FBQOMMT.cjs} +26 -26
  68. package/dist/{chunk-27PZV5BR.cjs → chunk-5N4Z7MTS.cjs} +4 -4
  69. package/dist/{chunk-KEWCUIQA.cjs → chunk-5WEV6YWA.cjs} +22 -22
  70. package/dist/chunk-5XOVVC5X.cjs +3281 -0
  71. package/dist/{chunk-HK5J7Q2W.cjs → chunk-6HLXVWXU.cjs} +9 -9
  72. package/dist/{chunk-7JG47RW4.cjs → chunk-6LQT4WJ5.cjs} +25 -25
  73. package/dist/{chunk-OCVTI6X4.cjs → chunk-6YTWOUFD.cjs} +329 -36
  74. package/dist/{chunk-W7IQCAVN.cjs → chunk-7F6W6HKL.cjs} +11 -11
  75. package/dist/{chunk-F2DCJXDM.cjs → chunk-7L6KYU5A.cjs} +21 -21
  76. package/dist/{chunk-GTGR6LPR.cjs → chunk-A4GIN4FE.cjs} +17 -17
  77. package/dist/{chunk-B2CETSR6.cjs → chunk-A4US7SA7.cjs} +5 -5
  78. package/dist/{chunk-3DIF2YYW.cjs → chunk-AOXPBLPW.cjs} +10 -10
  79. package/dist/{chunk-7TTR4UF5.cjs → chunk-ATI45Z4M.cjs} +2 -2
  80. package/dist/{chunk-5BFCIX2V.cjs → chunk-CPPMO4IQ.cjs} +434 -148
  81. package/dist/{chunk-AYZZQ6AC.cjs → chunk-CZ5KGF6Q.cjs} +9 -9
  82. package/dist/{chunk-7THJ3ZBK.cjs → chunk-D4I35MCE.cjs} +2 -2
  83. package/dist/{chunk-MCPPFRLN.cjs → chunk-DCGAAN3Z.cjs} +2 -2
  84. package/dist/{chunk-VABL6CVX.cjs → chunk-DEY36N37.cjs} +21 -21
  85. package/dist/{chunk-RNCKGJCC.cjs → chunk-DXHXD3DK.cjs} +3 -3
  86. package/dist/{chunk-A56ZGMVZ.cjs → chunk-E7B45DBZ.cjs} +11 -11
  87. package/dist/{chunk-DOR6L4MT.cjs → chunk-EJC6EAC5.cjs} +18 -18
  88. package/dist/{chunk-UPGNM7MA.cjs → chunk-EULJOOMA.cjs} +11 -11
  89. package/dist/{chunk-G4AZL4GO.cjs → chunk-EYM6LEIF.cjs} +474 -70
  90. package/dist/{chunk-NJ4X6XGV.cjs → chunk-EZTYX2GH.cjs} +5 -5
  91. package/dist/chunk-FDD4UP73.cjs +521 -0
  92. package/dist/{chunk-WJ3VH2Q4.cjs → chunk-GEAIGM3J.cjs} +110 -615
  93. package/dist/{chunk-P3SBHF43.cjs → chunk-GRUYVXTS.cjs} +2 -2
  94. package/dist/{chunk-NX4Z5LMS.cjs → chunk-H3SZXND5.cjs} +5 -5
  95. package/dist/{chunk-EE4S4TOE.cjs → chunk-HS45TOFJ.cjs} +21 -21
  96. package/dist/chunk-INGOG6OV.cjs +899 -0
  97. package/dist/{chunk-UDKA6DGT.cjs → chunk-J3CDXZHF.cjs} +4 -4
  98. package/dist/{chunk-YO6G7TKI.cjs → chunk-JAU5ADEU.cjs} +11 -11
  99. package/dist/{chunk-22LBK4GA.cjs → chunk-JQEBSHX3.cjs} +4 -4
  100. package/dist/{chunk-RXX3U7VQ.cjs → chunk-KLXGLMFU.cjs} +10 -10
  101. package/dist/chunk-KVOX36J3.cjs +327 -0
  102. package/dist/chunk-L6BGNHFL.cjs +139 -0
  103. package/dist/{chunk-GMER35L3.cjs → chunk-L7TB7PU5.cjs} +20 -20
  104. package/dist/{chunk-AFXYNBL2.cjs → chunk-LBTRYEM2.cjs} +4 -4
  105. package/dist/{chunk-WYYCKIOD.cjs → chunk-LLULNJSP.cjs} +11 -11
  106. package/dist/{chunk-J27XOSLP.cjs → chunk-LSO46AFV.cjs} +8 -8
  107. package/dist/{chunk-5XJO45ES.cjs → chunk-LZ2KJ7ZX.cjs} +11 -11
  108. package/dist/chunk-M4IQ5LIZ.cjs +422 -0
  109. package/dist/{chunk-Y2KIUKJF.cjs → chunk-MPDHDKYZ.cjs} +11 -11
  110. package/dist/{chunk-4EMPKRZU.cjs → chunk-MRQ42ZJE.cjs} +3 -3
  111. package/dist/{chunk-EU5D2MF4.cjs → chunk-MYV4KZWP.cjs} +9 -9
  112. package/dist/{chunk-XD7KN4UN.cjs → chunk-MZXVLC24.cjs} +6 -6
  113. package/dist/{chunk-PPSONARU.cjs → chunk-NLBVDFIR.cjs} +41 -2
  114. package/dist/{chunk-L3PEGMGM.cjs → chunk-NY3TBZY4.cjs} +33 -33
  115. package/dist/{chunk-6YNYXXB6.cjs → chunk-OGVVSFAR.cjs} +3 -3
  116. package/dist/{chunk-MLV7QLB6.cjs → chunk-OMTQIQMN.cjs} +6 -6
  117. package/dist/{chunk-BEEOSNK7.cjs → chunk-PEJJ6TXJ.cjs} +15 -144
  118. package/dist/{chunk-SOKOWUF5.cjs → chunk-PPGWHIU7.cjs} +2 -2
  119. package/dist/{chunk-IELWOM2J.cjs → chunk-PPO6SDAN.cjs} +6 -6
  120. package/dist/{chunk-6JTZZCSL.cjs → chunk-PUMKX5F2.cjs} +3 -3
  121. package/dist/{chunk-RFOXFY2U.cjs → chunk-PXBYWCNB.cjs} +190 -799
  122. package/dist/{chunk-3BYXOISI.cjs → chunk-Q3HB3IX6.cjs} +4 -4
  123. package/dist/{chunk-RXCOVONX.cjs → chunk-RBMUOIXE.cjs} +289 -34
  124. package/dist/{chunk-MSBNHCSE.cjs → chunk-RJHGCUUD.cjs} +6 -6
  125. package/dist/{chunk-I6VG7F6Z.cjs → chunk-RSONDMYW.cjs} +708 -141
  126. package/dist/{chunk-GZDNPHMT.cjs → chunk-SHMPFCUE.cjs} +19 -19
  127. package/dist/{chunk-ZIBVCOW6.cjs → chunk-SN4FCXFC.cjs} +19 -19
  128. package/dist/{chunk-7KM52NMN.cjs → chunk-SN5T7WYO.cjs} +2 -2
  129. package/dist/{chunk-7MSZR65Z.cjs → chunk-SQJZGVDR.cjs} +7 -7
  130. package/dist/chunk-SYABFMD7.cjs +633 -0
  131. package/dist/{chunk-2RRFEYFH.cjs → chunk-TICB3MAC.cjs} +16 -16
  132. package/dist/{chunk-AOOKHUV5.cjs → chunk-U7Z7XYR2.cjs} +5 -5
  133. package/dist/{chunk-JEWQAXVG.cjs → chunk-UA2THQFV.cjs} +6 -6
  134. package/dist/{chunk-LHZPAHU3.cjs → chunk-VIK4L2YF.cjs} +112 -521
  135. package/dist/{chunk-4YWMAQ4J.cjs → chunk-VM2Y6BDY.cjs} +4 -4
  136. package/dist/{chunk-IRRKE2ZE.cjs → chunk-VMS3KWYI.cjs} +21 -21
  137. package/dist/{chunk-4SLARW6F.cjs → chunk-VU5NUD46.cjs} +17 -17
  138. package/dist/{chunk-XHY6TVYG.cjs → chunk-VV5CVOF7.cjs} +13 -13
  139. package/dist/{chunk-CCIBPGPZ.cjs → chunk-VYSAWPSS.cjs} +57 -57
  140. package/dist/{chunk-TTNEMQ2A.cjs → chunk-W7YRWEWQ.cjs} +22 -22
  141. package/dist/{chunk-C7MUOGEW.cjs → chunk-X7R5SY62.cjs} +6 -6
  142. package/dist/{chunk-ILR5KBMB.cjs → chunk-XOK3KTSS.cjs} +6 -6
  143. package/dist/{chunk-2CZM2I3T.cjs → chunk-XUIX45VU.cjs} +19 -19
  144. package/dist/{chunk-TGRMPS3A.cjs → chunk-XWH46PVJ.cjs} +165 -43
  145. package/dist/{chunk-WQYXXECR.cjs → chunk-Y5XVMK3K.cjs} +6 -6
  146. package/dist/{chunk-AK4TX2WG.cjs → chunk-YCNKEDTG.cjs} +13 -13
  147. package/dist/{chunk-PJJB24DU.cjs → chunk-YEF7SE3X.cjs} +20 -20
  148. package/dist/{chunk-RVLV4XW6.cjs → chunk-YMTVPMU3.cjs} +22 -22
  149. package/dist/data/index.cjs +2 -2
  150. package/dist/entries/autograph-lazy.cjs +2 -2
  151. package/dist/entries/charts/acoustictransport.cjs +3 -3
  152. package/dist/entries/charts/analysischarts.cjs +3 -3
  153. package/dist/entries/charts/astrocharts.cjs +3 -3
  154. package/dist/entries/charts/bars.cjs +3 -3
  155. package/dist/entries/charts/bayesiancharts.cjs +3 -3
  156. package/dist/entries/charts/biocharts.cjs +3 -3
  157. package/dist/entries/charts/biologycharts.cjs +11 -3
  158. package/dist/entries/charts/biologycharts.d.ts +1 -1
  159. package/dist/entries/charts/biologycharts.js +3 -2
  160. package/dist/entries/charts/business.cjs +3 -3
  161. package/dist/entries/charts/carecharts.cjs +3 -3
  162. package/dist/entries/charts/chemistrycharts.cjs +3 -3
  163. package/dist/entries/charts/civicscharts.cjs +3 -3
  164. package/dist/entries/charts/clinicalcharts.cjs +3 -3
  165. package/dist/entries/charts/comparison.cjs +3 -3
  166. package/dist/entries/charts/demography.cjs +3 -3
  167. package/dist/entries/charts/density.cjs +3 -3
  168. package/dist/entries/charts/diagrams.cjs +3 -3
  169. package/dist/entries/charts/distribution.cjs +3 -3
  170. package/dist/entries/charts/doecharts.cjs +13 -3
  171. package/dist/entries/charts/doecharts.d.ts +1 -1
  172. package/dist/entries/charts/doecharts.js +2 -1
  173. package/dist/entries/charts/earthscience.cjs +3 -3
  174. package/dist/entries/charts/economicscharts.cjs +3 -3
  175. package/dist/entries/charts/energycharts.cjs +3 -3
  176. package/dist/entries/charts/engineering.cjs +3 -3
  177. package/dist/entries/charts/fieldcharts.cjs +7 -3
  178. package/dist/entries/charts/fieldcharts.d.ts +1 -1
  179. package/dist/entries/charts/fieldcharts.js +3 -2
  180. package/dist/entries/charts/financial.cjs +3 -3
  181. package/dist/entries/charts/flow.cjs +3 -3
  182. package/dist/entries/charts/frameworks.cjs +3 -3
  183. package/dist/entries/charts/genomics.cjs +3 -3
  184. package/dist/entries/charts/geoflows.cjs +3 -3
  185. package/dist/entries/charts/geomaps.cjs +3 -3
  186. package/dist/entries/charts/geosciencecharts.cjs +3 -3
  187. package/dist/entries/charts/hierarchy.cjs +3 -3
  188. package/dist/entries/charts/indicators.cjs +3 -3
  189. package/dist/entries/charts/inferencecharts.cjs +3 -3
  190. package/dist/entries/charts/layoutcharts.cjs +3 -3
  191. package/dist/entries/charts/lifescience.cjs +4 -4
  192. package/dist/entries/charts/linesareas.cjs +3 -3
  193. package/dist/entries/charts/logisticscharts.cjs +3 -3
  194. package/dist/entries/charts/machinecharts.cjs +7 -3
  195. package/dist/entries/charts/machinecharts.d.ts +1 -1
  196. package/dist/entries/charts/machinecharts.js +2 -1
  197. package/dist/entries/charts/massive.cjs +3 -3
  198. package/dist/entries/charts/mathematical.cjs +3 -3
  199. package/dist/entries/charts/matrix.cjs +3 -3
  200. package/dist/entries/charts/medicalcharts.cjs +4 -4
  201. package/dist/entries/charts/mlcharts.cjs +4 -4
  202. package/dist/entries/charts/modelcharts.cjs +6 -5
  203. package/dist/entries/charts/multivariate.cjs +3 -3
  204. package/dist/entries/charts/musiccharts.cjs +3 -3
  205. package/dist/entries/charts/network.cjs +3 -3
  206. package/dist/entries/charts/physicscharts.cjs +3 -3
  207. package/dist/entries/charts/pictorial.cjs +4 -4
  208. package/dist/entries/charts/portfoliocharts.cjs +3 -3
  209. package/dist/entries/charts/productcharts.cjs +3 -3
  210. package/dist/entries/charts/proportion.cjs +3 -3
  211. package/dist/entries/charts/qualitycharts.cjs +3 -3
  212. package/dist/entries/charts/radial.cjs +3 -3
  213. package/dist/entries/charts/reliabilitycharts.cjs +5 -3
  214. package/dist/entries/charts/scatter.cjs +3 -3
  215. package/dist/entries/charts/scientific.cjs +3 -3
  216. package/dist/entries/charts/seriescharts.cjs +3 -3
  217. package/dist/entries/charts/signals.cjs +7 -3
  218. package/dist/entries/charts/signals.d.ts +1 -1
  219. package/dist/entries/charts/signals.js +2 -1
  220. package/dist/entries/charts/softwarediagrams.cjs +21 -3
  221. package/dist/entries/charts/softwarediagrams.d.ts +1 -1
  222. package/dist/entries/charts/softwarediagrams.js +4 -2
  223. package/dist/entries/charts/sportscharts.cjs +13 -3
  224. package/dist/entries/charts/sportscharts.d.ts +1 -1
  225. package/dist/entries/charts/sportscharts.js +3 -1
  226. package/dist/entries/charts/statistics.cjs +6 -6
  227. package/dist/entries/charts/strategycharts.cjs +30 -3
  228. package/dist/entries/charts/strategycharts.d.ts +1 -1
  229. package/dist/entries/charts/strategycharts.js +6 -1
  230. package/dist/entries/charts/structure.cjs +3 -3
  231. package/dist/entries/charts/surveycharts.cjs +3 -3
  232. package/dist/entries/charts/systemscharts.cjs +3 -3
  233. package/dist/entries/charts/textcharts.cjs +5 -5
  234. package/dist/entries/charts/thematicmaps.cjs +4 -4
  235. package/dist/entries/charts/threebars.cjs +3 -3
  236. package/dist/entries/charts/threefields.cjs +53 -0
  237. package/dist/entries/charts/threefields.d.ts +1 -0
  238. package/dist/entries/charts/threefields.js +6 -0
  239. package/dist/entries/charts/threeglobe.cjs +3 -3
  240. package/dist/entries/charts/threenetwork.cjs +3 -3
  241. package/dist/entries/charts/threestrata.cjs +3 -3
  242. package/dist/entries/charts/threesurfaces.cjs +7 -3
  243. package/dist/entries/charts/threesurfaces.d.ts +1 -1
  244. package/dist/entries/charts/threesurfaces.js +2 -1
  245. package/dist/entries/charts/threevolume.cjs +4 -4
  246. package/dist/entries/charts/timeline.cjs +3 -3
  247. package/dist/entries/charts/tracecharts.cjs +3 -3
  248. package/dist/entries/charts/trackscharts.cjs +3 -3
  249. package/dist/entries/charts/tradingcharts.cjs +6 -4
  250. package/dist/entries/charts/tradingcharts.d.ts +1 -1
  251. package/dist/entries/charts/tradingcharts.js +2 -1
  252. package/dist/entries/three.cjs +60 -20
  253. package/dist/entries/three.d.ts +1 -1
  254. package/dist/entries/three.js +7 -1
  255. package/dist/index.cjs +258 -97
  256. package/dist/index.d.cts +1953 -10
  257. package/dist/index.d.ts +1953 -10
  258. package/dist/index.js +26 -5
  259. package/dist/page/index.cjs +2 -2
  260. package/dist/react/components.js +58 -1
  261. package/dist/react/index.cjs +135 -92
  262. package/dist/react/index.d.ts +1 -1
  263. package/dist/react/index.js +2 -2
  264. package/package.json +1 -1
  265. package/dist/AutoGraph-XLBJQDRB.cjs +0 -140
  266. package/dist/catalog-O7XGDD2H.cjs +0 -137
  267. package/dist/chunk-77K2HTRC.cjs +0 -3220
  268. package/dist/chunk-XEK47TVD.cjs +0 -323
  269. /package/dist/{chunk-UMEKIIHJ.cjs → chunk-LNWTC72Y.cjs} +0 -0
@@ -0,0 +1,342 @@
1
+ import { Chart2D } from "../../core/Chart2D.js";
2
+ import { ChartFamily, DataShape, Dimension, LegendPosition } from "../../core/enums.js";
3
+ import { TextFit } from "../../core/TextFit.js";
4
+ import { PunnettCross, PunnettDominance, PunnettRatios } from "./biologyEnums.js";
5
+ import { BiologyRows } from "./BiologyRows.js";
6
+ import { BiologySamples } from "./BiologySamples.js";
7
+ // src/charts/biologycharts/PunnettSquare.ts
8
+ var GENES = {
9
+ [PunnettCross.Monohybrid]: 1,
10
+ [PunnettCross.Dihybrid]: 2,
11
+ [PunnettCross.Trihybrid]: 3
12
+ };
13
+ var CHAR = 6.2;
14
+ var CAPTION = 15;
15
+ var HEAD = 20;
16
+ var GAP = 16;
17
+ var LINE = 14;
18
+ var BAR = 20;
19
+ var gcd = (a, b) => b ? gcd(b, a % b) : a;
20
+ /**
21
+ * Works a genetic cross: the gametes of one parent down the side, of the other along the top, and the offspring of each pairing in the cells.
22
+ * Use it to show where a 3 to 1 or a 9 to 3 to 3 to 1 ratio comes from, with each gene completely dominant, incompletely dominant or codominant.
23
+ */
24
+ var PunnettSquare = class PunnettSquare extends Chart2D {
25
+ static meta = {
26
+ id: "punnett-square",
27
+ name: "Punnett square",
28
+ family: ChartFamily.Matrix,
29
+ dimension: Dimension.Two,
30
+ shape: DataShape.Table,
31
+ description: "Crosses two parents from their genotypes: gametes along the top and side, offspring genotypes in the cells coloured by phenotype, and the genotype and phenotype ratios, for one gene or several with dominance set per gene.",
32
+ tags: [
33
+ "genetics",
34
+ "mendel",
35
+ "monohybrid",
36
+ "dihybrid",
37
+ "genotype",
38
+ "phenotype",
39
+ "inheritance",
40
+ "biology"
41
+ ],
42
+ sample: (seed) => BiologySamples.cross(seed),
43
+ variants: {
44
+ cross: [PunnettCross.Dihybrid, PunnettCross.Monohybrid],
45
+ ratios: Object.values(PunnettRatios)
46
+ }
47
+ };
48
+ /** True when the ratio list is drawn, which names every phenotype beside its colour. */
49
+ #keyed = false;
50
+ defaults() {
51
+ return {
52
+ gene: "gene",
53
+ parent1: "parent1",
54
+ parent2: "parent2",
55
+ dominance: "dominance",
56
+ dominantTrait: "dominantTrait",
57
+ recessiveTrait: "recessiveTrait",
58
+ mixedTrait: "mixedTrait",
59
+ parents: ["Parent 1", "Parent 2"],
60
+ cross: PunnettCross.Dihybrid,
61
+ ratios: PunnettRatios.List
62
+ };
63
+ }
64
+ plotMargin() {
65
+ return {
66
+ top: 8,
67
+ right: 12,
68
+ bottom: 8,
69
+ left: 12
70
+ };
71
+ }
72
+ get legendPosition() {
73
+ return this.#keyed ? LegendPosition.None : super.legendPosition;
74
+ }
75
+ /** The two alleles of a genotype: `Rr` gives R and r, and `IA/i` or `IA i` gives alleles of more than one letter. Anything else gives none. */
76
+ static alleles(genotype) {
77
+ const parts = /[\s/|,]/.test(genotype) ? genotype.split(/[\s/|,]+/).filter(Boolean) : [...genotype];
78
+ return parts.length === 2 ? parts : [];
79
+ }
80
+ /** Counts as the lowest whole-number ratio: 12, 4 gives `3 : 1`. */
81
+ static ratio(counts) {
82
+ const shared = counts.reduce(gcd, 0) || 1;
83
+ return counts.map((count) => count / shared).join(" : ");
84
+ }
85
+ #genes() {
86
+ const { data, gene, parent1, parent2, dominance, dominantTrait, recessiveTrait, mixedTrait, cross } = this.options, seen = /* @__PURE__ */ new Set();
87
+ const upper = (allele) => allele === allele.toUpperCase() && allele !== allele.toLowerCase();
88
+ return (Array.isArray(data) ? data : []).flatMap((row, i) => {
89
+ if (row === null || typeof row !== "object") return [];
90
+ const name = BiologyRows.text(row[gene], `Gene ${i + 1}`);
91
+ const parents = [PunnettSquare.alleles(BiologyRows.text(row[parent1])), PunnettSquare.alleles(BiologyRows.text(row[parent2]))];
92
+ if (seen.has(name) || !parents[0].length || !parents[1].length) return [];
93
+ seen.add(name);
94
+ const written = [...new Set(parents.flat())], lead = written.find(upper) ?? written[0], rest = written.filter((allele) => allele !== lead);
95
+ const said = BiologyRows.text(row[dominance]).toLowerCase();
96
+ const kind = said.startsWith("inc") ? PunnettDominance.Incomplete : said.startsWith("cod") ? PunnettDominance.Codominant : PunnettDominance.Complete;
97
+ const weak = rest[0] ?? lead, complete = kind === PunnettDominance.Complete;
98
+ return [{
99
+ dominance: kind,
100
+ alleles: [lead, ...rest],
101
+ parents,
102
+ traits: [
103
+ BiologyRows.text(row[dominantTrait], complete ? `${lead}_` : `${lead}${lead}`),
104
+ BiologyRows.text(row[recessiveTrait], `${weak}${weak}`),
105
+ BiologyRows.text(row[mixedTrait], `${lead}${weak}`)
106
+ ]
107
+ }];
108
+ }).slice(0, GENES[cross] ?? 2);
109
+ }
110
+ /** What an offspring carrying `pair` shows at a gene. Only complete dominance hides the second allele of a heterozygote. */
111
+ static #trait({ alleles, dominance, traits }, pair) {
112
+ const carried = pair.filter((allele) => allele === alleles[0]).length;
113
+ if (carried === 2 || carried === 1 && dominance === PunnettDominance.Complete) return traits[0];
114
+ return carried ? traits[2] : traits[1];
115
+ }
116
+ /** The cross worked out: every gamete of each parent, the offspring of each pairing, and the tallies behind the ratios. */
117
+ get square() {
118
+ const genes = this.#genes(), single = genes.every((gene) => gene.alleles.every((allele) => allele.length === 1));
119
+ const gametes = (parent) => genes.length ? genes.reduce((all, gene) => all.flatMap((gamete) => gene.parents[parent].map((allele) => [...gamete, allele])), [[]]) : [];
120
+ const pair = (gene, a, b) => [a, b].sort((p, q) => gene.alleles.indexOf(p) - gene.alleles.indexOf(q));
121
+ const written = (pairs) => pairs.map((alleles) => alleles.join(single ? "" : "/")).join(single ? "" : " ");
122
+ const down = gametes(0), across = gametes(1);
123
+ const cells = down.flatMap((a, row) => across.map((b, column) => {
124
+ const pairs = genes.map((gene, g) => pair(gene, a[g], b[g]));
125
+ return {
126
+ row,
127
+ column,
128
+ genotype: written(pairs),
129
+ phenotype: genes.map((gene, g) => PunnettSquare.#trait(gene, pairs[g])).join(", ")
130
+ };
131
+ }));
132
+ const tally = (name) => {
133
+ const classes = /* @__PURE__ */ new Map();
134
+ for (const cell of cells) (classes.get(name(cell)) ?? classes.set(name(cell), {
135
+ name: name(cell),
136
+ count: 0,
137
+ phenotype: cell.phenotype
138
+ }).get(name(cell))).count++;
139
+ return [...classes.values()];
140
+ };
141
+ const phenotypes = tally((cell) => cell.phenotype), rank = new Map(phenotypes.map((entry, i) => [entry.name, i]));
142
+ const text = (gamete) => gamete.join(single ? "" : " ");
143
+ return {
144
+ side: down.map(text),
145
+ top: across.map(text),
146
+ cells,
147
+ phenotypes,
148
+ parents: [written(genes.map((gene) => pair(gene, gene.parents[0][0], gene.parents[0][1]))), written(genes.map((gene) => pair(gene, gene.parents[1][0], gene.parents[1][1])))],
149
+ genotypes: tally((cell) => cell.genotype).sort((a, b) => rank.get(a.phenotype) - rank.get(b.phenotype))
150
+ };
151
+ }
152
+ draw(ctx) {
153
+ const { ratios, parents: names } = this.options, { width, height } = ctx.plot, { palette, theme } = ctx;
154
+ const { side, top, parents, cells, genotypes, phenotypes } = this.square, n = side.length, total = cells.length;
155
+ for (const entry of phenotypes) palette.color(entry.name);
156
+ const count = new Map(genotypes.map((entry) => [entry.name, entry.count]));
157
+ const letters = Math.max(1, ...side.map((gamete) => gamete.length), ...top.map((gamete) => gamete.length));
158
+ const head = Math.max(18, Math.min(13, 60 / letters) * .62 * letters + 10), sideBand = CAPTION + head, topBand = 35;
159
+ const panel = ratios !== PunnettRatios.None && n ? Math.max(118, Math.min(230, width * .38)) : 0;
160
+ const beside = panel > 0 && width - sideBand - panel - GAP >= 80 ? panel + GAP : 0;
161
+ const size = Math.max(10, Math.min(height - topBand, width - sideBand - beside)), cell = size / (n || 1), pad = cell >= 12 ? 2 : 1;
162
+ const gx = sideBand + (width - sideBand - size - beside) / 2, gy = topBand + (height - topBand - size) / 2;
163
+ this.#keyed = beside > 0 && ratios === PunnettRatios.List;
164
+ const key = (d) => `${d.row}/${d.column}`, cx = (d) => gx + (d.column + .5) * cell, cy = (d) => gy + (d.row + .5) * cell;
165
+ const rects = ctx.marks("cells", "rect", cells, key).attr("fill", (d) => palette.color(d.phenotype)).attr("rx", Math.min(4, cell / 8));
166
+ ctx.set(rects, {
167
+ x: (d) => cx(d) - (cell - pad) / 2,
168
+ y: (d) => cy(d) - (cell - pad) / 2,
169
+ width: Math.max(.5, cell - pad),
170
+ height: Math.max(.5, cell - pad),
171
+ opacity: 1
172
+ }, { opacity: 0 }, 240 / (total || 1));
173
+ ctx.hover(rects, (d) => ({
174
+ title: d.genotype,
175
+ color: palette.color(d.phenotype),
176
+ rows: [
177
+ ["Phenotype", d.phenotype],
178
+ ["Gametes", `${side[d.row]} and ${top[d.column]}`],
179
+ ["Share of offspring", `${count.get(d.genotype)} in ${total}`]
180
+ ]
181
+ }));
182
+ const longest = Math.max(1, ...cells.map((d) => d.genotype.length)), font = Math.min(14, (cell - 6) / (longest * .62));
183
+ const lettered = font >= 6.5 ? cells : [], captioned = cell >= 46 && phenotypes.every((entry) => TextFit.width(entry.name, 5.6) <= cell - 8);
184
+ const onCell = (name, data, size, shift, words) => {
185
+ const marks = ctx.text(ctx.marks(name, "text", data, key), size, "ink").attr("text-anchor", "middle").attr("dy", "0.35em").attr("fill", (d) => palette.inkOn(palette.color(d.phenotype))).style("pointer-events", "none").text(words);
186
+ ctx.set(marks, {
187
+ x: cx,
188
+ y: (d) => cy(d) + shift
189
+ });
190
+ return marks;
191
+ };
192
+ onCell("cell-genotypes", lettered, font, captioned ? -7 : 0, (d) => d.genotype).attr("font-weight", 600);
193
+ onCell("cell-phenotypes", captioned ? lettered : [], 10, 9, (d) => d.phenotype);
194
+ const gameteFont = Math.max(7, Math.min(13, (Math.min(cell, head) - 3) / (letters * .62)));
195
+ const headers = [...top.map((text, i) => ({
196
+ key: `top-${i}`,
197
+ text,
198
+ x: gx + (i + .5) * cell,
199
+ y: gy - 9,
200
+ anchor: "middle"
201
+ })), ...side.map((text, i) => ({
202
+ key: `side-${i}`,
203
+ text,
204
+ x: gx - 7,
205
+ y: gy + (i + .5) * cell,
206
+ anchor: "end"
207
+ }))];
208
+ const gametes = ctx.text(ctx.marks("axis-gametes", "text", cell >= gameteFont * .9 ? headers : [], (d) => d.key), gameteFont, "ink").attr("font-weight", 600).attr("dy", "0.35em").attr("text-anchor", (d) => d.anchor).text((d) => d.text);
209
+ ctx.set(gametes, {
210
+ x: (d) => d.x,
211
+ y: (d) => d.y
212
+ });
213
+ const captions = n ? [{
214
+ key: "top",
215
+ text: `${names[1]}: ${parents[1]}`,
216
+ room: Math.min(width, size + 2 * Math.min(gx, width - gx - size)),
217
+ transform: `translate(${(gx + size / 2).toFixed(1)},${(gy - HEAD - 5).toFixed(1)})`
218
+ }, {
219
+ key: "side",
220
+ text: `${names[0]}: ${parents[0]}`,
221
+ room: height,
222
+ transform: `translate(${(gx - head - 5).toFixed(1)},${(gy + size / 2).toFixed(1)}) rotate(-90)`
223
+ }] : [];
224
+ const titled = ctx.text(ctx.marks("axis-parents", "text", captions, (d) => d.key)).attr("text-anchor", "middle").text((d) => TextFit.fit(d.text, d.room, CHAR));
225
+ ctx.set(titled, { transform: (d) => d.transform });
226
+ const notes = n ? [] : [{
227
+ key: "empty",
228
+ text: "No genotypes to cross",
229
+ x: 4,
230
+ y: 12,
231
+ muted: true
232
+ }];
233
+ const chips = [];
234
+ const px = gx + size + GAP;
235
+ let y = gy - topBand + 10;
236
+ const heading = (title, tallies) => {
237
+ const summary = PunnettSquare.ratio(tallies.map((entry) => entry.count)), lead = TextFit.width(title, 6.9) + 8, inline = lead + TextFit.width(summary, CHAR) <= panel;
238
+ notes.push({
239
+ key: title,
240
+ text: title,
241
+ x: px,
242
+ y,
243
+ bold: true
244
+ });
245
+ const lines = inline ? [summary] : summary.split(" : ").reduce((rows, part) => {
246
+ const last = rows.length - 1, joined = `${rows[last]} : ${part}`;
247
+ if (rows.length && (TextFit.width(joined, CHAR) + 8 <= panel || rows.length === 3)) rows[last] = joined;
248
+ else rows.push(part);
249
+ return rows;
250
+ }, []);
251
+ lines.forEach((text, i) => {
252
+ if (!inline) y += LINE;
253
+ notes.push({
254
+ key: `${title}-ratio-${i}`,
255
+ text: TextFit.fit(i < lines.length - 1 ? `${text} :` : text, inline ? panel - lead : panel, CHAR),
256
+ x: inline ? px + lead : px,
257
+ y
258
+ });
259
+ });
260
+ };
261
+ (beside ? [["Phenotypes", phenotypes], ["Genotypes", genotypes]] : []).forEach(([title, tallies], s) => {
262
+ heading(title, tallies);
263
+ if (ratios === PunnettRatios.Bars) {
264
+ const inner = (entry) => Math.max(.5, panel * entry.count / (total || 1) - 2), fits = (entry, text) => TextFit.width(text, 5.8) + 4 <= inner(entry);
265
+ const named = s > 0 && tallies.every((entry) => fits(entry, entry.name));
266
+ let x = px;
267
+ for (const entry of tallies) {
268
+ const label = named ? entry.name : fits(entry, `${entry.count}`) ? `${entry.count}` : void 0;
269
+ chips.push({
270
+ key: `${title}/${entry.name}`,
271
+ x,
272
+ y: y + 7,
273
+ width: inner(entry),
274
+ height: BAR,
275
+ fill: palette.color(entry.phenotype),
276
+ tally: entry,
277
+ label
278
+ });
279
+ x += inner(entry) + 2;
280
+ }
281
+ y += 51;
282
+ return;
283
+ }
284
+ y += 16;
285
+ const labels = tallies.map((entry) => `${entry.count} ${entry.name}`), widest = Math.max(...labels.map((label) => TextFit.width(label, CHAR)));
286
+ const columns = Math.max(1, Math.min(tallies.length, Math.floor((panel + 8) / (widest + 22)))), step = panel / columns;
287
+ const kept = s ? 0 : Math.min(2, Math.ceil(genotypes.length / 2)) + 3;
288
+ const slots = Math.max(1, Math.floor((height - y) / LINE + 1) - kept) * columns;
289
+ const shown = tallies.length <= slots ? tallies.length : slots - 1;
290
+ tallies.slice(0, shown).forEach((entry, i) => {
291
+ const at = px + i % columns * step, row = y + Math.floor(i / columns) * LINE;
292
+ chips.push({
293
+ key: `${title}/${entry.name}`,
294
+ x: at,
295
+ y: row - 9,
296
+ width: 10,
297
+ height: 10,
298
+ fill: palette.color(entry.phenotype),
299
+ tally: entry
300
+ });
301
+ notes.push({
302
+ key: `${title}/${entry.name}`,
303
+ text: TextFit.fit(labels[i], step - 16, CHAR),
304
+ x: at + 14,
305
+ y: row
306
+ });
307
+ });
308
+ if (shown < tallies.length) notes.push({
309
+ key: `${title}-more`,
310
+ text: `+${tallies.length - shown} more`,
311
+ x: px + shown % columns * step,
312
+ y: y + Math.floor(shown / columns) * LINE,
313
+ muted: true
314
+ });
315
+ y += Math.ceil((shown + (shown < tallies.length ? 1 : 0)) / columns) * LINE + 8;
316
+ });
317
+ const swatches = ctx.marks("ratio-marks", "rect", chips, (d) => d.key).attr("fill", (d) => d.fill).attr("rx", 3);
318
+ ctx.set(swatches, {
319
+ x: (d) => d.x,
320
+ y: (d) => d.y,
321
+ width: (d) => d.width,
322
+ height: (d) => d.height
323
+ });
324
+ ctx.hover(swatches, (d) => ({
325
+ title: d.tally.name,
326
+ color: d.fill,
327
+ rows: [["Offspring", `${d.tally.count} in ${total}`], ...d.tally.name === d.tally.phenotype ? [] : [["Phenotype", d.tally.phenotype]]]
328
+ }));
329
+ const inside = ctx.text(ctx.marks("ratio-labels", "text", chips.filter((chip) => chip.label), (d) => d.key), 10, "ink").attr("text-anchor", "middle").attr("dy", "0.35em").attr("fill", (d) => palette.inkOn(d.fill)).style("pointer-events", "none").text((d) => d.label);
330
+ ctx.set(inside, {
331
+ x: (d) => d.x + d.width / 2,
332
+ y: (d) => d.y + d.height / 2
333
+ });
334
+ const written = ctx.marks("axis-ratios", "text", notes, (d) => d.key).attr("font-weight", (d) => d.bold ? 600 : 400).text((d) => d.text);
335
+ ctx.text(written).attr("fill", (d) => d.bold ? theme.ink : d.muted ? theme.inkMuted : theme.inkSecondary);
336
+ ctx.set(written, {
337
+ x: (d) => d.x,
338
+ y: (d) => d.y
339
+ });
340
+ }
341
+ };
342
+ export { PunnettSquare };
@@ -90,4 +90,25 @@ var SurvivorshipAge = /* @__PURE__ */ function(SurvivorshipAge) {
90
90
  SurvivorshipAge["Relative"] = "relative-age";
91
91
  return SurvivorshipAge;
92
92
  }({});
93
- export { EpidemicCurveBin, EpidemicCurveForm, FoodWebLevel, GseaWeighting, HelicalWheelHelix, HelicalWheelLayout, HydropathyForm, HydropathyScale, PrismaDetail, RankAbundanceMeasure, RankAbundanceModel, RankAbundanceRank, SequenceAlignmentColor, SurvivorshipAge, SurvivorshipScale };
93
+ /** The most genes crossed: one gives a 2 by 2 square, two a 4 by 4, three an 8 by 8. */
94
+ var PunnettCross = /* @__PURE__ */ function(PunnettCross) {
95
+ PunnettCross["Monohybrid"] = "monohybrid";
96
+ PunnettCross["Dihybrid"] = "dihybrid";
97
+ PunnettCross["Trihybrid"] = "trihybrid";
98
+ return PunnettCross;
99
+ }({});
100
+ /** How a heterozygote looks: like the dominant homozygote, between the two homozygotes, or showing both of them. */
101
+ var PunnettDominance = /* @__PURE__ */ function(PunnettDominance) {
102
+ PunnettDominance["Complete"] = "complete";
103
+ PunnettDominance["Incomplete"] = "incomplete";
104
+ PunnettDominance["Codominant"] = "codominant";
105
+ return PunnettDominance;
106
+ }({});
107
+ /** Genotype and phenotype ratios as counted lists, as bars split in proportion, or left out. */
108
+ var PunnettRatios = /* @__PURE__ */ function(PunnettRatios) {
109
+ PunnettRatios["List"] = "ratio-list";
110
+ PunnettRatios["Bars"] = "ratio-bars";
111
+ PunnettRatios["None"] = "no-ratios";
112
+ return PunnettRatios;
113
+ }({});
114
+ export { EpidemicCurveBin, EpidemicCurveForm, FoodWebLevel, GseaWeighting, HelicalWheelHelix, HelicalWheelLayout, HydropathyForm, HydropathyScale, PrismaDetail, PunnettCross, PunnettDominance, PunnettRatios, RankAbundanceMeasure, RankAbundanceModel, RankAbundanceRank, SequenceAlignmentColor, SurvivorshipAge, SurvivorshipScale };
@@ -1,4 +1,4 @@
1
- import { EpidemicCurveBin, EpidemicCurveForm, FoodWebLevel, GseaWeighting, HelicalWheelHelix, HelicalWheelLayout, HydropathyForm, HydropathyScale, PrismaDetail, RankAbundanceMeasure, RankAbundanceModel, RankAbundanceRank, SequenceAlignmentColor, SurvivorshipAge, SurvivorshipScale } from "./biologyEnums.js";
1
+ import { EpidemicCurveBin, EpidemicCurveForm, FoodWebLevel, GseaWeighting, HelicalWheelHelix, HelicalWheelLayout, HydropathyForm, HydropathyScale, PrismaDetail, PunnettCross, PunnettDominance, PunnettRatios, RankAbundanceMeasure, RankAbundanceModel, RankAbundanceRank, SequenceAlignmentColor, SurvivorshipAge, SurvivorshipScale } from "./biologyEnums.js";
2
2
  import { BiologyRows } from "./BiologyRows.js";
3
3
  import { BiologySamples } from "./BiologySamples.js";
4
4
  import { EpidemicCurve } from "./EpidemicCurve.js";
@@ -9,6 +9,7 @@ import { HelicalWheelPlot } from "./HelicalWheelPlot.js";
9
9
  import { HydropathyPlot } from "./HydropathyPlot.js";
10
10
  import { PrismaStage, prismaStageOf } from "./PrismaStage.js";
11
11
  import { PrismaFlowDiagram } from "./PrismaFlowDiagram.js";
12
+ import { PunnettSquare } from "./PunnettSquare.js";
12
13
  import { RankAbundancePlot } from "./RankAbundancePlot.js";
13
14
  import { SequenceAlignmentView } from "./SequenceAlignmentView.js";
14
15
  import { SurvivorshipCurve } from "./SurvivorshipCurve.js";
@@ -22,6 +23,7 @@ var biologychartsCatalog = [
22
23
  SurvivorshipCurve,
23
24
  FoodWebChart,
24
25
  EpidemicCurve,
25
- PrismaFlowDiagram
26
+ PrismaFlowDiagram,
27
+ PunnettSquare
26
28
  ];
27
- export { BiologyRows, BiologySamples, EpidemicCurve, EpidemicCurveBin, EpidemicCurveForm, FoodWebChart, FoodWebLevel, GseaEnrichmentPlot, GseaWeighting, HelicalWheelHelix, HelicalWheelLayout, HelicalWheelPlot, HydropathyForm, HydropathyPlot, HydropathyScale, PrismaDetail, PrismaFlowDiagram, PrismaStage, RankAbundanceMeasure, RankAbundanceModel, RankAbundancePlot, RankAbundanceRank, ResidueChemistry, ResidueClass, SequenceAlignmentColor, SequenceAlignmentView, SurvivorshipAge, SurvivorshipCurve, SurvivorshipScale, biologychartsCatalog, prismaStageOf };
29
+ export { BiologyRows, BiologySamples, EpidemicCurve, EpidemicCurveBin, EpidemicCurveForm, FoodWebChart, FoodWebLevel, GseaEnrichmentPlot, GseaWeighting, HelicalWheelHelix, HelicalWheelLayout, HelicalWheelPlot, HydropathyForm, HydropathyPlot, HydropathyScale, PrismaDetail, PrismaFlowDiagram, PrismaStage, PunnettCross, PunnettDominance, PunnettRatios, PunnettSquare, RankAbundanceMeasure, RankAbundanceModel, RankAbundancePlot, RankAbundanceRank, ResidueChemistry, ResidueClass, SequenceAlignmentColor, SequenceAlignmentView, SurvivorshipAge, SurvivorshipCurve, SurvivorshipScale, biologychartsCatalog, prismaStageOf };
@@ -422,6 +422,40 @@ var WORK = [
422
422
  ]
423
423
  ]]
424
424
  ];
425
+ var SIPOC_SUPPLIERS = [
426
+ "Fabrication cell",
427
+ "Powder supplier",
428
+ "Planning office",
429
+ "Site services"
430
+ ];
431
+ var SIPOC_INPUTS = [
432
+ ["Works order", "Planning office"],
433
+ ["Cut brackets", "Fabrication cell"],
434
+ ["Coating powder", "Powder supplier"],
435
+ ["Racks and hooks", "Fabrication cell"],
436
+ ["Gas and compressed air", "Site services"]
437
+ ];
438
+ var SIPOC_STEPS = [
439
+ "Rack the parts",
440
+ "Degrease and rinse",
441
+ "Apply powder",
442
+ "Cure in oven",
443
+ "Inspect finish",
444
+ "Pack and label"
445
+ ];
446
+ var SIPOC_OUTPUTS = [
447
+ ["Coated brackets", "Assembly line"],
448
+ ["Coated brackets", "Spares store"],
449
+ ["Inspection record", "Quality office"],
450
+ ["Closed works order", "Planning office"],
451
+ ["Scrap report", "Quality office"]
452
+ ];
453
+ var SIPOC_CUSTOMERS = [
454
+ "Planning office",
455
+ "Assembly line",
456
+ "Quality office",
457
+ "Spares store"
458
+ ];
425
459
  /** Invented experiments, studies and workshop notes, all drawn from `SampleData.rng`. No plant, product or team is real. */
426
460
  var DoeSamples = class {
427
461
  /** A replicated 3 x 2 x 3 factorial on a moulding press: `{ temperature, pressure, resin, strength }`, 36 runs. */
@@ -609,5 +643,49 @@ var DoeSamples = class {
609
643
  }));
610
644
  }).flat();
611
645
  }
646
+ /**
647
+ * A SIPOC of a powder coating line: `{ stage, item, partner }`. An input names its supplier and an output its customer;
648
+ * an output with two customers takes two rows. The seed turns the order of suppliers and customers and adds a step or leaves one out.
649
+ */
650
+ static sipoc(seed) {
651
+ const { u } = SampleData.rng(seed);
652
+ const extra = [
653
+ "Mask the threads",
654
+ "Pre-heat the parts",
655
+ ""
656
+ ][Math.floor(u() * 3)];
657
+ const steps = extra ? [
658
+ ...SIPOC_STEPS.slice(0, 2),
659
+ extra,
660
+ ...SIPOC_STEPS.slice(2)
661
+ ] : SIPOC_STEPS;
662
+ return [
663
+ ...turn(SIPOC_SUPPLIERS, seed).map((item) => ({
664
+ stage: "Supplier",
665
+ item,
666
+ partner: null
667
+ })),
668
+ ...SIPOC_INPUTS.map(([item, partner]) => ({
669
+ stage: "Input",
670
+ item,
671
+ partner
672
+ })),
673
+ ...steps.map((item) => ({
674
+ stage: "Process",
675
+ item,
676
+ partner: null
677
+ })),
678
+ ...SIPOC_OUTPUTS.map(([item, partner]) => ({
679
+ stage: "Output",
680
+ item,
681
+ partner
682
+ })),
683
+ ...turn(SIPOC_CUSTOMERS, seed).map((item) => ({
684
+ stage: "Customer",
685
+ item,
686
+ partner: null
687
+ }))
688
+ ];
689
+ }
612
690
  };
613
691
  export { DoeSamples };