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
@@ -1,4 +1,4 @@
1
- import { ActivityNodeKind, BpmnFlowKind, BpmnNodeKind, BpmnPartition, CallGraphLayering, DataFlowKind, DataFlowNotation, DifferentialFlameBasis, DifferentialFlameSort, MemoryMapOrigin, MemoryMapUsage, NassiBranchWidth, NassiKind, NassiRowHeight, ParseTreeEdge, ParseTreeLeaves, ParseTreeLevels, PetriNodeKind, PetriTokenMark, PetriTransitionForm, SignalFlowArc, SignalFlowArrow, SignalFlowNode, SoftwareRouting, TrieCompression, TrieLabel, UseCaseActorForm, UseCaseActorSide, UseCaseLinkKind, UseCaseNodeKind } from "./softwareEnums.js";
1
+ import { ActivityNodeKind, BpmnFlowKind, BpmnNodeKind, BpmnPartition, CallGraphLayering, ComponentGrouping, ComponentInterfaceForm, ComponentLinkKind, ComponentNodeKind, DataFlowKind, DataFlowNotation, DeploymentArtifactForm, DeploymentKind, DeploymentNodeForm, DifferentialFlameBasis, DifferentialFlameSort, MemoryMapOrigin, MemoryMapUsage, NassiBranchWidth, NassiKind, NassiRowHeight, ParseTreeEdge, ParseTreeLeaves, ParseTreeLevels, PetriNodeKind, PetriTokenMark, PetriTransitionForm, SignalFlowArc, SignalFlowArrow, SignalFlowNode, SoftwareRouting, TrieCompression, TrieLabel, UseCaseActorForm, UseCaseActorSide, UseCaseLinkKind, UseCaseNodeKind } from "./softwareEnums.js";
2
2
  import { SoftwareText } from "./SoftwareText.js";
3
3
  import { SoftwarePlacer } from "./SoftwarePlacer.js";
4
4
  import { SoftwareLayers } from "./SoftwareLayers.js";
@@ -10,7 +10,9 @@ import { SoftwareSamples } from "./SoftwareSamples.js";
10
10
  import { ActivityDiagram } from "./ActivityDiagram.js";
11
11
  import { BpmnDiagram } from "./BpmnDiagram.js";
12
12
  import { CallGraph } from "./CallGraph.js";
13
+ import { ComponentDiagram } from "./ComponentDiagram.js";
13
14
  import { DataFlowDiagram } from "./DataFlowDiagram.js";
15
+ import { DeploymentDiagram } from "./DeploymentDiagram.js";
14
16
  import { DifferentialFlameGraph } from "./DifferentialFlameGraph.js";
15
17
  import { MemoryMap } from "./MemoryMap.js";
16
18
  import { NassiLayout } from "./NassiLayout.js";
@@ -34,6 +36,8 @@ var softwarediagramsCatalog = [
34
36
  CallGraph,
35
37
  SignalFlowGraph,
36
38
  ParseTree,
37
- TrieDiagram
39
+ TrieDiagram,
40
+ ComponentDiagram,
41
+ DeploymentDiagram
38
42
  ];
