@classytic/labs 0.1.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 (547) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +105 -0
  3. package/dist/biology/enzyme-rate/index.d.mts +1 -0
  4. package/dist/biology/enzyme-rate/preset.d.mts +25 -0
  5. package/dist/biology/enzyme-rate/preset.mjs +256 -0
  6. package/dist/biology/genetic-cross/core.d.mts +64 -0
  7. package/dist/biology/genetic-cross/core.mjs +147 -0
  8. package/dist/biology/genetic-cross/grid.mjs +239 -0
  9. package/dist/biology/genetic-cross/index.d.mts +3 -0
  10. package/dist/biology/genetic-cross/preset.d.mts +26 -0
  11. package/dist/biology/genetic-cross/preset.mjs +184 -0
  12. package/dist/biology/genetic-cross/sex-linked.d.mts +27 -0
  13. package/dist/biology/genetic-cross/sex-linked.mjs +226 -0
  14. package/dist/biology/index.d.mts +11 -0
  15. package/dist/biology/index.mjs +12 -0
  16. package/dist/biology/photosynthesis-factors/index.d.mts +1 -0
  17. package/dist/biology/photosynthesis-factors/preset.d.mts +25 -0
  18. package/dist/biology/photosynthesis-factors/preset.mjs +270 -0
  19. package/dist/biology/punnett-cross/index.d.mts +1 -0
  20. package/dist/biology/punnett-cross/preset.d.mts +27 -0
  21. package/dist/biology/punnett-cross/preset.mjs +21 -0
  22. package/dist/biology/respiration/index.d.mts +1 -0
  23. package/dist/biology/respiration/preset.d.mts +17 -0
  24. package/dist/biology/respiration/preset.mjs +179 -0
  25. package/dist/biology/sequence/central-dogma.d.mts +17 -0
  26. package/dist/biology/sequence/central-dogma.mjs +339 -0
  27. package/dist/biology/sequence/core.d.mts +38 -0
  28. package/dist/biology/sequence/core.mjs +178 -0
  29. package/dist/biology/sequence/index.d.mts +3 -0
  30. package/dist/biology/sequence/preset.d.mts +20 -0
  31. package/dist/biology/sequence/preset.mjs +235 -0
  32. package/dist/blocks/accounting.d.mts +142 -0
  33. package/dist/blocks/accounting.mjs +446 -0
  34. package/dist/blocks/authoring.d.mts +12 -0
  35. package/dist/blocks/authoring.mjs +705 -0
  36. package/dist/blocks/biology.d.mts +197 -0
  37. package/dist/blocks/biology.mjs +513 -0
  38. package/dist/blocks/chem.d.mts +128 -0
  39. package/dist/blocks/chem.mjs +486 -0
  40. package/dist/blocks/circuits.d.mts +86 -0
  41. package/dist/blocks/circuits.mjs +348 -0
  42. package/dist/blocks/discrete.d.mts +62 -0
  43. package/dist/blocks/discrete.mjs +314 -0
  44. package/dist/blocks/economics.d.mts +56 -0
  45. package/dist/blocks/economics.mjs +203 -0
  46. package/dist/blocks/geography.d.mts +58 -0
  47. package/dist/blocks/geography.mjs +115 -0
  48. package/dist/blocks/geometry.d.mts +28 -0
  49. package/dist/blocks/geometry.mjs +160 -0
  50. package/dist/blocks/ict.d.mts +65 -0
  51. package/dist/blocks/ict.mjs +197 -0
  52. package/dist/blocks/index.d.mts +4555 -0
  53. package/dist/blocks/index.mjs +120 -0
  54. package/dist/blocks/lab-block.d.mts +16 -0
  55. package/dist/blocks/lab-block.mjs +74 -0
  56. package/dist/blocks/lab-config.d.mts +23 -0
  57. package/dist/blocks/lab-config.mjs +200 -0
  58. package/dist/blocks/lab-gallery.d.mts +30 -0
  59. package/dist/blocks/lab-gallery.mjs +208 -0
  60. package/dist/blocks/language.d.mts +349 -0
  61. package/dist/blocks/language.mjs +750 -0
  62. package/dist/blocks/lesson.d.mts +43 -0
  63. package/dist/blocks/lesson.mjs +140 -0
  64. package/dist/blocks/math.d.mts +411 -0
  65. package/dist/blocks/math.mjs +1536 -0
  66. package/dist/blocks/ml.d.mts +84 -0
  67. package/dist/blocks/ml.mjs +146 -0
  68. package/dist/blocks/physics.d.mts +259 -0
  69. package/dist/blocks/physics.mjs +868 -0
  70. package/dist/blocks/statistics.d.mts +29 -0
  71. package/dist/blocks/statistics.mjs +123 -0
  72. package/dist/catalog/index.d.mts +3 -0
  73. package/dist/catalog/index.mjs +8 -0
  74. package/dist/catalog/registry.d.mts +46 -0
  75. package/dist/catalog/registry.mjs +56 -0
  76. package/dist/catalog/templates.d.mts +11 -0
  77. package/dist/catalog/templates.mjs +141 -0
  78. package/dist/chem/battery.d.mts +16 -0
  79. package/dist/chem/battery.mjs +311 -0
  80. package/dist/chem/bohr-atom.d.mts +16 -0
  81. package/dist/chem/bohr-atom.mjs +212 -0
  82. package/dist/chem/diffusion/asset.mjs +76 -0
  83. package/dist/chem/diffusion/index.d.mts +1 -0
  84. package/dist/chem/diffusion/preset.d.mts +15 -0
  85. package/dist/chem/diffusion/preset.mjs +188 -0
  86. package/dist/chem/electrochem/index.d.mts +1 -0
  87. package/dist/chem/electrochem/preset.d.mts +23 -0
  88. package/dist/chem/electrochem/preset.mjs +402 -0
  89. package/dist/chem/equilibrium/index.d.mts +1 -0
  90. package/dist/chem/equilibrium/preset.d.mts +36 -0
  91. package/dist/chem/equilibrium/preset.mjs +416 -0
  92. package/dist/chem/gas-box/index.d.mts +1 -0
  93. package/dist/chem/gas-box/preset.d.mts +27 -0
  94. package/dist/chem/gas-box/preset.mjs +395 -0
  95. package/dist/chem/index.d.mts +16 -0
  96. package/dist/chem/index.mjs +17 -0
  97. package/dist/chem/kinetics/index.d.mts +1 -0
  98. package/dist/chem/kinetics/preset.d.mts +31 -0
  99. package/dist/chem/kinetics/preset.mjs +478 -0
  100. package/dist/chem/periodic-trends/index.d.mts +1 -0
  101. package/dist/chem/periodic-trends/preset.d.mts +21 -0
  102. package/dist/chem/periodic-trends/preset.mjs +831 -0
  103. package/dist/chem/reaction-lab.d.mts +18 -0
  104. package/dist/chem/reaction-lab.mjs +165 -0
  105. package/dist/chem/reaction-profile.d.mts +21 -0
  106. package/dist/chem/reaction-profile.mjs +287 -0
  107. package/dist/chem/solution/dilution.d.mts +27 -0
  108. package/dist/chem/solution/dilution.mjs +199 -0
  109. package/dist/chem/solution/field.d.mts +30 -0
  110. package/dist/chem/solution/field.mjs +145 -0
  111. package/dist/chem/solution/index.d.mts +3 -0
  112. package/dist/chem/solution/solution-box.d.mts +28 -0
  113. package/dist/chem/solution/solution-box.mjs +140 -0
  114. package/dist/chem/stoichiometry/index.d.mts +1 -0
  115. package/dist/chem/stoichiometry/preset.d.mts +29 -0
  116. package/dist/chem/stoichiometry/preset.mjs +392 -0
  117. package/dist/chem/titration/index.d.mts +1 -0
  118. package/dist/chem/titration/preset.d.mts +29 -0
  119. package/dist/chem/titration/preset.mjs +436 -0
  120. package/dist/circuits/ac-dc/asset.mjs +295 -0
  121. package/dist/circuits/ac-dc/index.d.mts +1 -0
  122. package/dist/circuits/ac-dc/preset.d.mts +16 -0
  123. package/dist/circuits/ac-dc/preset.mjs +134 -0
  124. package/dist/circuits/capacitor-leak/index.d.mts +1 -0
  125. package/dist/circuits/capacitor-leak/preset.d.mts +32 -0
  126. package/dist/circuits/capacitor-leak/preset.mjs +271 -0
  127. package/dist/circuits/circuit/asset.d.mts +6 -0
  128. package/dist/circuits/circuit/asset.mjs +367 -0
  129. package/dist/circuits/circuit/index.d.mts +2 -0
  130. package/dist/circuits/circuit/preset.d.mts +46 -0
  131. package/dist/circuits/circuit/preset.mjs +235 -0
  132. package/dist/circuits/circuit-builder.d.mts +30 -0
  133. package/dist/circuits/circuit-builder.mjs +412 -0
  134. package/dist/circuits/circuit-lab.d.mts +20 -0
  135. package/dist/circuits/circuit-lab.mjs +400 -0
  136. package/dist/circuits/index.d.mts +7 -0
  137. package/dist/circuits/index.mjs +8 -0
  138. package/dist/commerce/accounting/core.d.mts +48 -0
  139. package/dist/commerce/accounting/core.mjs +57 -0
  140. package/dist/commerce/accounting/equation-balance.d.mts +35 -0
  141. package/dist/commerce/accounting/equation-balance.mjs +292 -0
  142. package/dist/commerce/accounting/index.d.mts +4 -0
  143. package/dist/commerce/accounting/journal-poster.d.mts +29 -0
  144. package/dist/commerce/accounting/journal-poster.mjs +472 -0
  145. package/dist/commerce/accounting/statement-sorter.d.mts +25 -0
  146. package/dist/commerce/accounting/statement-sorter.mjs +304 -0
  147. package/dist/commerce/economics/core.d.mts +33 -0
  148. package/dist/commerce/economics/core.mjs +26 -0
  149. package/dist/commerce/economics/demand-shift-vs-move.d.mts +35 -0
  150. package/dist/commerce/economics/demand-shift-vs-move.mjs +324 -0
  151. package/dist/commerce/economics/elasticity-revenue.d.mts +31 -0
  152. package/dist/commerce/economics/elasticity-revenue.mjs +253 -0
  153. package/dist/commerce/economics/index.d.mts +4 -0
  154. package/dist/commerce/economics/market-equilibrium.d.mts +33 -0
  155. package/dist/commerce/economics/market-equilibrium.mjs +340 -0
  156. package/dist/commerce/index.d.mts +9 -0
  157. package/dist/commerce/index.mjs +10 -0
  158. package/dist/core/easing.d.mts +28 -0
  159. package/dist/core/easing.mjs +66 -0
  160. package/dist/core/index.d.mts +10 -0
  161. package/dist/core/index.mjs +11 -0
  162. package/dist/core/numeric.d.mts +37 -0
  163. package/dist/core/numeric.mjs +75 -0
  164. package/dist/core/reactive.d.mts +24 -0
  165. package/dist/core/reactive.mjs +51 -0
  166. package/dist/core/rng.d.mts +21 -0
  167. package/dist/core/rng.mjs +39 -0
  168. package/dist/core/tex.d.mts +14 -0
  169. package/dist/core/tex.mjs +44 -0
  170. package/dist/core/timeline.d.mts +34 -0
  171. package/dist/core/timeline.mjs +77 -0
  172. package/dist/core/util.d.mts +19 -0
  173. package/dist/core/util.mjs +31 -0
  174. package/dist/discrete/arrangements/preset.d.mts +28 -0
  175. package/dist/discrete/arrangements/preset.mjs +304 -0
  176. package/dist/discrete/bayes/preset.d.mts +33 -0
  177. package/dist/discrete/bayes/preset.mjs +476 -0
  178. package/dist/discrete/binomial/preset.d.mts +25 -0
  179. package/dist/discrete/binomial/preset.mjs +333 -0
  180. package/dist/discrete/core/combinatorics.d.mts +23 -0
  181. package/dist/discrete/core/combinatorics.mjs +57 -0
  182. package/dist/discrete/core/inclusionExclusion.d.mts +19 -0
  183. package/dist/discrete/core/inclusionExclusion.mjs +30 -0
  184. package/dist/discrete/core/pigeonhole.d.mts +15 -0
  185. package/dist/discrete/core/pigeonhole.mjs +24 -0
  186. package/dist/discrete/core/probability.d.mts +29 -0
  187. package/dist/discrete/core/probability.mjs +43 -0
  188. package/dist/discrete/core/sets.d.mts +21 -0
  189. package/dist/discrete/core/sets.mjs +45 -0
  190. package/dist/discrete/counting-slots/preset.d.mts +30 -0
  191. package/dist/discrete/counting-slots/preset.mjs +553 -0
  192. package/dist/discrete/counting-tree/index.d.mts +1 -0
  193. package/dist/discrete/counting-tree/preset.d.mts +44 -0
  194. package/dist/discrete/counting-tree/preset.mjs +364 -0
  195. package/dist/discrete/expected-value/preset.d.mts +28 -0
  196. package/dist/discrete/expected-value/preset.mjs +352 -0
  197. package/dist/discrete/hypergeometric/preset.d.mts +25 -0
  198. package/dist/discrete/hypergeometric/preset.mjs +330 -0
  199. package/dist/discrete/index.d.mts +26 -0
  200. package/dist/discrete/index.mjs +27 -0
  201. package/dist/discrete/karnaugh/index.d.mts +1 -0
  202. package/dist/discrete/karnaugh/preset.d.mts +30 -0
  203. package/dist/discrete/karnaugh/preset.mjs +452 -0
  204. package/dist/discrete/lln/asset.mjs +206 -0
  205. package/dist/discrete/lln/index.d.mts +1 -0
  206. package/dist/discrete/lln/preset.d.mts +17 -0
  207. package/dist/discrete/lln/preset.mjs +152 -0
  208. package/dist/discrete/logic-circuit/index.d.mts +1 -0
  209. package/dist/discrete/logic-circuit/preset.d.mts +47 -0
  210. package/dist/discrete/logic-circuit/preset.mjs +307 -0
  211. package/dist/discrete/monte-carlo/index.d.mts +1 -0
  212. package/dist/discrete/monte-carlo/preset.d.mts +64 -0
  213. package/dist/discrete/monte-carlo/preset.mjs +446 -0
  214. package/dist/discrete/monty-hall/index.d.mts +1 -0
  215. package/dist/discrete/monty-hall/preset.d.mts +23 -0
  216. package/dist/discrete/monty-hall/preset.mjs +491 -0
  217. package/dist/discrete/outcome-builder/preset.d.mts +24 -0
  218. package/dist/discrete/outcome-builder/preset.mjs +283 -0
  219. package/dist/discrete/pascal/preset.d.mts +24 -0
  220. package/dist/discrete/pascal/preset.mjs +372 -0
  221. package/dist/discrete/sample-space/index.d.mts +1 -0
  222. package/dist/discrete/sample-space/preset.d.mts +42 -0
  223. package/dist/discrete/sample-space/preset.mjs +395 -0
  224. package/dist/discrete/selection/preset.d.mts +33 -0
  225. package/dist/discrete/selection/preset.mjs +406 -0
  226. package/dist/discrete/truth-table/index.d.mts +1 -0
  227. package/dist/discrete/truth-table/preset.d.mts +30 -0
  228. package/dist/discrete/truth-table/preset.mjs +456 -0
  229. package/dist/discrete/venn/index.d.mts +1 -0
  230. package/dist/discrete/venn/preset.d.mts +32 -0
  231. package/dist/discrete/venn/preset.mjs +461 -0
  232. package/dist/geography/cycle-lab/index.d.mts +1 -0
  233. package/dist/geography/cycle-lab/preset.d.mts +25 -0
  234. package/dist/geography/cycle-lab/preset.mjs +254 -0
  235. package/dist/geography/cycles.d.mts +21 -0
  236. package/dist/geography/cycles.mjs +205 -0
  237. package/dist/geography/index.d.mts +4 -0
  238. package/dist/geography/index.mjs +5 -0
  239. package/dist/geometry/board/index.d.mts +1 -0
  240. package/dist/geometry/board/preset.d.mts +71 -0
  241. package/dist/geometry/board/preset.mjs +148 -0
  242. package/dist/geometry/builder.d.mts +18 -0
  243. package/dist/geometry/builder.mjs +332 -0
  244. package/dist/geometry/index.d.mts +4 -0
  245. package/dist/geometry/index.mjs +5 -0
  246. package/dist/geometry/intersecting-circles.d.mts +17 -0
  247. package/dist/geometry/intersecting-circles.mjs +104 -0
  248. package/dist/ict/index.d.mts +5 -0
  249. package/dist/ict/index.mjs +6 -0
  250. package/dist/ict/number-systems/base-odometer.d.mts +34 -0
  251. package/dist/ict/number-systems/base-odometer.mjs +160 -0
  252. package/dist/ict/number-systems/bit-grouper.d.mts +32 -0
  253. package/dist/ict/number-systems/bit-grouper.mjs +190 -0
  254. package/dist/ict/number-systems/index.d.mts +4 -0
  255. package/dist/ict/number-systems/place-value-dial.d.mts +29 -0
  256. package/dist/ict/number-systems/place-value-dial.mjs +153 -0
  257. package/dist/ict/number-systems/wheel.d.mts +73 -0
  258. package/dist/ict/number-systems/wheel.mjs +279 -0
  259. package/dist/index.d.mts +10 -0
  260. package/dist/index.mjs +11 -0
  261. package/dist/kit/anim.mjs +52 -0
  262. package/dist/kit/annotate.mjs +116 -0
  263. package/dist/kit/answer-check.d.mts +38 -0
  264. package/dist/kit/answer-check.mjs +65 -0
  265. package/dist/kit/asset-util.mjs +15 -0
  266. package/dist/kit/controls.mjs +77 -0
  267. package/dist/kit/cycle.d.mts +44 -0
  268. package/dist/kit/cycle.mjs +188 -0
  269. package/dist/kit/diagram.mjs +176 -0
  270. package/dist/kit/electronics.mjs +357 -0
  271. package/dist/kit/expr-analysis.d.mts +37 -0
  272. package/dist/kit/expr-analysis.mjs +111 -0
  273. package/dist/kit/frame.d.mts +70 -0
  274. package/dist/kit/frame.mjs +205 -0
  275. package/dist/kit/freq-tree.mjs +99 -0
  276. package/dist/kit/gameshow.mjs +315 -0
  277. package/dist/kit/index.d.mts +5 -0
  278. package/dist/kit/index.mjs +6 -0
  279. package/dist/kit/logic-gates.d.mts +6 -0
  280. package/dist/kit/logic-gates.mjs +210 -0
  281. package/dist/kit/molecules.mjs +178 -0
  282. package/dist/kit/pedagogy.d.mts +126 -0
  283. package/dist/kit/pedagogy.mjs +331 -0
  284. package/dist/kit/play.d.mts +21 -0
  285. package/dist/kit/play.mjs +52 -0
  286. package/dist/kit/probability.mjs +141 -0
  287. package/dist/kit/proportion.mjs +112 -0
  288. package/dist/kit/reaction.mjs +102 -0
  289. package/dist/kit/rich.d.mts +10 -0
  290. package/dist/kit/rich.mjs +21 -0
  291. package/dist/kit/scale.mjs +230 -0
  292. package/dist/kit/space.mjs +326 -0
  293. package/dist/kit/steps.d.mts +24 -0
  294. package/dist/kit/steps.mjs +57 -0
  295. package/dist/kit/thermal.mjs +289 -0
  296. package/dist/language/agreement/index.d.mts +1 -0
  297. package/dist/language/agreement/preset.d.mts +27 -0
  298. package/dist/language/agreement/preset.mjs +113 -0
  299. package/dist/language/article-lens/index.d.mts +1 -0
  300. package/dist/language/article-lens/preset.d.mts +31 -0
  301. package/dist/language/article-lens/preset.mjs +125 -0
  302. package/dist/language/deck.d.mts +45 -0
  303. package/dist/language/deck.mjs +61 -0
  304. package/dist/language/icon.d.mts +40 -0
  305. package/dist/language/icon.mjs +73 -0
  306. package/dist/language/index.d.mts +10 -0
  307. package/dist/language/index.mjs +11 -0
  308. package/dist/language/preposition-scene/index.d.mts +1 -0
  309. package/dist/language/preposition-scene/preset.d.mts +34 -0
  310. package/dist/language/preposition-scene/preset.mjs +234 -0
  311. package/dist/language/sentence-builder/index.d.mts +1 -0
  312. package/dist/language/sentence-builder/preset.d.mts +32 -0
  313. package/dist/language/sentence-builder/preset.mjs +122 -0
  314. package/dist/language/transform/index.d.mts +1 -0
  315. package/dist/language/transform/preset.d.mts +31 -0
  316. package/dist/language/transform/preset.mjs +137 -0
  317. package/dist/language/ui.d.mts +53 -0
  318. package/dist/language/ui.mjs +88 -0
  319. package/dist/language/word-match/index.d.mts +1 -0
  320. package/dist/language/word-match/preset.d.mts +22 -0
  321. package/dist/language/word-match/preset.mjs +148 -0
  322. package/dist/math/area-model/asset.d.mts +6 -0
  323. package/dist/math/area-model/asset.mjs +270 -0
  324. package/dist/math/area-model/index.d.mts +2 -0
  325. package/dist/math/area-model/preset.d.mts +29 -0
  326. package/dist/math/area-model/preset.mjs +243 -0
  327. package/dist/math/balance-algebra/asset.d.mts +6 -0
  328. package/dist/math/balance-algebra/asset.mjs +150 -0
  329. package/dist/math/balance-algebra/index.d.mts +2 -0
  330. package/dist/math/balance-algebra/preset.d.mts +30 -0
  331. package/dist/math/balance-algebra/preset.mjs +228 -0
  332. package/dist/math/derivation.d.mts +22 -0
  333. package/dist/math/derivation.mjs +113 -0
  334. package/dist/math/derivative-explorer/index.d.mts +1 -0
  335. package/dist/math/derivative-explorer/preset.d.mts +19 -0
  336. package/dist/math/derivative-explorer/preset.mjs +227 -0
  337. package/dist/math/function-machine/index.d.mts +1 -0
  338. package/dist/math/function-machine/preset.d.mts +21 -0
  339. package/dist/math/function-machine/preset.mjs +177 -0
  340. package/dist/math/gradient-descent.d.mts +23 -0
  341. package/dist/math/gradient-descent.mjs +473 -0
  342. package/dist/math/grapher/index.d.mts +1 -0
  343. package/dist/math/grapher/preset.d.mts +40 -0
  344. package/dist/math/grapher/preset.mjs +313 -0
  345. package/dist/math/harmonic-form/index.d.mts +1 -0
  346. package/dist/math/harmonic-form/preset.d.mts +21 -0
  347. package/dist/math/harmonic-form/preset.mjs +387 -0
  348. package/dist/math/index.d.mts +25 -0
  349. package/dist/math/index.mjs +26 -0
  350. package/dist/math/integral-explorer/index.d.mts +1 -0
  351. package/dist/math/integral-explorer/preset.d.mts +23 -0
  352. package/dist/math/integral-explorer/preset.mjs +217 -0
  353. package/dist/math/interactive/index.d.mts +1 -0
  354. package/dist/math/interactive/preset.d.mts +72 -0
  355. package/dist/math/interactive/preset.mjs +202 -0
  356. package/dist/math/limit-explorer/index.d.mts +1 -0
  357. package/dist/math/limit-explorer/preset.d.mts +19 -0
  358. package/dist/math/limit-explorer/preset.mjs +216 -0
  359. package/dist/math/linear-system/index.d.mts +1 -0
  360. package/dist/math/linear-system/preset.d.mts +28 -0
  361. package/dist/math/linear-system/preset.mjs +164 -0
  362. package/dist/math/mystery-bucket/asset.d.mts +6 -0
  363. package/dist/math/mystery-bucket/asset.mjs +145 -0
  364. package/dist/math/mystery-bucket/index.d.mts +2 -0
  365. package/dist/math/mystery-bucket/preset.d.mts +36 -0
  366. package/dist/math/mystery-bucket/preset.mjs +116 -0
  367. package/dist/math/number-line/index.d.mts +1 -0
  368. package/dist/math/number-line/preset.d.mts +24 -0
  369. package/dist/math/number-line/preset.mjs +142 -0
  370. package/dist/math/parabola/index.d.mts +1 -0
  371. package/dist/math/parabola/preset.d.mts +13 -0
  372. package/dist/math/parabola/preset.mjs +79 -0
  373. package/dist/math/pattern/asset.d.mts +6 -0
  374. package/dist/math/pattern/asset.mjs +102 -0
  375. package/dist/math/pattern/index.d.mts +2 -0
  376. package/dist/math/pattern/preset.d.mts +32 -0
  377. package/dist/math/pattern/preset.mjs +294 -0
  378. package/dist/math/triangle-trig/index.d.mts +1 -0
  379. package/dist/math/triangle-trig/preset.d.mts +47 -0
  380. package/dist/math/triangle-trig/preset.mjs +245 -0
  381. package/dist/math/trig-explorer.d.mts +18 -0
  382. package/dist/math/trig-explorer.mjs +209 -0
  383. package/dist/ml/boundary/index.d.mts +1 -0
  384. package/dist/ml/boundary/preset.d.mts +24 -0
  385. package/dist/ml/boundary/preset.mjs +385 -0
  386. package/dist/ml/classifier/index.d.mts +1 -0
  387. package/dist/ml/classifier/preset.d.mts +25 -0
  388. package/dist/ml/classifier/preset.mjs +315 -0
  389. package/dist/ml/index.d.mts +6 -0
  390. package/dist/ml/index.mjs +7 -0
  391. package/dist/ml/kmeans/index.d.mts +1 -0
  392. package/dist/ml/kmeans/preset.d.mts +33 -0
  393. package/dist/ml/kmeans/preset.mjs +236 -0
  394. package/dist/ml/knn/index.d.mts +1 -0
  395. package/dist/ml/knn/preset.d.mts +28 -0
  396. package/dist/ml/knn/preset.mjs +279 -0
  397. package/dist/ml/regression/index.d.mts +1 -0
  398. package/dist/ml/regression/preset.d.mts +32 -0
  399. package/dist/ml/regression/preset.mjs +394 -0
  400. package/dist/physics/atwood/index.d.mts +1 -0
  401. package/dist/physics/atwood/preset.d.mts +23 -0
  402. package/dist/physics/atwood/preset.mjs +312 -0
  403. package/dist/physics/bullet-walls/index.d.mts +1 -0
  404. package/dist/physics/bullet-walls/preset.d.mts +28 -0
  405. package/dist/physics/bullet-walls/preset.mjs +373 -0
  406. package/dist/physics/carnot/index.d.mts +1 -0
  407. package/dist/physics/carnot/preset.d.mts +27 -0
  408. package/dist/physics/carnot/preset.mjs +427 -0
  409. package/dist/physics/circular-motion/index.d.mts +1 -0
  410. package/dist/physics/circular-motion/preset.d.mts +25 -0
  411. package/dist/physics/circular-motion/preset.mjs +293 -0
  412. package/dist/physics/collision-track/index.d.mts +1 -0
  413. package/dist/physics/collision-track/preset.d.mts +27 -0
  414. package/dist/physics/collision-track/preset.mjs +352 -0
  415. package/dist/physics/efficiency/index.d.mts +1 -0
  416. package/dist/physics/efficiency/preset.d.mts +33 -0
  417. package/dist/physics/efficiency/preset.mjs +343 -0
  418. package/dist/physics/electric-field/index.d.mts +1 -0
  419. package/dist/physics/electric-field/preset.d.mts +15 -0
  420. package/dist/physics/electric-field/preset.mjs +306 -0
  421. package/dist/physics/energy-skate/index.d.mts +1 -0
  422. package/dist/physics/energy-skate/preset.d.mts +25 -0
  423. package/dist/physics/energy-skate/preset.mjs +254 -0
  424. package/dist/physics/entropy/index.d.mts +1 -0
  425. package/dist/physics/entropy/preset.d.mts +18 -0
  426. package/dist/physics/entropy/preset.mjs +416 -0
  427. package/dist/physics/expansion/index.d.mts +1 -0
  428. package/dist/physics/expansion/preset.d.mts +26 -0
  429. package/dist/physics/expansion/preset.mjs +609 -0
  430. package/dist/physics/exponential/asset.mjs +221 -0
  431. package/dist/physics/exponential/index.d.mts +1 -0
  432. package/dist/physics/exponential/preset.d.mts +17 -0
  433. package/dist/physics/exponential/preset.mjs +182 -0
  434. package/dist/physics/gas-process/index.d.mts +1 -0
  435. package/dist/physics/gas-process/preset.d.mts +30 -0
  436. package/dist/physics/gas-process/preset.mjs +384 -0
  437. package/dist/physics/gravitation/index.d.mts +1 -0
  438. package/dist/physics/gravitation/preset.d.mts +24 -0
  439. package/dist/physics/gravitation/preset.mjs +345 -0
  440. package/dist/physics/gravity-drop.d.mts +9 -0
  441. package/dist/physics/gravity-drop.mjs +187 -0
  442. package/dist/physics/heat-transfer/index.d.mts +1 -0
  443. package/dist/physics/heat-transfer/preset.d.mts +27 -0
  444. package/dist/physics/heat-transfer/preset.mjs +626 -0
  445. package/dist/physics/impulse/index.d.mts +1 -0
  446. package/dist/physics/impulse/preset.d.mts +29 -0
  447. package/dist/physics/impulse/preset.mjs +453 -0
  448. package/dist/physics/index.d.mts +43 -0
  449. package/dist/physics/index.mjs +44 -0
  450. package/dist/physics/kepler/index.d.mts +1 -0
  451. package/dist/physics/kepler/preset.d.mts +27 -0
  452. package/dist/physics/kepler/preset.mjs +257 -0
  453. package/dist/physics/lever/asset.d.mts +6 -0
  454. package/dist/physics/lever/asset.mjs +220 -0
  455. package/dist/physics/lever/index.d.mts +2 -0
  456. package/dist/physics/lever/preset.d.mts +31 -0
  457. package/dist/physics/lever/preset.mjs +261 -0
  458. package/dist/physics/lorentz/index.d.mts +1 -0
  459. package/dist/physics/lorentz/preset.d.mts +29 -0
  460. package/dist/physics/lorentz/preset.mjs +367 -0
  461. package/dist/physics/magnetism/index.d.mts +1 -0
  462. package/dist/physics/magnetism/preset.d.mts +15 -0
  463. package/dist/physics/magnetism/preset.mjs +334 -0
  464. package/dist/physics/optics/asset.d.mts +6 -0
  465. package/dist/physics/optics/asset.mjs +234 -0
  466. package/dist/physics/optics/index.d.mts +2 -0
  467. package/dist/physics/optics/preset.d.mts +14 -0
  468. package/dist/physics/optics/preset.mjs +202 -0
  469. package/dist/physics/orbit-lab.d.mts +6 -0
  470. package/dist/physics/orbit-lab.mjs +222 -0
  471. package/dist/physics/projectile-lab.d.mts +10 -0
  472. package/dist/physics/projectile-lab.mjs +354 -0
  473. package/dist/physics/rain-relative/index.d.mts +1 -0
  474. package/dist/physics/rain-relative/preset.d.mts +19 -0
  475. package/dist/physics/rain-relative/preset.mjs +358 -0
  476. package/dist/physics/ramp-forces/index.d.mts +1 -0
  477. package/dist/physics/ramp-forces/preset.d.mts +36 -0
  478. package/dist/physics/ramp-forces/preset.mjs +550 -0
  479. package/dist/physics/river-boat.d.mts +22 -0
  480. package/dist/physics/river-boat.mjs +498 -0
  481. package/dist/physics/shm/index.d.mts +1 -0
  482. package/dist/physics/shm/preset.d.mts +33 -0
  483. package/dist/physics/shm/preset.mjs +554 -0
  484. package/dist/physics/stopping-distance/index.d.mts +1 -0
  485. package/dist/physics/stopping-distance/preset.d.mts +29 -0
  486. package/dist/physics/stopping-distance/preset.mjs +662 -0
  487. package/dist/physics/temperature-scales/index.d.mts +1 -0
  488. package/dist/physics/temperature-scales/preset.d.mts +15 -0
  489. package/dist/physics/temperature-scales/preset.mjs +353 -0
  490. package/dist/physics/terminal-velocity/index.d.mts +1 -0
  491. package/dist/physics/terminal-velocity/preset.d.mts +26 -0
  492. package/dist/physics/terminal-velocity/preset.mjs +404 -0
  493. package/dist/physics/thermal/index.d.mts +1 -0
  494. package/dist/physics/thermal/preset.d.mts +44 -0
  495. package/dist/physics/thermal/preset.mjs +373 -0
  496. package/dist/physics/vector-board/index.d.mts +1 -0
  497. package/dist/physics/vector-board/preset.d.mts +65 -0
  498. package/dist/physics/vector-board/preset.mjs +273 -0
  499. package/dist/physics/vector-board/view.d.mts +49 -0
  500. package/dist/physics/vector-board/view.mjs +58 -0
  501. package/dist/physics/vector-scene.d.mts +41 -0
  502. package/dist/physics/vector-scene.mjs +211 -0
  503. package/dist/physics/vector-types/index.d.mts +1 -0
  504. package/dist/physics/vector-types/preset.d.mts +27 -0
  505. package/dist/physics/vector-types/preset.mjs +192 -0
  506. package/dist/physics/water-density/index.d.mts +1 -0
  507. package/dist/physics/water-density/preset.d.mts +18 -0
  508. package/dist/physics/water-density/preset.mjs +439 -0
  509. package/dist/physics/waves/core.mjs +33 -0
  510. package/dist/physics/waves/doppler.d.mts +23 -0
  511. package/dist/physics/waves/doppler.mjs +260 -0
  512. package/dist/physics/waves/index.d.mts +4 -0
  513. package/dist/physics/waves/preset.d.mts +30 -0
  514. package/dist/physics/waves/preset.mjs +488 -0
  515. package/dist/physics/waves/ripple.d.mts +26 -0
  516. package/dist/physics/waves/ripple.mjs +234 -0
  517. package/dist/physics/waves/string.d.mts +29 -0
  518. package/dist/physics/waves/string.mjs +289 -0
  519. package/dist/physics/work-energy/index.d.mts +1 -0
  520. package/dist/physics/work-energy/preset.d.mts +17 -0
  521. package/dist/physics/work-energy/preset.mjs +341 -0
  522. package/dist/schemas/index.d.mts +235 -0
  523. package/dist/schemas/index.mjs +145 -0
  524. package/dist/statistics/center-spread/preset.d.mts +34 -0
  525. package/dist/statistics/center-spread/preset.mjs +323 -0
  526. package/dist/statistics/core/descriptive.d.mts +35 -0
  527. package/dist/statistics/core/descriptive.mjs +64 -0
  528. package/dist/statistics/core/normal.d.mts +21 -0
  529. package/dist/statistics/core/normal.mjs +37 -0
  530. package/dist/statistics/core/sequences.d.mts +27 -0
  531. package/dist/statistics/core/sequences.mjs +35 -0
  532. package/dist/statistics/galton/preset.d.mts +27 -0
  533. package/dist/statistics/galton/preset.mjs +331 -0
  534. package/dist/statistics/histogram/preset.d.mts +27 -0
  535. package/dist/statistics/histogram/preset.mjs +385 -0
  536. package/dist/statistics/index.d.mts +11 -0
  537. package/dist/statistics/index.mjs +12 -0
  538. package/dist/statistics/normal/preset.d.mts +30 -0
  539. package/dist/statistics/normal/preset.mjs +400 -0
  540. package/dist/statistics/sampling/preset.d.mts +32 -0
  541. package/dist/statistics/sampling/preset.mjs +406 -0
  542. package/dist/statistics/sequence/preset.d.mts +28 -0
  543. package/dist/statistics/sequence/preset.mjs +302 -0
  544. package/dist/statistics/z-table/preset.d.mts +28 -0
  545. package/dist/statistics/z-table/preset.mjs +348 -0
  546. package/package.json +266 -0
  547. package/styles.css +267 -0