39
- export { ActivityDiagram, ActivityNodeKind, BpmnDiagram, BpmnFlowKind, BpmnNodeKind, BpmnPartition, CallGraph, CallGraphLayering, DataFlowDiagram, DataFlowKind, DataFlowNotation, DifferentialFlameBasis, DifferentialFlameGraph, DifferentialFlameSort, MemoryMap, MemoryMapOrigin, MemoryMapUsage, NassiBranchWidth, NassiKind, NassiLayout, NassiRowHeight, NassiShneidermanDiagram, ParseTree, ParseTreeEdge, ParseTreeLeaves, ParseTreeLevels, PetriNet, PetriNodeKind, PetriTokenMark, PetriTransitionForm, SignalFlowArc, SignalFlowArrow, SignalFlowGraph, SignalFlowNode, SoftwareDiagram, SoftwareGraph, SoftwareLayers, SoftwarePlacer, SoftwareRouting, SoftwareSamples, SoftwareShapes, SoftwareText, SoftwareTree, SoftwareWiring, TrieCompression, TrieDiagram, TrieLabel, UseCaseActorForm, UseCaseActorSide, UseCaseDiagram, UseCaseLinkKind, UseCaseNodeKind, softwarediagramsCatalog };
43
+ export { ActivityDiagram, ActivityNodeKind, BpmnDiagram, BpmnFlowKind, BpmnNodeKind, BpmnPartition, CallGraph, CallGraphLayering, ComponentDiagram, ComponentGrouping, ComponentInterfaceForm, ComponentLinkKind, ComponentNodeKind, DataFlowDiagram, DataFlowKind, DataFlowNotation, DeploymentArtifactForm, DeploymentDiagram, DeploymentKind, DeploymentNodeForm, DifferentialFlameBasis, DifferentialFlameGraph, DifferentialFlameSort, MemoryMap, MemoryMapOrigin, MemoryMapUsage, NassiBranchWidth, NassiKind, NassiLayout, NassiRowHeight, NassiShneidermanDiagram, ParseTree, ParseTreeEdge, ParseTreeLeaves, ParseTreeLevels, PetriNet, PetriNodeKind, PetriTokenMark, PetriTransitionForm, SignalFlowArc, SignalFlowArrow, SignalFlowGraph, SignalFlowNode, SoftwareDiagram, SoftwareGraph, SoftwareLayers, SoftwarePlacer, SoftwareRouting, SoftwareSamples, SoftwareShapes, SoftwareText, SoftwareTree, SoftwareWiring, TrieCompression, TrieDiagram, TrieLabel, UseCaseActorForm, UseCaseActorSide, UseCaseDiagram, UseCaseLinkKind, UseCaseNodeKind, softwarediagramsCatalog };
@@ -189,4 +189,48 @@ var TrieLabel = /* @__PURE__ */ function(TrieLabel) {
189
189
  TrieLabel["Node"] = "node";
190
190
  return TrieLabel;
191
191
  }({});
192
- export { ActivityNodeKind, BpmnFlowKind, BpmnNodeKind, BpmnPartition, CallGraphLayering, DataFlowKind, DataFlowNotation, DifferentialFlameBasis, DifferentialFlameSort, MemoryMapOrigin, MemoryMapUsage, NassiBranchWidth, NassiKind, NassiRowHeight, ParseTreeEdge, ParseTreeLeaves, ParseTreeLevels, PetriNodeKind, PetriTokenMark, PetriTransitionForm, SignalFlowArc, SignalFlowArrow, SignalFlowNode, SoftwareRouting, TrieCompression, TrieLabel, UseCaseActorForm, UseCaseActorSide, UseCaseLinkKind, UseCaseNodeKind };
192
+ var ComponentNodeKind = /* @__PURE__ */ function(ComponentNodeKind) {
193
+ ComponentNodeKind["Component"] = "component";
194
+ ComponentNodeKind["Interface"] = "interface";
195
+ return ComponentNodeKind;
196
+ }({});
197
+ /** `Provides` and `Requires` join a component to an interface; `Dependency` joins two components. */
198
+ var ComponentLinkKind = /* @__PURE__ */ function(ComponentLinkKind) {
199
+ ComponentLinkKind["Provides"] = "provides";
200
+ ComponentLinkKind["Requires"] = "requires";
201
+ ComponentLinkKind["Dependency"] = "dependency";
202
+ return ComponentLinkKind;
203
+ }({});
204
+ /** How a component reaches an interface it requires: a socket cupped around the ball, or a dashed dependency arrow to it. */
205
+ var ComponentInterfaceForm = /* @__PURE__ */ function(ComponentInterfaceForm) {
206
+ ComponentInterfaceForm["BallSocket"] = "ball-socket";
207
+ ComponentInterfaceForm["Dependency"] = "dependency";
208
+ return ComponentInterfaceForm;
209
+ }({});
210
+ /** `Frames` encloses the components of each package in a package frame; `Flat` tells packages apart by colour alone. */
211
+ var ComponentGrouping = /* @__PURE__ */ function(ComponentGrouping) {
212
+ ComponentGrouping["Frames"] = "frames";
213
+ ComponentGrouping["Flat"] = "flat";
214
+ return ComponentGrouping;
215
+ }({});
216
+ /** A deployment target or what is deployed on it. `Environment` is UML's execution environment. */
217
+ var DeploymentKind = /* @__PURE__ */ function(DeploymentKind) {
218
+ DeploymentKind["Node"] = "node";
219
+ DeploymentKind["Device"] = "device";
220
+ DeploymentKind["Environment"] = "environment";
221
+ DeploymentKind["Artifact"] = "artifact";
222
+ return DeploymentKind;
223
+ }({});
224
+ /** `Cube` draws UML's node box with a top and a side face; `Flat` keeps the front face only. */
225
+ var DeploymentNodeForm = /* @__PURE__ */ function(DeploymentNodeForm) {
226
+ DeploymentNodeForm["Cube"] = "cube";
227
+ DeploymentNodeForm["Flat"] = "flat";
228
+ return DeploymentNodeForm;
229
+ }({});
230
+ /** Artifacts as symbols inside their node, or as a list of names under the node's own. */
231
+ var DeploymentArtifactForm = /* @__PURE__ */ function(DeploymentArtifactForm) {
232
+ DeploymentArtifactForm["Symbol"] = "symbol";
233
+ DeploymentArtifactForm["Listed"] = "listed";
234
+ return DeploymentArtifactForm;
235
+ }({});
236
+ export { ActivityNodeKind, BpmnFlowKind, BpmnNodeKind, BpmnPartition, CallGraphLayering, ComponentGrouping, ComponentInterfaceForm, ComponentLinkKind, ComponentNodeKind, DataFlowKind, DataFlowNotation, DeploymentArtifactForm, DeploymentKind, DeploymentNodeForm, DifferentialFlameBasis, DifferentialFlameSort, MemoryMapOrigin, MemoryMapUsage, NassiBranchWidth, NassiKind, NassiRowHeight, ParseTreeEdge, ParseTreeLeaves, ParseTreeLevels, PetriNodeKind, PetriTokenMark, PetriTransitionForm, SignalFlowArc, SignalFlowArrow, SignalFlowNode, SoftwareRouting, TrieCompression, TrieLabel, UseCaseActorForm, UseCaseActorSide, UseCaseLinkKind, UseCaseNodeKind };
@@ -0,0 +1,301 @@
1
+ import { ChartFamily, DataShape, Dimension } from "../../core/enums.js";
2
+ import { Scales } from "../../core/Scales.js";
3
+ import { SportsSamples } from "./SportsSamples.js";
4
+ import { SportsTimelineChart } from "./SportsTimelineChart.js";
5
+ import { line, scaleLinear, scaleLog } from "d3";
6
+ // src/charts/sportscharts/PowerDurationCurve.ts
7
+ var PowerDurationUnit = /* @__PURE__ */ function(PowerDurationUnit) {
8
+ PowerDurationUnit["Watts"] = "watts";
9
+ PowerDurationUnit["PerKilogram"] = "watts-per-kg";
10
+ return PowerDurationUnit;
11
+ }({});
12
+ var STANDARD = [
13
+ 5,
14
+ 60,
15
+ 300,
16
+ 1200,
17
+ 3600
18
+ ];
19
+ var ROUND = [
20
+ 1,
21
+ 18e3,
22
+ 10,
23
+ 30,
24
+ 600,
25
+ 1800,
26
+ 7200,
27
+ 36e3,
28
+ 86400,
29
+ 2,
30
+ 15,
31
+ 120,
32
+ 10800
33
+ ];
34
+ var TICK_GAP = 40;
35
+ var DOT = 4.5;
36
+ var CHAR = 6.2;
37
+ /**
38
+ * What an athlete can hold for how long: best mean power against the length of the effort, on a log time axis from seconds to hours.
39
+ * Use it to compare seasons, read the standard test durations, and find critical power and W' from the fitted model.
40
+ */
41
+ var PowerDurationCurve = class PowerDurationCurve extends SportsTimelineChart {
42
+ static meta = {
43
+ id: "power-duration-curve",
44
+ name: "Power-duration curve",
45
+ family: ChartFamily.Trend,
46
+ dimension: Dimension.Two,
47
+ shape: DataShape.Table,
48
+ description: "Plots an athlete's best mean power against effort duration on a log axis, with the fitted critical power model, earlier periods for reference and the standard durations marked, in watts or watts per kilogram. The sample rider is invented.",
49
+ tags: [
50
+ "sports",
51
+ "cycling",
52
+ "critical power",
53
+ "mean maximal power",
54
+ "W prime",
55
+ "power profile"
56
+ ],
57
+ sample: (seed) => SportsSamples.powerCurve(seed),
58
+ variants: {
59
+ unit: ["watts", "watts-per-kg"],
60
+ model: [true, false],
61
+ references: [true, false],
62
+ markers: [true, false]
63
+ }
64
+ };
65
+ #periods = [];
66
+ #fit = null;
67
+ #who = "";
68
+ #timeAxis = null;
69
+ #powerAxis = null;
70
+ defaults() {
71
+ return {
72
+ x: "duration",
73
+ y: "power",
74
+ period: "period",
75
+ weight: "weight",
76
+ athlete: "athlete",
77
+ unit: "watts",
78
+ model: true,
79
+ fitWindow: [120, 1800],
80
+ references: true,
81
+ markers: true
82
+ };
83
+ }
84
+ get #perKilo() {
85
+ return this.options.unit === "watts-per-kg";
86
+ }
87
+ get #unit() {
88
+ return this.#perKilo ? "W/kg" : "W";
89
+ }
90
+ #value(power) {
91
+ return this.#perKilo ? power.toFixed(power < 10 ? 2 : 1) : Math.round(power).toLocaleString("en");
92
+ }
93
+ /** A duration in the largest units that keep it whole: `5 s`, `20 min`, `1 h 30 min`. */
94
+ static span(seconds) {
95
+ if (seconds < 60) return `${+seconds.toFixed(1)} s`;
96
+ const whole = Math.round(seconds), minutes = Math.round(whole / 60);
97
+ if (whole < 3600) return whole % 60 ? `${Math.floor(whole / 60)} min ${whole % 60} s` : `${whole / 60} min`;
98
+ return minutes % 60 ? `${Math.floor(minutes / 60)} h ${minutes % 60} min` : `${minutes / 60} h`;
99
+ }
100
+ /**
101
+ * Least squares fit of P = CP + W'/t to the readings inside `window`, as a straight line of power against 1/t.
102
+ * `null` with fewer than two durations there, or when the line gives a critical power or W' at or below zero.
103
+ */
104
+ static fit(points, [from, to]) {
105
+ const used = points.filter((point) => point.t >= from && point.t <= to), n = used.length;
106
+ let sx = 0, sy = 0, sxx = 0, sxy = 0;
107
+ for (const { t, p } of used) {
108
+ sx += 1 / t;
109
+ sy += p;
110
+ sxx += 1 / (t * t);
111
+ sxy += p / t;
112
+ }
113
+ const spread = n * sxx - sx * sx;
114
+ if (n < 2 || spread <= 1e-15) return null;
115
+ const wPrime = (n * sxy - sx * sy) / spread, cp = (sy - wPrime * sx) / n;
116
+ return cp > 0 && wPrime > 0 ? {
117
+ cp,
118
+ wPrime
119
+ } : null;
120
+ }
121
+ /** Power at `t` seconds, read between the two nearest durations along log time. `null` outside the curve. */
122
+ static at(points, t) {
123
+ const after = points.findIndex((point) => point.t >= t), b = points[after];
124
+ if (!b) return null;
125
+ if (b.t === t) return b.p;
126
+ const a = points[after - 1];
127
+ return a ? a.p + (b.p - a.p) * Math.log(t / a.t) / Math.log(b.t / a.t) : null;
128
+ }
129
+ /** Axis ticks at round durations at least `gap` px apart, the standard test durations first. */
130
+ static ticks(scale, gap = TICK_GAP) {
131
+ const [low, high] = scale.domain(), kept = [];
132
+ for (const tick of [...STANDARD, ...ROUND]) if (tick >= low && tick <= high && kept.every((other) => Math.abs(scale(other) - scale(tick)) >= gap)) kept.push(tick);
133
+ return kept.sort((a, b) => a - b);
134
+ }
135
+ /** The first athlete's curves, the current period first, each with one reading per duration in rising order. */
136
+ get curves() {
137
+ const { x, y, period, weight, athlete, current } = this.options, rows = this.rows(), perKilo = this.#perKilo;
138
+ const who = this.#who = rows.map((row) => this.word(row[athlete])).find(Boolean) ?? "";
139
+ const best = /* @__PURE__ */ new Map();
140
+ for (const row of rows) {
141
+ const t = this.number(row[x]), watts = this.number(row[y]), mass = this.number(row[weight]);
142
+ if (this.word(row[athlete], who) !== who || t === null || t <= 0 || watts === null || perKilo && !(mass !== null && mass > 0)) continue;
143
+ const name = this.word(row[period], "Power"), held = best.get(name) ?? best.set(name, /* @__PURE__ */ new Map()).get(name);
144
+ held.set(t, Math.max(held.get(t) ?? -Infinity, perKilo ? watts / mass : watts));
145
+ }
146
+ const curves = [...best].map(([name, held]) => ({
147
+ period: name,
148
+ points: [...held].sort((a, b) => a[0] - b[0]).map(([t, p]) => ({
149
+ t,
150
+ p
151
+ }))
152
+ }));
153
+ const lead = curves.findIndex((curve) => curve.period === current);
154
+ return lead > 0 ? [curves[lead], ...curves.filter((_, i) => i !== lead)] : curves;
155
+ }
156
+ scales(ctx) {
157
+ const { width, height } = ctx.plot, { references, model, fitWindow } = this.options;
158
+ const periods = this.#periods = references ? this.curves : this.curves.slice(0, 1);
159
+ this.#fit = model && periods[0] ? PowerDurationCurve.fit(periods[0].points, fitWindow) : null;
160
+ const points = periods.flatMap((curve) => curve.points), times = points.map((point) => point.t), powers = points.map((point) => point.p);
161
+ let [low, high] = points.length ? [Math.min(...times), Math.max(...times)] : [1, 3600];
162
+ if (low === high) [low, high] = [low / 2, high * 2];
163
+ const top = Math.max(0, ...powers), bottom = Math.min(0, ...powers);
164
+ const x = scaleLog([low, high], [0, width]), y = this.#powerAxis = scaleLinear([bottom, top > bottom ? top * 1.04 : bottom + 1], [height, 0]).nice();
165
+ this.#timeAxis = Object.assign(x, { ticks: () => PowerDurationCurve.ticks(x) });
166
+ return {
167
+ x,
168
+ y
169
+ };
170
+ }
171
+ /** Time ticks name their duration, and the top power tick carries the unit. */
172
+ tickFormat(scale) {
173
+ if (scale === this.#timeAxis) return (value) => PowerDurationCurve.span(+value);
174
+ const plain = super.tickFormat(scale);
175
+ if (scale !== this.#powerAxis || !plain) return plain;
176
+ const top = Math.max(...this.#powerAxis.ticks(this.yTicks()));
177
+ return (value) => +value === top ? `${plain(value)} ${this.#unit}` : plain(value);
178
+ }
179
+ plotMarks(ctx, { x, y }) {
180
+ const { markers, fitWindow } = this.options, periods = this.#periods, fit = this.#fit, lead = periods[0], unit = this.#unit;
181
+ const color = (name) => ctx.palette.color(name);
182
+ for (const curve of periods) color(curve.period);
183
+ const [low, high] = x.domain(), top = y.domain()[1], { width, height } = ctx.plot;
184
+ const reading = (power) => `${this.#value(power)} ${unit}`;
185
+ const asymptote = ctx.marks("axis-critical", "line", fit ? [fit] : []).attr("stroke", ctx.theme.axis).attr("stroke-width", 1).attr("stroke-dasharray", "2 3");
186
+ ctx.set(asymptote, {
187
+ x1: 0,
188
+ x2: width,
189
+ y1: (d) => y(d.cp),
190
+ y2: (d) => y(d.cp)
191
+ });
192
+ const marked = markers && lead ? STANDARD.flatMap((t) => {
193
+ const p = PowerDurationCurve.at(lead.points, t);
194
+ return p === null || t < low || t > high ? [] : [{
195
+ t,
196
+ p
197
+ }];
198
+ }) : [];
199
+ const drops = ctx.marks("axis-standard", "line", marked, (d) => d.t).attr("stroke", ctx.theme.axis).attr("stroke-width", 1).attr("stroke-dasharray", "1 3");
200
+ ctx.set(drops, {
201
+ x1: (d) => x(d.t),
202
+ x2: (d) => x(d.t),
203
+ y1: (d) => y(d.p),
204
+ y2: height
205
+ });
206
+ const trace = line().curve(Scales.curve()).x((d) => x(d.t)).y((d) => y(d.p));
207
+ const drawn = [...periods].reverse();
208
+ const paths = ctx.marks("curves", "path", drawn.filter((curve) => curve.points.length > 1), (d) => d.period).attr("fill", "none").attr("stroke", (d) => color(d.period)).attr("stroke-width", (d) => d === lead ? 2 : 1.5).attr("stroke-opacity", (d) => d === lead ? 1 : .7).attr("stroke-linejoin", "round").attr("stroke-linecap", "round");
209
+ ctx.set(paths, { d: (d) => trace(d.points) ?? "" });
210
+ ctx.drawOn(paths);
211
+ ctx.hover(paths, (d) => ({
212
+ title: d.period,
213
+ color: color(d.period),
214
+ rows: STANDARD.flatMap((t) => {
215
+ const p = PowerDurationCurve.at(d.points, t);
216
+ return p === null ? [] : [[PowerDurationCurve.span(t), reading(p)]];
217
+ })
218
+ }));
219
+ const lone = ctx.marks("single", "circle", drawn.filter((curve) => curve.points.length === 1), (d) => d.period).attr("fill", (d) => color(d.period)).attr("stroke", ctx.theme.surface).attr("stroke-width", 2);
220
+ ctx.set(lone, {
221
+ cx: (d) => x(d.points[0].t),
222
+ cy: (d) => y(d.points[0].p),
223
+ r: DOT
224
+ }, { r: 0 });
225
+ ctx.hover(lone, (d) => ({
226
+ title: d.period,
227
+ color: color(d.period),
228
+ rows: [[PowerDurationCurve.span(d.points[0].t), reading(d.points[0].p)]]
229
+ }));
230
+ const start = fit ? Math.max(low, fit.wPrime / Math.max(1e-9, top - fit.cp)) : high;
231
+ const steps = start < high ? Array.from({ length: 64 }, (_, i) => start * (high / start) ** (i / 63)) : [];
232
+ const fitted = ctx.marks("model", "path", fit && steps.length ? [fit] : []).attr("fill", "none").attr("stroke", ctx.theme.ink).attr("stroke-width", 1.5).attr("stroke-dasharray", "5 4");
233
+ ctx.set(fitted, { d: (d) => line().x((t) => x(t)).y((t) => y(d.cp + d.wPrime / t))(steps) ?? "" });
234
+ ctx.hover(fitted, (d) => ({
235
+ title: "Critical power model",
236
+ rows: [
237
+ ["Critical power", reading(d.cp)],
238
+ ["W'", this.#work(d.wPrime)],
239
+ ["Fitted over", `${PowerDurationCurve.span(fitWindow[0])} to ${PowerDurationCurve.span(fitWindow[1])}`]
240
+ ]
241
+ }));
242
+ const dots = ctx.marks("standard", "circle", marked, (d) => d.t).attr("fill", lead ? color(lead.period) : null).attr("stroke", ctx.theme.surface).attr("stroke-width", 2);
243
+ ctx.set(dots, {
244
+ cx: (d) => x(d.t),
245
+ cy: (d) => y(d.p),
246
+ r: DOT
247
+ }, { r: 0 }, 30);
248
+ ctx.hover(dots, (d) => ({
249
+ title: `Best ${PowerDurationCurve.span(d.t)}`,
250
+ color: lead ? color(lead.period) : void 0,
251
+ rows: [[lead?.period ?? "", reading(d.p)], ...fit ? [["Model", reading(fit.cp + fit.wPrime / d.t)]] : []]
252
+ }));
253
+ let edge = -Infinity;
254
+ const values = marked.flatMap((d) => {
255
+ const text = this.#value(d.p), wide = text.length * CHAR, flip = x(d.t) + 7 + wide > width, left = flip ? x(d.t) - 7 - wide : x(d.t) + 7;
256
+ if (left < edge + 4 || y(d.p) < 18) return [];
257
+ edge = left + wide;
258
+ return [{
259
+ key: `value-${d.t}`,
260
+ text,
261
+ x: flip ? x(d.t) - 7 : x(d.t) + 7,
262
+ y: y(d.p) - 7,
263
+ anchor: flip ? "end" : "start",
264
+ tone: "ink"
265
+ }];
266
+ });
267
+ const summary = !lead ? [{
268
+ key: "empty",
269
+ text: this.#perKilo && this.rows().length ? "No body weight to divide by" : "No power readings",
270
+ x: 4,
271
+ y: 12,
272
+ tone: "muted"
273
+ }] : [...this.#who ? [{
274
+ key: "who",
275
+ text: this.#who,
276
+ x: width - 4,
277
+ y: 12,
278
+ anchor: "end",
279
+ tone: "ink"
280
+ }] : [], ...fit ? [{
281
+ key: "fit",
282
+ text: `CP ${reading(fit.cp)}, W' ${this.#work(fit.wPrime)}`,
283
+ x: width - 4,
284
+ y: this.#who ? 26 : 12,
285
+ anchor: "end"
286
+ }, {
287
+ key: "critical",
288
+ text: "CP",
289
+ x: 4,
290
+ y: y(fit.cp) - 5,
291
+ tone: "muted",
292
+ size: 10
293
+ }] : []];
294
+ this.notes(ctx, "notes", [...values, ...summary]);
295
+ }
296
+ /** W' in kilojoules, or in joules per kilogram when power is per kilogram. */
297
+ #work(wPrime) {
298
+ return this.#perKilo ? `${Math.round(wPrime)} J/kg` : `${(wPrime / 1e3).toFixed(1)} kJ`;
299
+ }
300
+ };
301
+ export { PowerDurationCurve, PowerDurationUnit };
@@ -314,6 +314,64 @@ var GOLF_BAG = [
314
314
  bias: 0
315
315
  }