@@ -0,0 +1,254 @@
1
+ 'use client';
2
+
3
+ import { clamp } from "../../core/util.mjs";
4
+ import { CheckButton, Chip, Slider } from "../../kit/controls.mjs";
5
+ import { Callout, Control, ControlBar, Field, LabFrame, LiveRegion, MeterBar } from "../../kit/frame.mjs";
6
+ import { useFrameTick, useReducedMotion } from "../../kit/anim.mjs";
7
+ import { useRef, useState } from "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { Label, Polyline, Segment, Stage, useInView } from "@classytic/stage";
10
+
11
+ //#region src/physics/energy-skate/preset.tsx
12
+ /**
13
+ * EnergySkateLab — "Where did the energy go?", KE ⇄ PE on a ramp, with friction
14
+ * bleeding the total into heat.
15
+ *
16
+ * A skater is released from a height on a parabolic ramp. Three stacked bars —
17
+ * potential, kinetic, and thermal — ALWAYS sum to the same total: as the skater
18
+ * drops, the PE bar empties into the KE bar and back on the way up. Turn friction
19
+ * on and a THERMAL bar grows each pass, so the skater can never climb as high
20
+ * again — mechanical energy isn't destroyed, it's moved to heat. (The "LOL" energy
21
+ * bar chart, animated.)
22
+ *
23
+ * This complements WorkEnergyLab (work = area under F–x): here the spotlight is
24
+ * CONVERSION and conservation, not the definition of work.
25
+ *
26
+ * Tokenized SVG; energy-method integrator here; honours reduced-motion.
27
+ */
28
+ const G = 9.8;
29
+ const X = 6;
30
+ const H = 5;
31
+ const MU = .08;
32
+ const yAt = (x) => H * (x / X) * (x / X);
33
+ function EnergySkateLab({ startHeight = 4, friction = false, mass = 1, title = "Where did the energy go? — KE ⇄ PE (and heat)", prompt = "Release the skater and watch potential energy pour into kinetic and back. The three bars always add to the same total — unless friction is on, then a heat bar grows and the skater can’t climb as high again.", objectives, controlConfig }) {
34
+ const [h0, setH0] = useState(clamp(startHeight, 1, H));
35
+ const [fric, setFric] = useState(friction);
36
+ const [m] = useState(mass);
37
+ const [running, setRunning] = useState(false);
38
+ const x0 = -6 * Math.sqrt(h0 / H);
39
+ const E0 = m * G * h0;
40
+ const xRef = useRef(x0);
41
+ const dirRef = useRef(1);
42
+ const qRef = useRef(0);
43
+ const reduce = useReducedMotion();
44
+ const { ref: viewRef, inView } = useInView();
45
+ const SCALE = .5;
46
+ const repaint = useFrameTick(running && inView, (f) => {
47
+ const dt = Math.min(.03, f.dtMs / 1e3);
48
+ let x = xRef.current;
49
+ const y = yAt(x);
50
+ let ke = E0 - m * G * y - qRef.current;
51
+ if (fric && E0 - qRef.current <= m * G * .03) {
52
+ xRef.current = 0;
53
+ setRunning(false);
54
+ return;
55
+ }
56
+ if (ke <= 0) {
57
+ dirRef.current = -dirRef.current;
58
+ ke = 0;
59
+ }
60
+ const v = Math.sqrt(Math.max(0, 2 * ke / m));
61
+ const dx = dirRef.current * v * SCALE * dt;
62
+ x = clamp(x + dx, -6, X);
63
+ if (Math.abs(x) >= X) dirRef.current = -dirRef.current;
64
+ if (fric) qRef.current = Math.min(E0, qRef.current + MU * m * G * Math.abs(dx));
65
+ xRef.current = x;
66
+ });
67
+ const release = () => {
68
+ xRef.current = x0;
69
+ dirRef.current = 1;
70
+ qRef.current = 0;
71
+ if (reduce) {
72
+ xRef.current = 0;
73
+ repaint();
74
+ return;
75
+ }
76
+ setRunning(true);
77
+ };
78
+ const onH0 = (n) => {
79
+ setH0(clamp(n, 1, H));
80
+ setRunning(false);
81
+ xRef.current = -6 * Math.sqrt(clamp(n, 1, H) / H);
82
+ dirRef.current = 1;
83
+ qRef.current = 0;
84
+ };
85
+ const x = xRef.current;
86
+ const y = yAt(x);
87
+ const pe = m * G * y;
88
+ const ke = Math.max(0, E0 - pe - qRef.current);
89
+ const q = qRef.current;
90
+ const track = [];
91
+ for (let i = -6; i <= 6.000000001; i += .25) track.push({
92
+ x: i,
93
+ y: yAt(i)
94
+ });
95
+ const view = {
96
+ xMin: -7,
97
+ xMax: 7,
98
+ yMin: -1,
99
+ yMax: 6
100
+ };
101
+ const figure = /* @__PURE__ */ jsx("div", {
102
+ ref: viewRef,
103
+ className: "lab-playwrap",
104
+ children: /* @__PURE__ */ jsxs(Stage, {
105
+ view,
106
+ height: 240,
107
+ preserveAspect: false,
108
+ ariaLabel: `Skater on a ramp released from ${h0.toFixed(1)} m${fric ? ", with friction" : ""}`,
109
+ children: [
110
+ /* @__PURE__ */ jsx(Segment, {
111
+ from: {
112
+ x: view.xMin,
113
+ y: 0
114
+ },
115
+ to: {
116
+ x: view.xMax,
117
+ y: 0
118
+ },
119
+ color: "var(--stage-fg)",
120
+ opacity: .3,
121
+ weight: 1
122
+ }),
123
+ /* @__PURE__ */ jsx(Segment, {
124
+ from: {
125
+ x: view.xMin,
126
+ y: h0
127
+ },
128
+ to: {
129
+ x: view.xMax,
130
+ y: h0
131
+ },
132
+ color: "var(--stage-muted)",
133
+ opacity: .5,
134
+ weight: 1,
135
+ dashed: true
136
+ }),
137
+ /* @__PURE__ */ jsx(Label, {
138
+ x: view.xMin,
139
+ y: h0,
140
+ text: `release ${h0.toFixed(1)} m`,
141
+ color: "var(--stage-muted)",
142
+ size: 10,
143
+ anchor: "start",
144
+ dy: -3
145
+ }),
146
+ /* @__PURE__ */ jsx(Polyline, {
147
+ points: track,
148
+ color: "var(--stage-fg)",
149
+ weight: 2.5
150
+ }),
151
+ /* @__PURE__ */ jsx(Label, {
152
+ x,
153
+ y: y + .4,
154
+ text: "🛹",
155
+ color: "var(--stage-fg)",
156
+ size: 30
157
+ })
158
+ ]
159
+ })
160
+ });
161
+ const ebar = E0 > 0 ? 1 / E0 : 0;
162
+ return /* @__PURE__ */ jsx(LabFrame, {
163
+ title,
164
+ prompt,
165
+ objectives,
166
+ aside: /* @__PURE__ */ jsxs("div", {
167
+ style: {
168
+ display: "flex",
169
+ flexDirection: "column",
170
+ gap: 8
171
+ },
172
+ children: [
173
+ /* @__PURE__ */ jsx(MeterBar, {
174
+ label: "potential PE = mgh",
175
+ frac: pe * ebar,
176
+ color: "var(--stage-accent-2)",
177
+ value: `${pe.toFixed(1)} J`
178
+ }),
179
+ /* @__PURE__ */ jsx(MeterBar, {
180
+ label: "kinetic KE = ½mv²",
181
+ frac: ke * ebar,
182
+ color: "var(--stage-good)",
183
+ value: `${ke.toFixed(1)} J`
184
+ }),
185
+ fric && /* @__PURE__ */ jsx(MeterBar, {
186
+ label: "thermal (friction) 🔥",
187
+ frac: q * ebar,
188
+ color: "var(--stage-warn)",
189
+ value: `${q.toFixed(1)} J`
190
+ }),
191
+ /* @__PURE__ */ jsx(Callout, {
192
+ tone: "result",
193
+ children: /* @__PURE__ */ jsxs("span", {
194
+ style: { fontVariantNumeric: "tabular-nums" },
195
+ children: [
196
+ "PE + KE",
197
+ fric ? " + heat" : "",
198
+ " = ",
199
+ /* @__PURE__ */ jsxs("strong", { children: [(pe + ke + (fric ? q : 0)).toFixed(1), " J"] }),
200
+ " ",
201
+ "= constant total ",
202
+ E0.toFixed(1),
203
+ " J"
204
+ ]
205
+ })
206
+ }),
207
+ /* @__PURE__ */ jsx("p", {
208
+ style: {
209
+ fontSize: 12,
210
+ opacity: .75,
211
+ margin: 0
212
+ },
213
+ children: "Friction off → the skater returns to the same height forever (mechanical energy conserved). Friction on → the heat bar climbs and every peak is lower: energy moved, not lost."
214
+ }),
215
+ /* @__PURE__ */ jsx(LiveRegion, { children: `Potential ${pe.toFixed(1)}, kinetic ${ke.toFixed(1)}${fric ? `, heat ${q.toFixed(1)}` : ""} joules; total ${E0.toFixed(1)}.` })
216
+ ]
217
+ }),
218
+ controls: /* @__PURE__ */ jsxs(ControlBar, { children: [
219
+ /* @__PURE__ */ jsx(CheckButton, {
220
+ onClick: release,
221
+ children: "▶ Release"
222
+ }),
223
+ /* @__PURE__ */ jsx(Control, {
224
+ name: "friction",
225
+ children: /* @__PURE__ */ jsxs(Chip, {
226
+ selected: fric,
227
+ onClick: () => {
228
+ setFric((c) => !c);
229
+ setRunning(false);
230
+ qRef.current = 0;
231
+ },
232
+ children: ["friction ", fric ? "on 🔥" : "off"]
233
+ })
234
+ }),
235
+ /* @__PURE__ */ jsx(Field, {
236
+ label: "start height",
237
+ value: `${h0.toFixed(1)} m`,
238
+ children: /* @__PURE__ */ jsx(Slider, {
239
+ value: h0,
240
+ min: 1,
241
+ max: H,
242
+ step: .5,
243
+ onChange: onH0,
244
+ ariaLabel: "release height (m)"
245
+ })
246
+ })
247
+ ] }),
248
+ controlConfig,
249
+ children: figure
250
+ });
251
+ }
252
+
253
+ //#endregion
254
+ export { EnergySkateLab };
@@ -0,0 +1 @@
1
+ import { EntropyLab, EntropyProps } from "./preset.mjs";
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from "react";
2
+
3
+ //#region src/physics/entropy/preset.d.ts
4
+ type Mode = 'heat' | 'expansion';
5
+ interface EntropyProps {
6
+ mode?: Mode;
7
+ title?: string;
8
+ prompt?: string;
9
+ objectives?: string[];
10
+ }
11
+ declare function EntropyLab({
12
+ mode: mode0,
13
+ title,
14
+ prompt,
15
+ objectives
16
+ }?: EntropyProps): ReactNode;
17
+ //#endregion
18
+ export { EntropyLab, EntropyProps };
@@ -0,0 +1,416 @@
1
+ 'use client';
2
+
3
+ import { Tex } from "../../core/tex.mjs";
4
+ import { Chip, Slider } from "../../kit/controls.mjs";
5
+ import { Callout, ControlBar, Field, LabFrame } from "../../kit/frame.mjs";
6
+ import { thermalColor } from "../../kit/thermal.mjs";
7
+ import { useState } from "react";
8
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
+
10
+ //#region src/physics/entropy/preset.tsx
11
+ /**
12
+ * EntropyLab — why heat only flows one way, and why a gas always spreads out.
13
+ * Entropy is the bookkeeping behind the second law: in any real (spontaneous)
14
+ * process the TOTAL entropy of the universe increases.
15
+ *
16
+ * • HEAT FLOW — move a chunk of heat Q from a hot body (Th) to a cold one (Tc).
17
+ * The hot body loses ΔS = −Q/Th; the cold body gains ΔS = +Q/Tc. Because
18
+ * Tc < Th, the gain outweighs the loss, so ΔS_total = Q(1/Tc − 1/Th) > 0 —
19
+ * hot→cold is spontaneous. Running it backwards would DECREASE total entropy,
20
+ * which never happens by itself. (Equal temperatures ⇒ ΔS_total = 0, reversible.)
21
+ * • FREE EXPANSION — let a gas spread into a vacuum. No heat, no work, but the gas
22
+ * can never un-mix: ΔS = nR·ln(Vf/Vi) > 0. Spreading out is simply overwhelmingly
23
+ * more likely than staying bunched up (more microstates).
24
+ *
25
+ * Interactive (recomputes on the sliders), no simulation loop. Pure SVG, themed.
26
+ */
27
+ const R = 8.314462618;
28
+ const W = 640, H = 340;
29
+ function EntropyLab({ mode: mode0 = "heat", title = "Entropy & the second law — the one-way arrow", prompt = "Real processes always increase the total entropy of the universe. See why heat flows hot→cold and why a gas spreads out — and never reverses on its own.", objectives = [
30
+ "Compute entropy change as ΔS = Q/T for heat moved at temperature T",
31
+ "See ΔS_total > 0 for spontaneous heat flow (and = 0 only when Th = Tc)",
32
+ "Explain free expansion: ΔS = nR·ln(Vf/Vi) > 0, gas never un-mixes"
33
+ ] } = {}) {
34
+ const [mode, setMode] = useState(mode0);
35
+ const [Th, setTh] = useState(500);
36
+ const [Tc, setTc] = useState(300);
37
+ const [Q, setQ] = useState(1e3);
38
+ const [m, setM] = useState(1);
39
+ let figure;
40
+ let aside;
41
+ if (mode === "heat") {
42
+ const tc = Math.min(Tc, Th);
43
+ const dSh = -Q / Th, dSc = Q / tc, dST = dSh + dSc;
44
+ const scale = 70 / Math.max(2, Math.abs(dSc));
45
+ const bar = (x, label, val, color) => {
46
+ const baseY = 250, hpx = val * scale;
47
+ return /* @__PURE__ */ jsxs("g", { children: [
48
+ /* @__PURE__ */ jsx("rect", {
49
+ x: x - 26,
50
+ y: hpx >= 0 ? baseY - hpx : baseY,
51
+ width: 52,
52
+ height: Math.abs(hpx),
53
+ rx: 3,
54
+ fill: color,
55
+ opacity: .85
56
+ }),
57
+ /* @__PURE__ */ jsx("text", {
58
+ x,
59
+ y: 270,
60
+ textAnchor: "middle",
61
+ fontSize: 11,
62
+ fill: "var(--stage-fg)",
63
+ children: label
64
+ }),
65
+ /* @__PURE__ */ jsxs("text", {
66
+ x,
67
+ y: hpx >= 0 ? baseY - hpx - 6 : baseY + Math.abs(hpx) + 14,
68
+ textAnchor: "middle",
69
+ fontSize: 11,
70
+ fontWeight: 700,
71
+ fill: color,
72
+ style: { fontVariantNumeric: "tabular-nums" },
73
+ children: [val >= 0 ? "+" : "−", Math.abs(val).toFixed(2)]
74
+ })
75
+ ] });
76
+ };
77
+ figure = /* @__PURE__ */ jsx("div", {
78
+ style: fwrap,
79
+ children: /* @__PURE__ */ jsxs("svg", {
80
+ viewBox: `0 0 ${W} ${H}`,
81
+ width: "100%",
82
+ role: "img",
83
+ "aria-label": `Heat flow, total entropy change ${dST.toFixed(2)} joules per kelvin`,
84
+ children: [
85
+ /* @__PURE__ */ jsx("rect", {
86
+ x: 40,
87
+ y: 130,
88
+ width: 120,
89
+ height: 90,
90
+ rx: 10,
91
+ fill: thermalColor(.95),
92
+ opacity: .85
93
+ }),
94
+ /* @__PURE__ */ jsx("text", {
95
+ x: 100,
96
+ y: 180,
97
+ textAnchor: "middle",
98
+ fontSize: 13,
99
+ fontWeight: 800,
100
+ fill: "var(--stage-bg)",
101
+ children: "HOT"
102
+ }),
103
+ /* @__PURE__ */ jsxs("text", {
104
+ x: 100,
105
+ y: 200,
106
+ textAnchor: "middle",
107
+ fontSize: 12,
108
+ fill: "var(--stage-bg)",
109
+ children: [Th, " K"]
110
+ }),
111
+ /* @__PURE__ */ jsx("rect", {
112
+ x: 250,
113
+ y: 130,
114
+ width: 120,
115
+ height: 90,
116
+ rx: 10,
117
+ fill: thermalColor(.12),
118
+ opacity: .85
119
+ }),
120
+ /* @__PURE__ */ jsx("text", {
121
+ x: 310,
122
+ y: 180,
123
+ textAnchor: "middle",
124
+ fontSize: 13,
125
+ fontWeight: 800,
126
+ fill: "var(--stage-bg)",
127
+ children: "COLD"
128
+ }),
129
+ /* @__PURE__ */ jsxs("text", {
130
+ x: 310,
131
+ y: 200,
132
+ textAnchor: "middle",
133
+ fontSize: 12,
134
+ fill: "var(--stage-bg)",
135
+ children: [tc, " K"]
136
+ }),
137
+ /* @__PURE__ */ jsx("line", {
138
+ x1: 165,
139
+ y1: 175,
140
+ x2: 245,
141
+ y2: 175,
142
+ stroke: "var(--stage-warn)",
143
+ strokeWidth: 3
144
+ }),
145
+ /* @__PURE__ */ jsx("polygon", {
146
+ points: "245,175 235,169 235,181",
147
+ fill: "var(--stage-warn)"
148
+ }),
149
+ /* @__PURE__ */ jsxs("text", {
150
+ x: 205,
151
+ y: 164,
152
+ textAnchor: "middle",
153
+ fontSize: 11,
154
+ fontWeight: 700,
155
+ fill: "var(--stage-warn)",
156
+ children: [
157
+ "Q = ",
158
+ Q,
159
+ " J"
160
+ ]
161
+ }),
162
+ /* @__PURE__ */ jsx("line", {
163
+ x1: 420,
164
+ y1: 250,
165
+ x2: 620,
166
+ y2: 250,
167
+ stroke: "var(--stage-grid)",
168
+ strokeWidth: 1
169
+ }),
170
+ /* @__PURE__ */ jsx("text", {
171
+ x: 520,
172
+ y: 56,
173
+ textAnchor: "middle",
174
+ fontSize: 11,
175
+ fill: "var(--stage-muted)",
176
+ children: "entropy change (J/K)"
177
+ }),
178
+ bar(450, "hot", dSh, "var(--stage-danger, #e03131)"),
179
+ bar(520, "cold", dSc, "var(--stage-accent, #3b82f6)"),
180
+ bar(590, "total", dST, "var(--stage-good, #16a34a)")
181
+ ]
182
+ })
183
+ });
184
+ aside = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Callout, {
185
+ tone: dST >= 0 ? "result" : "info",
186
+ children: /* @__PURE__ */ jsxs("span", {
187
+ style: {
188
+ display: "grid",
189
+ gap: 2,
190
+ fontVariantNumeric: "tabular-nums"
191
+ },
192
+ children: [/* @__PURE__ */ jsxs("span", {
193
+ style: {
194
+ fontWeight: 800,
195
+ fontSize: 16
196
+ },
197
+ children: [
198
+ "ΔS_total = ",
199
+ dST >= 0 ? "+" : "−",
200
+ Math.abs(dST).toFixed(2),
201
+ " J/K"
202
+ ]
203
+ }), /* @__PURE__ */ jsx("span", {
204
+ style: { fontSize: 13 },
205
+ children: dST > .001 ? "spontaneous ✓" : "reversible limit (Th = Tc)"
206
+ })]
207
+ })
208
+ }), /* @__PURE__ */ jsxs("div", {
209
+ style: {
210
+ display: "grid",
211
+ gap: 8,
212
+ padding: "8px 2px 0",
213
+ fontSize: 13
214
+ },
215
+ children: [/* @__PURE__ */ jsx(Tex, {
216
+ tex: "\\Delta S_{tot} = \\dfrac{Q}{T_c} - \\dfrac{Q}{T_h} > 0",
217
+ block: true
218
+ }), /* @__PURE__ */ jsxs("span", {
219
+ style: { color: "var(--stage-muted)" },
220
+ children: [
221
+ "The cold body gains ",
222
+ /* @__PURE__ */ jsx("strong", {
223
+ style: { color: "var(--stage-fg)" },
224
+ children: "more"
225
+ }),
226
+ " entropy than the hot body loses (same Q, smaller T). So heat flows hot→cold by itself; the reverse would lower total entropy — forbidden by the 2nd law."
227
+ ]
228
+ })]
229
+ })] });
230
+ } else {
231
+ const n = 1, ratio = 1 + m, dS = n * R * Math.log(ratio);
232
+ const bx = 60, by = 70, bw = 360, bh = 200;
233
+ const wallX = 240;
234
+ const accRight = bx + bw * (.5 + .5 * m);
235
+ const parts = Array.from({ length: 44 }, (_, i) => {
236
+ const hx = i * .6180339 % 1, hy = (i * .7548 + .13) % 1;
237
+ return /* @__PURE__ */ jsx("circle", {
238
+ cx: 68 + hx * (accRight - bx - 16),
239
+ cy: 80 + hy * (bh - 20),
240
+ r: 3.2,
241
+ fill: thermalColor(.5),
242
+ opacity: .9
243
+ }, i);
244
+ });
245
+ figure = /* @__PURE__ */ jsx("div", {
246
+ style: fwrap,
247
+ children: /* @__PURE__ */ jsxs("svg", {
248
+ viewBox: `0 0 ${W} ${H}`,
249
+ width: "100%",
250
+ role: "img",
251
+ "aria-label": `Free expansion, entropy increase ${dS.toFixed(2)} joules per kelvin`,
252
+ children: [
253
+ /* @__PURE__ */ jsx("rect", {
254
+ x: bx,
255
+ y: by,
256
+ width: bw,
257
+ height: bh,
258
+ rx: 6,
259
+ fill: "color-mix(in oklab, var(--stage-accent) 8%, transparent)",
260
+ stroke: "var(--stage-metal)",
261
+ strokeWidth: 3
262
+ }),
263
+ m < .98 && /* @__PURE__ */ jsx("text", {
264
+ x: (accRight + bx + bw) / 2,
265
+ y: 170,
266
+ textAnchor: "middle",
267
+ fontSize: 12,
268
+ fill: "var(--stage-muted)",
269
+ children: "vacuum"
270
+ }),
271
+ parts,
272
+ /* @__PURE__ */ jsx("line", {
273
+ x1: wallX,
274
+ y1: by,
275
+ x2: wallX,
276
+ y2: 270,
277
+ stroke: "var(--stage-warn)",
278
+ strokeWidth: 4,
279
+ strokeDasharray: "6 5",
280
+ opacity: 1 - m
281
+ }),
282
+ /* @__PURE__ */ jsx("text", {
283
+ x: 240,
284
+ y: 292,
285
+ textAnchor: "middle",
286
+ fontSize: 11,
287
+ fill: "var(--stage-muted)",
288
+ children: m < .02 ? "gas confined to the left half" : m > .98 ? "gas fills the whole box" : "spreading…"
289
+ })
290
+ ]
291
+ })
292
+ });
293
+ aside = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Callout, {
294
+ tone: "result",
295
+ children: /* @__PURE__ */ jsxs("span", {
296
+ style: {
297
+ fontWeight: 800,
298
+ fontSize: 16,
299
+ fontVariantNumeric: "tabular-nums"
300
+ },
301
+ children: [
302
+ "ΔS = +",
303
+ dS.toFixed(2),
304
+ " J/K"
305
+ ]
306
+ })
307
+ }), /* @__PURE__ */ jsxs("div", {
308
+ style: {
309
+ display: "grid",
310
+ gap: 8,
311
+ padding: "8px 2px 0",
312
+ fontSize: 13
313
+ },
314
+ children: [/* @__PURE__ */ jsx(Tex, {
315
+ tex: "\\Delta S = nR\\,\\ln\\!\\dfrac{V_f}{V_i}",
316
+ block: true
317
+ }), /* @__PURE__ */ jsxs("span", {
318
+ style: { color: "var(--stage-muted)" },
319
+ children: [
320
+ "No heat, no work — yet entropy still rises, because the gas now has far more ways to arrange itself. Fully open (Vf = 2Vi) gives ",
321
+ /* @__PURE__ */ jsx("strong", {
322
+ style: { color: "var(--stage-fg)" },
323
+ children: "nR·ln 2 ≈ 5.76 J/K"
324
+ }),
325
+ ". You’ll never see it pile back into one half on its own."
326
+ ]
327
+ })]
328
+ })] });
329
+ }
330
+ const controls = /* @__PURE__ */ jsxs("div", {
331
+ style: {
332
+ display: "grid",
333
+ gap: 10
334
+ },
335
+ children: [/* @__PURE__ */ jsx(ControlBar, { children: /* @__PURE__ */ jsx(Field, {
336
+ label: "process",
337
+ children: /* @__PURE__ */ jsxs("span", {
338
+ className: "lab-field-row",
339
+ children: [/* @__PURE__ */ jsx(Chip, {
340
+ selected: mode === "heat",
341
+ onClick: () => setMode("heat"),
342
+ children: "heat flows hot→cold"
343
+ }), /* @__PURE__ */ jsx(Chip, {
344
+ selected: mode === "expansion",
345
+ onClick: () => setMode("expansion"),
346
+ children: "free expansion (spreading)"
347
+ })]
348
+ })
349
+ }) }), mode === "heat" ? /* @__PURE__ */ jsxs(ControlBar, { children: [
350
+ /* @__PURE__ */ jsx(Field, {
351
+ label: "hot Th",
352
+ value: `${Th} K`,
353
+ children: /* @__PURE__ */ jsx(Slider, {
354
+ value: Th,
355
+ min: 310,
356
+ max: 800,
357
+ step: 10,
358
+ onChange: setTh,
359
+ ariaLabel: "hot temperature"
360
+ })
361
+ }),
362
+ /* @__PURE__ */ jsx(Field, {
363
+ label: "cold Tc",
364
+ value: `${Math.min(Tc, Th)} K`,
365
+ children: /* @__PURE__ */ jsx(Slider, {
366
+ value: Tc,
367
+ min: 250,
368
+ max: 800,
369
+ step: 10,
370
+ onChange: setTc,
371
+ ariaLabel: "cold temperature"
372
+ })
373
+ }),
374
+ /* @__PURE__ */ jsx(Field, {
375
+ label: "heat Q",
376
+ value: `${Q} J`,
377
+ children: /* @__PURE__ */ jsx(Slider, {
378
+ value: Q,
379
+ min: 200,
380
+ max: 3e3,
381
+ step: 100,
382
+ onChange: setQ,
383
+ ariaLabel: "heat transferred"
384
+ })
385
+ })
386
+ ] }) : /* @__PURE__ */ jsx(ControlBar, { children: /* @__PURE__ */ jsx(Field, {
387
+ label: "open the partition",
388
+ value: `${Math.round(m * 100)}%`,
389
+ children: /* @__PURE__ */ jsx(Slider, {
390
+ value: m,
391
+ min: 0,
392
+ max: 1,
393
+ step: .05,
394
+ onChange: setM,
395
+ ariaLabel: "partition openness"
396
+ })
397
+ }) })]
398
+ });
399
+ return /* @__PURE__ */ jsx(LabFrame, {
400
+ title,
401
+ prompt,
402
+ objectives,
403
+ aside,
404
+ controls,
405
+ children: figure
406
+ });
407
+ }
408
+ const fwrap = {
409
+ borderRadius: 14,
410
+ overflow: "hidden",
411
+ background: "var(--stage-bg)",
412
+ border: "1px solid var(--stage-grid)"
413
+ };
414
+
415
+ //#endregion
416
+ export { EntropyLab };
@@ -0,0 +1 @@
1
+ import { ThermalExpansionLab, ThermalExpansionProps } from "./preset.mjs";