316
316
  ];
317
+ var RIDERS = [
318
+ "Ines Halvard",
319
+ "Tomas Rehn",
320
+ "Mirela Stanek",
321
+ "Jonah Averill"
322
+ ];
323
+ var POWER_PERIODS = [
324
+ "This season",
325
+ "Last season",
326
+ "Two seasons ago"
327
+ ];
328
+ var POWER_DURATIONS = [
329
+ 1,
330
+ 2,
331
+ 3,
332
+ 5,
333
+ 8,
334
+ 10,
335
+ 15,
336
+ 20,
337
+ 30,
338
+ 45,
339
+ 60,
340
+ 90,
341
+ 120,
342
+ 180,
343
+ 240,
344
+ 300,
345
+ 420,
346
+ 600,
347
+ 900,
348
+ 1200,
349
+ 1800,
350
+ 2700,
351
+ 3600,
352
+ 5400,
353
+ 7200,
354
+ 10800,
355
+ 14400,
356
+ 18e3
357
+ ];
358
+ /** Stress score of each weekday's session, Monday first. 0 is a rest day. */
359
+ var TRAINING_WEEK = [
360
+ 0,
361
+ 85,
362
+ 60,
363
+ 95,
364
+ 0,
365
+ 150,
366
+ 110
367
+ ];
368
+ /** Share of the planned load in each week of a block: three weeks building, one easy. */
369
+ var TRAINING_BLOCK = [
370
+ .85,
371
+ 1,
372
+ 1.2,
373
+ .55
374
+ ];
317
375
  /** Picks from weighted items with one uniform draw. */
318
376
  var weighted = (items, roll) => {
319
377
  let pick = roll * items.reduce((sum, item) => sum + (item.weight ?? item.share ?? 1), 0);
@@ -674,5 +732,49 @@ var SportsSamples = class SportsSamples {
674
732
  };
675
733
  }));
676
734
  }
735
+ /**
736
+ * `{ athlete, period, duration, power, weight }`: one rider's best mean power in watts for efforts of a second to five hours,
737
+ * this season and the two before, with body weight in kilograms. Power follows a three-parameter critical power curve that fades past half an hour.
738
+ */
739
+ static powerCurve(seed) {
740
+ const { u, n } = SampleData.rng(seed);
741
+ const athlete = RIDERS[Math.floor(u() * RIDERS.length)], cp = 250 + u() * 55, reserve = 17e3 + u() * 8e3, sprint = 950 + u() * 350, mass = 62 + u() * 14;
742
+ return POWER_PERIODS.flatMap((period, back) => {
743
+ const steady = cp * (1 - back * (.03 + u() * .02)), burst = reserve * (1 - back * .06), top = sprint * [
744
+ 1,
745
+ 1.04,
746
+ .97
747
+ ][back];
748
+ const weight = round(mass + back * .9 + n() * .3, 1);
749
+ let best = Infinity;
750
+ return POWER_DURATIONS.map((duration) => {
751
+ const fade = duration > 1800 ? 1 - .06 * Math.log(duration / 1800) : 1;
752
+ best = Math.min(best, Math.round((steady + burst / (duration + burst / (top - steady))) * fade * (1 + n() * .008)));
753
+ return {
754
+ athlete,
755
+ period,
756
+ duration,
757
+ power: best,
758
+ weight
759
+ };
760
+ });
761
+ });
762
+ }
763
+ /** `{ date, athlete, load }`: a training stress score for each session of 20 weeks in four week blocks, ending in a taper and a race. Rest days and missed sessions have no row. */
764
+ static trainingLoad(seed, weeks = 20) {
765
+ const { u, n } = SampleData.rng(seed);
766
+ const athlete = RIDERS[Math.floor(u() * RIDERS.length)], start = Date.UTC(2025, 1, 3 + 7 * (seed % 4)), last = weeks * 7 - 1;
767
+ return Array.from({ length: weeks * 7 }, (_, day) => {
768
+ const week = Math.floor(day / 7), left = weeks - 1 - week;
769
+ const share = left === 0 ? .45 : left === 1 ? .7 : TRAINING_BLOCK[week % 4] * (.7 + week * .035);
770
+ const planned = day === last ? 240 : TRAINING_WEEK[day % 7] * share;
771
+ if (!planned || day !== last && u() < .06) return [];
772
+ return [{
773
+ date: new Date(start + day * 864e5).toISOString().slice(0, 10),
774
+ athlete,
775
+ load: Math.max(10, Math.round(planned * (1 + n() * .12)))
776
+ }];
777
+ }).flat();
778
+ }
677
779
  };
678
780
  export { SportsSamples };