@classytic/labs 0.1.0 → 0.2.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 (455) hide show
  1. package/dist/_virtual/_rolldown/runtime.mjs +18 -0
  2. package/dist/biology/enzyme-rate/preset.mjs +5 -5
  3. package/dist/biology/genetic-cross/core.d.mts +7 -7
  4. package/dist/biology/genetic-cross/core.mjs +4 -4
  5. package/dist/biology/genetic-cross/grid.mjs +132 -123
  6. package/dist/biology/genetic-cross/preset.mjs +4 -4
  7. package/dist/biology/genetic-cross/sex-linked.mjs +7 -7
  8. package/dist/biology/photosynthesis-factors/preset.mjs +8 -8
  9. package/dist/biology/respiration/preset.mjs +4 -4
  10. package/dist/biology/sequence/central-dogma.mjs +5 -5
  11. package/dist/biology/sequence/core.d.mts +6 -6
  12. package/dist/biology/sequence/core.mjs +1 -1
  13. package/dist/biology/sequence/preset.mjs +6 -6
  14. package/dist/blocks/authoring.mjs +5 -5
  15. package/dist/blocks/biology.d.mts +2 -2
  16. package/dist/blocks/biology.mjs +5 -5
  17. package/dist/blocks/chem.d.mts +2 -2
  18. package/dist/blocks/chem.mjs +13 -13
  19. package/dist/blocks/circuits.d.mts +293 -4
  20. package/dist/blocks/circuits.mjs +874 -9
  21. package/dist/blocks/discrete.d.mts +30 -2
  22. package/dist/blocks/discrete.mjs +74 -4
  23. package/dist/blocks/economics.mjs +1 -1
  24. package/dist/blocks/geography.mjs +1 -1
  25. package/dist/blocks/geometry.mjs +3 -3
  26. package/dist/blocks/ict.d.mts +90 -1
  27. package/dist/blocks/ict.mjs +217 -7
  28. package/dist/blocks/index.d.mts +3064 -657
  29. package/dist/blocks/index.mjs +9 -9
  30. package/dist/blocks/lab-block.mjs +5 -5
  31. package/dist/blocks/lab-config.d.mts +1 -1
  32. package/dist/blocks/lab-config.mjs +4 -4
  33. package/dist/blocks/lab-gallery.d.mts +1 -1
  34. package/dist/blocks/lab-gallery.mjs +2 -2
  35. package/dist/blocks/language.d.mts +6 -6
  36. package/dist/blocks/language.mjs +12 -12
  37. package/dist/blocks/lesson.mjs +4 -4
  38. package/dist/blocks/math.d.mts +577 -11
  39. package/dist/blocks/math.mjs +1648 -14
  40. package/dist/blocks/ml.d.mts +45 -1
  41. package/dist/blocks/ml.mjs +80 -6
  42. package/dist/blocks/physics.d.mts +9 -4
  43. package/dist/blocks/physics.mjs +75 -28
  44. package/dist/blocks/statistics.mjs +1 -1
  45. package/dist/build/CircuitEditor.d.mts +14 -0
  46. package/dist/build/CircuitEditor.mjs +787 -0
  47. package/dist/build/CircuitPlayer.d.mts +19 -0
  48. package/dist/build/CircuitPlayer.mjs +53 -0
  49. package/dist/build/CircuitScene.d.mts +61 -0
  50. package/dist/build/CircuitScene.mjs +383 -0
  51. package/dist/build/contract.d.mts +116 -0
  52. package/dist/build/editor-ops.d.mts +65 -0
  53. package/dist/build/editor-ops.mjs +306 -0
  54. package/dist/build/editor-ui.mjs +121 -0
  55. package/dist/build/flow.d.mts +14 -0
  56. package/dist/build/flow.mjs +119 -0
  57. package/dist/build/index.d.mts +10 -0
  58. package/dist/build/index.mjs +10 -0
  59. package/dist/build/parts/ammeter.d.mts +1 -0
  60. package/dist/build/parts/ammeter.mjs +32 -0
  61. package/dist/build/parts/bulb.d.mts +1 -0
  62. package/dist/build/parts/bulb.mjs +50 -0
  63. package/dist/build/parts/capacitor.d.mts +1 -0
  64. package/dist/build/parts/capacitor.mjs +26 -0
  65. package/dist/build/parts/cell.d.mts +1 -0
  66. package/dist/build/parts/cell.mjs +40 -0
  67. package/dist/build/parts/diode.d.mts +1 -0
  68. package/dist/build/parts/diode.mjs +33 -0
  69. package/dist/build/parts/index.d.mts +5 -0
  70. package/dist/build/parts/index.mjs +43 -0
  71. package/dist/build/parts/mosfet.d.mts +1 -0
  72. package/dist/build/parts/mosfet.mjs +95 -0
  73. package/dist/build/parts/node.d.mts +1 -0
  74. package/dist/build/parts/node.mjs +32 -0
  75. package/dist/build/parts/resistor.d.mts +1 -0
  76. package/dist/build/parts/resistor.mjs +49 -0
  77. package/dist/build/parts/shared.mjs +42 -0
  78. package/dist/build/parts/switch.d.mts +1 -0
  79. package/dist/build/parts/switch.mjs +34 -0
  80. package/dist/build/parts.d.mts +1 -0
  81. package/dist/build/registry.d.mts +9 -0
  82. package/dist/build/registry.mjs +15 -0
  83. package/dist/build/solve.d.mts +8 -0
  84. package/dist/build/solve.mjs +0 -0
  85. package/dist/catalog/registry.d.mts +2 -2
  86. package/dist/catalog/templates.d.mts +1 -1
  87. package/dist/catalog/templates.mjs +6 -6
  88. package/dist/chem/battery.mjs +1 -1
  89. package/dist/chem/bohr-atom.mjs +4 -4
  90. package/dist/chem/diffusion/preset.mjs +4 -4
  91. package/dist/chem/electrochem/preset.mjs +5 -5
  92. package/dist/chem/equilibrium/preset.d.mts +1 -1
  93. package/dist/chem/equilibrium/preset.mjs +6 -6
  94. package/dist/chem/gas-box/preset.mjs +6 -6
  95. package/dist/chem/kinetics/preset.mjs +6 -6
  96. package/dist/chem/periodic-trends/preset.mjs +7 -7
  97. package/dist/chem/reaction-lab.mjs +3 -3
  98. package/dist/chem/reaction-profile.mjs +4 -4
  99. package/dist/chem/solution/dilution.mjs +6 -6
  100. package/dist/chem/solution/field.d.mts +2 -2
  101. package/dist/chem/solution/field.mjs +2 -2
  102. package/dist/chem/solution/solution-box.mjs +7 -7
  103. package/dist/chem/stoichiometry/preset.mjs +5 -5
  104. package/dist/chem/titration/preset.mjs +5 -5
  105. package/dist/circuits/ac-dc/asset.mjs +1 -1
  106. package/dist/circuits/ac-dc/preset.mjs +2 -2
  107. package/dist/circuits/brownout/index.d.mts +1 -0
  108. package/dist/circuits/brownout/preset.d.mts +22 -0
  109. package/dist/circuits/brownout/preset.mjs +399 -0
  110. package/dist/circuits/capacitor-leak/preset.mjs +13 -8
  111. package/dist/circuits/circuit/asset.mjs +71 -14
  112. package/dist/circuits/circuit/preset.mjs +23 -5
  113. package/dist/circuits/circuit-builder.mjs +60 -132
  114. package/dist/circuits/circuit-lab.mjs +60 -40
  115. package/dist/circuits/cmos-gate/index.d.mts +1 -0
  116. package/dist/circuits/cmos-gate/preset.d.mts +75 -0
  117. package/dist/circuits/cmos-gate/preset.mjs +1491 -0
  118. package/dist/circuits/diode/index.d.mts +1 -0
  119. package/dist/circuits/diode/preset.d.mts +25 -0
  120. package/dist/circuits/diode/preset.mjs +266 -0
  121. package/dist/circuits/index.d.mts +7 -1
  122. package/dist/circuits/index.mjs +7 -1
  123. package/dist/circuits/rc-charging/index.d.mts +1 -0
  124. package/dist/circuits/rc-charging/preset.d.mts +27 -0
  125. package/dist/circuits/rc-charging/preset.mjs +329 -0
  126. package/dist/circuits/semiconductor/index.d.mts +1 -0
  127. package/dist/circuits/semiconductor/preset.d.mts +102 -0
  128. package/dist/circuits/semiconductor/preset.mjs +1855 -0
  129. package/dist/circuits/transistor/index.d.mts +1 -0
  130. package/dist/circuits/transistor/preset.d.mts +27 -0
  131. package/dist/circuits/transistor/preset.mjs +329 -0
  132. package/dist/commerce/accounting/core.d.mts +1 -1
  133. package/dist/commerce/accounting/equation-balance.mjs +5 -5
  134. package/dist/commerce/accounting/journal-poster.mjs +8 -8
  135. package/dist/commerce/accounting/statement-sorter.mjs +4 -4
  136. package/dist/commerce/economics/core.d.mts +2 -2
  137. package/dist/commerce/economics/core.mjs +1 -1
  138. package/dist/commerce/economics/demand-shift-vs-move.mjs +6 -6
  139. package/dist/commerce/economics/elasticity-revenue.mjs +6 -6
  140. package/dist/commerce/economics/market-equilibrium.mjs +5 -5
  141. package/dist/core/easing.d.mts +3 -3
  142. package/dist/core/easing.mjs +2 -2
  143. package/dist/core/numeric.d.mts +3 -3
  144. package/dist/core/numeric.mjs +2 -2
  145. package/dist/core/reactive.d.mts +1 -1
  146. package/dist/core/reactive.mjs +1 -1
  147. package/dist/core/rng.d.mts +2 -2
  148. package/dist/core/rng.mjs +1 -1
  149. package/dist/core/tex.mjs +2 -2
  150. package/dist/core/timeline.d.mts +1 -1
  151. package/dist/core/timeline.mjs +1 -1
  152. package/dist/core/util.mjs +11 -1
  153. package/dist/discrete/arrangements/preset.mjs +6 -14
  154. package/dist/discrete/bayes/preset.mjs +43 -35
  155. package/dist/discrete/binomial/preset.mjs +2 -2
  156. package/dist/discrete/combination-studio/figure.d.mts +6 -0
  157. package/dist/discrete/combination-studio/figure.mjs +159 -0
  158. package/dist/discrete/combination-studio/index.d.mts +2 -0
  159. package/dist/discrete/combination-studio/preset.d.mts +44 -0
  160. package/dist/discrete/combination-studio/preset.mjs +440 -0
  161. package/dist/discrete/core/combinatorics.d.mts +23 -3
  162. package/dist/discrete/core/combinatorics.mjs +38 -3
  163. package/dist/discrete/core/pigeonhole.d.mts +1 -1
  164. package/dist/discrete/core/pigeonhole.mjs +1 -1
  165. package/dist/discrete/core/probability.d.mts +3 -3
  166. package/dist/discrete/core/probability.mjs +3 -3
  167. package/dist/discrete/core/sets.d.mts +1 -1
  168. package/dist/discrete/counting-slots/preset.mjs +8 -8
  169. package/dist/discrete/counting-tree/preset.mjs +65 -8
  170. package/dist/discrete/expected-value/preset.mjs +13 -13
  171. package/dist/discrete/hypergeometric/preset.mjs +48 -15
  172. package/dist/discrete/index.d.mts +4 -2
  173. package/dist/discrete/index.mjs +4 -2
  174. package/dist/discrete/karnaugh/preset.mjs +26 -20
  175. package/dist/discrete/lln/preset.mjs +44 -3
  176. package/dist/discrete/logic-circuit/preset.mjs +2 -2
  177. package/dist/discrete/monte-carlo/preset.d.mts +1 -1
  178. package/dist/discrete/monte-carlo/preset.mjs +14 -14
  179. package/dist/discrete/monty-hall/preset.mjs +6 -6
  180. package/dist/discrete/outcome-builder/preset.mjs +3 -3
  181. package/dist/discrete/pascal/preset.mjs +37 -7
  182. package/dist/discrete/rules.d.mts +20 -0
  183. package/dist/discrete/rules.mjs +264 -0
  184. package/dist/discrete/sample-space/preset.mjs +4 -4
  185. package/dist/discrete/selection/preset.mjs +7 -13
  186. package/dist/discrete/truth-table/preset.mjs +32 -9
  187. package/dist/discrete/venn/preset.mjs +71 -48
  188. package/dist/geography/cycle-lab/preset.mjs +17 -10
  189. package/dist/geography/cycles.d.mts +3 -3
  190. package/dist/geography/cycles.mjs +3 -3
  191. package/dist/geometry/board/preset.d.mts +2 -0
  192. package/dist/geometry/board/preset.mjs +11 -15
  193. package/dist/geometry/builder.mjs +3 -3
  194. package/dist/ict/number-systems/base-odometer.mjs +4 -4
  195. package/dist/ict/number-systems/bit-grouper.d.mts +1 -1
  196. package/dist/ict/number-systems/bit-grouper.mjs +4 -4
  197. package/dist/ict/number-systems/place-value-dial.d.mts +1 -1
  198. package/dist/ict/number-systems/place-value-dial.mjs +3 -3
  199. package/dist/ict/number-systems/wheel.d.mts +3 -3
  200. package/dist/ict/number-systems/wheel.mjs +4 -4
  201. package/dist/kit/annotate.mjs +3 -3
  202. package/dist/kit/answer-check.d.mts +2 -2
  203. package/dist/kit/answer-check.mjs +34 -6
  204. package/dist/kit/ask.d.mts +19 -0
  205. package/dist/kit/ask.mjs +46 -0
  206. package/dist/kit/bar-strip.mjs +53 -0
  207. package/dist/kit/calc.d.mts +33 -0
  208. package/dist/kit/calc.mjs +27 -0
  209. package/dist/kit/carrier-engine.mjs +147 -0
  210. package/dist/kit/clue-scene.d.mts +86 -0
  211. package/dist/kit/clue-scene.mjs +424 -0
  212. package/dist/kit/cluster.d.mts +30 -0
  213. package/dist/kit/cluster.mjs +81 -0
  214. package/dist/kit/controls.mjs +11 -5
  215. package/dist/kit/coords.d.mts +88 -0
  216. package/dist/kit/coords.mjs +192 -0
  217. package/dist/kit/data-scene.d.mts +27 -0
  218. package/dist/kit/data-scene.mjs +199 -0
  219. package/dist/kit/diagram.mjs +111 -50
  220. package/dist/kit/electronics.mjs +552 -60
  221. package/dist/kit/expr-analysis.d.mts +18 -6
  222. package/dist/kit/expr-analysis.mjs +82 -28
  223. package/dist/kit/frame.d.mts +3 -3
  224. package/dist/kit/frame.mjs +25 -6
  225. package/dist/kit/gameshow.mjs +2 -2
  226. package/dist/kit/index.d.mts +14 -2
  227. package/dist/kit/index.mjs +13 -1
  228. package/dist/kit/logic-gates.mjs +246 -47
  229. package/dist/kit/palette.mjs +26 -0
  230. package/dist/kit/pedagogy.d.mts +4 -4
  231. package/dist/kit/pedagogy.mjs +21 -17
  232. package/dist/kit/play.d.mts +1 -1
  233. package/dist/kit/play.mjs +3 -3
  234. package/dist/kit/predict.d.mts +55 -0
  235. package/dist/kit/predict.mjs +146 -0
  236. package/dist/kit/receipt.d.mts +29 -0
  237. package/dist/kit/receipt.mjs +94 -0
  238. package/dist/kit/rich.mjs +2 -2
  239. package/dist/kit/rule.d.mts +59 -0
  240. package/dist/kit/rule.mjs +215 -0
  241. package/dist/kit/scale.mjs +1 -1
  242. package/dist/kit/scene-library.d.mts +22 -0
  243. package/dist/kit/scene-library.mjs +311 -0
  244. package/dist/kit/scene-studio.d.mts +14 -0
  245. package/dist/kit/scene-studio.mjs +338 -0
  246. package/dist/kit/scenes.d.mts +31 -0
  247. package/dist/kit/scenes.mjs +569 -0
  248. package/dist/kit/slot-fill.d.mts +61 -0
  249. package/dist/kit/slot-fill.mjs +207 -0
  250. package/dist/kit/solve.d.mts +21 -0
  251. package/dist/kit/solve.mjs +75 -0
  252. package/dist/kit/space.mjs +5 -5
  253. package/dist/kit/steps.mjs +2 -2
  254. package/dist/kit/vessel.d.mts +69 -0
  255. package/dist/kit/vessel.mjs +191 -0
  256. package/dist/language/agreement/preset.mjs +2 -2
  257. package/dist/language/article-lens/preset.d.mts +1 -1
  258. package/dist/language/article-lens/preset.mjs +8 -8
  259. package/dist/language/deck.d.mts +3 -3
  260. package/dist/language/deck.mjs +1 -1
  261. package/dist/language/preposition-scene/preset.d.mts +2 -2
  262. package/dist/language/preposition-scene/preset.mjs +5 -5
  263. package/dist/language/sentence-builder/preset.mjs +5 -5
  264. package/dist/language/transform/preset.d.mts +2 -2
  265. package/dist/language/transform/preset.mjs +5 -5
  266. package/dist/language/ui.d.mts +3 -3
  267. package/dist/language/ui.mjs +4 -4
  268. package/dist/language/word-match/preset.mjs +3 -3
  269. package/dist/logic/LogicBuildLab.d.mts +22 -0
  270. package/dist/logic/LogicBuildLab.mjs +170 -0
  271. package/dist/logic/LogicEditScene.d.mts +31 -0
  272. package/dist/logic/LogicEditScene.mjs +276 -0
  273. package/dist/logic/LogicEditor.d.mts +14 -0
  274. package/dist/logic/LogicEditor.mjs +413 -0
  275. package/dist/logic/LogicScene.d.mts +32 -0
  276. package/dist/logic/LogicScene.mjs +277 -0
  277. package/dist/logic/contract.d.mts +72 -0
  278. package/dist/logic/display.d.mts +24 -0
  279. package/dist/logic/display.mjs +127 -0
  280. package/dist/logic/edit-ops.d.mts +44 -0
  281. package/dist/logic/edit-ops.mjs +177 -0
  282. package/dist/logic/evaluate.d.mts +11 -0
  283. package/dist/logic/evaluate.mjs +93 -0
  284. package/dist/logic/gates.d.mts +10 -0
  285. package/dist/logic/gates.mjs +73 -0
  286. package/dist/logic/index.d.mts +14 -0
  287. package/dist/logic/index.mjs +13 -0
  288. package/dist/logic/lab.d.mts +32 -0
  289. package/dist/logic/lab.mjs +160 -0
  290. package/dist/logic/presets.d.mts +12 -0
  291. package/dist/logic/presets.mjs +241 -0
  292. package/dist/logic/registry.d.mts +9 -0
  293. package/dist/logic/registry.mjs +15 -0
  294. package/dist/math/area-model/preset.mjs +70 -44
  295. package/dist/math/balance-algebra/preset.mjs +14 -5
  296. package/dist/math/broken-tree/index.d.mts +1 -0
  297. package/dist/math/broken-tree/preset.d.mts +26 -0
  298. package/dist/math/broken-tree/preset.mjs +435 -0
  299. package/dist/math/circle/index.d.mts +1 -0
  300. package/dist/math/circle/preset.d.mts +44 -0
  301. package/dist/math/circle/preset.mjs +198 -0
  302. package/dist/math/complex/core.d.mts +93 -0
  303. package/dist/math/complex/core.mjs +239 -0
  304. package/dist/math/complex/index.d.mts +3 -0
  305. package/dist/math/complex/preset.d.mts +31 -0
  306. package/dist/math/complex/preset.mjs +377 -0
  307. package/dist/math/complex/rules.d.mts +6 -0
  308. package/dist/math/complex/rules.mjs +121 -0
  309. package/dist/math/conic/index.d.mts +1 -0
  310. package/dist/math/conic/preset.d.mts +30 -0
  311. package/dist/math/conic/preset.mjs +334 -0
  312. package/dist/math/derivation.mjs +5 -5
  313. package/dist/math/derivative-explorer/preset.mjs +5 -5
  314. package/dist/math/domain-range/index.d.mts +1 -0
  315. package/dist/math/domain-range/preset.d.mts +33 -0
  316. package/dist/math/domain-range/preset.mjs +313 -0
  317. package/dist/math/fraction-bar/index.d.mts +1 -0
  318. package/dist/math/fraction-bar/preset.d.mts +27 -0
  319. package/dist/math/fraction-bar/preset.mjs +197 -0
  320. package/dist/math/function-machine/preset.mjs +2 -2
  321. package/dist/math/gradient-descent.mjs +6 -6
  322. package/dist/math/grapher/preset.d.mts +1 -1
  323. package/dist/math/grapher/preset.mjs +4 -4
  324. package/dist/math/harmonic-form/preset.mjs +6 -6
  325. package/dist/math/index.d.mts +27 -2
  326. package/dist/math/index.mjs +27 -2
  327. package/dist/math/integral-explorer/preset.mjs +2 -2
  328. package/dist/math/interactive/preset.mjs +3 -3
  329. package/dist/math/limit-explorer/preset.mjs +4 -4
  330. package/dist/math/linear-model/index.d.mts +1 -0
  331. package/dist/math/linear-model/preset.d.mts +53 -0
  332. package/dist/math/linear-model/preset.mjs +164 -0
  333. package/dist/math/linear-system/preset.mjs +4 -4
  334. package/dist/math/mystery-bucket/preset.mjs +6 -6
  335. package/dist/math/number-line/preset.mjs +3 -2
  336. package/dist/math/parabola/preset.mjs +4 -3
  337. package/dist/math/pattern/preset.mjs +7 -13
  338. package/dist/math/percent-bar/index.d.mts +1 -0
  339. package/dist/math/percent-bar/preset.d.mts +37 -0
  340. package/dist/math/percent-bar/preset.mjs +275 -0
  341. package/dist/math/poly/core.d.mts +50 -0
  342. package/dist/math/poly/core.mjs +268 -0
  343. package/dist/math/poly/index.d.mts +3 -0
  344. package/dist/math/poly/preset.d.mts +23 -0
  345. package/dist/math/poly/preset.mjs +141 -0
  346. package/dist/math/poly/steps.d.mts +10 -0
  347. package/dist/math/poly/steps.mjs +99 -0
  348. package/dist/math/rate-machine/index.d.mts +1 -0
  349. package/dist/math/rate-machine/preset.d.mts +35 -0
  350. package/dist/math/rate-machine/preset.mjs +281 -0
  351. package/dist/math/ratio-share/index.d.mts +1 -0
  352. package/dist/math/ratio-share/preset.d.mts +24 -0
  353. package/dist/math/ratio-share/preset.mjs +204 -0
  354. package/dist/math/receipt/index.d.mts +1 -0
  355. package/dist/math/receipt/preset.d.mts +22 -0
  356. package/dist/math/receipt/preset.mjs +137 -0
  357. package/dist/math/sequence-predict/index.d.mts +1 -0
  358. package/dist/math/sequence-predict/preset.d.mts +34 -0
  359. package/dist/math/sequence-predict/preset.mjs +130 -0
  360. package/dist/math/straight-line/index.d.mts +1 -0
  361. package/dist/math/straight-line/preset.d.mts +37 -0
  362. package/dist/math/straight-line/preset.mjs +374 -0
  363. package/dist/math/system-solve/index.d.mts +1 -0
  364. package/dist/math/system-solve/preset.d.mts +21 -0
  365. package/dist/math/system-solve/preset.mjs +227 -0
  366. package/dist/math/transform/index.d.mts +1 -0
  367. package/dist/math/transform/preset.d.mts +41 -0
  368. package/dist/math/transform/preset.mjs +343 -0
  369. package/dist/math/triangle-trig/preset.mjs +12 -9
  370. package/dist/math/trig/core.d.mts +37 -0
  371. package/dist/math/trig/core.mjs +150 -0
  372. package/dist/math/trig/diagrams.d.mts +1 -0
  373. package/dist/math/trig/diagrams.mjs +321 -0
  374. package/dist/math/trig/index.d.mts +3 -0
  375. package/dist/math/trig/preset.d.mts +25 -0
  376. package/dist/math/trig/preset.mjs +260 -0
  377. package/dist/math/trig/rules.d.mts +6 -0
  378. package/dist/math/trig/rules.mjs +159 -0
  379. package/dist/math/trig-explorer.mjs +4 -4
  380. package/dist/ml/boundary/preset.mjs +8 -3
  381. package/dist/ml/classifier/preset.mjs +31 -6
  382. package/dist/ml/kmeans/preset.mjs +4 -4
  383. package/dist/ml/knn/preset.mjs +47 -12
  384. package/dist/ml/regression/preset.mjs +36 -7
  385. package/dist/physics/atwood/preset.mjs +4 -4
  386. package/dist/physics/bullet-walls/preset.d.mts +1 -1
  387. package/dist/physics/bullet-walls/preset.mjs +7 -7
  388. package/dist/physics/carnot/preset.mjs +6 -6
  389. package/dist/physics/circular-motion/preset.mjs +36 -5
  390. package/dist/physics/collision-track/preset.mjs +35 -5
  391. package/dist/physics/efficiency/preset.d.mts +2 -2
  392. package/dist/physics/efficiency/preset.mjs +5 -5
  393. package/dist/physics/electric-field/preset.mjs +32 -23
  394. package/dist/physics/electric-flux/index.d.mts +1 -0
  395. package/dist/physics/electric-flux/preset.d.mts +29 -0
  396. package/dist/physics/electric-flux/preset.mjs +264 -0
  397. package/dist/physics/energy-skate/preset.mjs +5 -5
  398. package/dist/physics/entropy/preset.mjs +7 -7
  399. package/dist/physics/expansion/preset.mjs +13 -13
  400. package/dist/physics/exponential/asset.mjs +1 -1
  401. package/dist/physics/exponential/preset.mjs +4 -4
  402. package/dist/physics/gas-process/preset.mjs +3 -3
  403. package/dist/physics/gauss-law/index.d.mts +1 -0
  404. package/dist/physics/gauss-law/preset.d.mts +20 -0
  405. package/dist/physics/gauss-law/preset.mjs +286 -0
  406. package/dist/physics/gravitation/preset.mjs +7 -7
  407. package/dist/physics/gravity-drop.mjs +4 -4
  408. package/dist/physics/heat-transfer/preset.d.mts +1 -1
  409. package/dist/physics/heat-transfer/preset.mjs +10 -10
  410. package/dist/physics/impulse/preset.mjs +5 -5
  411. package/dist/physics/index.d.mts +4 -1
  412. package/dist/physics/index.mjs +4 -1
  413. package/dist/physics/kepler/preset.mjs +4 -4
  414. package/dist/physics/lever/preset.mjs +3 -3
  415. package/dist/physics/lorentz/preset.mjs +11 -11
  416. package/dist/physics/magnetism/preset.mjs +3 -3
  417. package/dist/physics/optics/preset.mjs +2 -2
  418. package/dist/physics/orbit-lab.mjs +5 -5
  419. package/dist/physics/projectile-lab.mjs +4 -4
  420. package/dist/physics/rain-relative/preset.mjs +5 -5
  421. package/dist/physics/ramp-forces/preset.mjs +5 -5
  422. package/dist/physics/river-boat.mjs +6 -6
  423. package/dist/physics/shm/preset.mjs +9 -9
  424. package/dist/physics/stopping-distance/preset.mjs +3 -3
  425. package/dist/physics/temperature-scales/preset.mjs +105 -116
  426. package/dist/physics/terminal-velocity/preset.mjs +5 -5
  427. package/dist/physics/thermal/preset.mjs +5 -5
  428. package/dist/physics/vector-board/preset.mjs +7 -6
  429. package/dist/physics/vector-scene.mjs +2 -2
  430. package/dist/physics/vector-types/preset.mjs +37 -3
  431. package/dist/physics/water-density/preset.mjs +12 -12
  432. package/dist/physics/waves/doppler.mjs +2 -2
  433. package/dist/physics/waves/preset.mjs +4 -4
  434. package/dist/physics/waves/ripple.mjs +6 -6
  435. package/dist/physics/waves/string.mjs +5 -5
  436. package/dist/physics/work-energy/preset.mjs +4 -4
  437. package/dist/physics/work-potential/index.d.mts +1 -0
  438. package/dist/physics/work-potential/preset.d.mts +20 -0
  439. package/dist/physics/work-potential/preset.mjs +276 -0
  440. package/dist/schemas/index.d.mts +6 -6
  441. package/dist/schemas/index.mjs +3 -3
  442. package/dist/statistics/center-spread/preset.mjs +3 -3
  443. package/dist/statistics/core/descriptive.d.mts +2 -2
  444. package/dist/statistics/core/descriptive.mjs +2 -2
  445. package/dist/statistics/core/normal.d.mts +3 -3
  446. package/dist/statistics/core/normal.mjs +3 -3
  447. package/dist/statistics/core/sequences.d.mts +1 -1
  448. package/dist/statistics/galton/preset.mjs +2 -2
  449. package/dist/statistics/histogram/preset.mjs +6 -6
  450. package/dist/statistics/normal/preset.mjs +2 -2
  451. package/dist/statistics/sampling/preset.mjs +4 -4
  452. package/dist/statistics/sequence/preset.mjs +58 -15
  453. package/dist/statistics/z-table/preset.mjs +17 -4
  454. package/package.json +11 -3
  455. package/styles.css +4 -1
@@ -1,3 +1,4 @@
1
+ import { AnswerSpec, ExprCheckOpts, checkAnswer, checkExpression, checkNumber, parseValue } from "../kit/answer-check.mjs";
1
2
  import { GraphEquation, GraphParam, Grapher, GrapherProps } from "./grapher/preset.mjs";
2
3
  import { DerivativeExplorer, DerivativeExplorerProps } from "./derivative-explorer/preset.mjs";
3
4
  import { IntegralExplorer, IntegralExplorerProps } from "./integral-explorer/preset.mjs";
@@ -18,8 +19,32 @@ import { FunctionMachineLab, FunctionMachineProps } from "./function-machine/pre
18
19
  import { TRIG_FNS, TrigExplorer, TrigFn } from "./trig-explorer.mjs";
19
20
  import { Derivation, DerivationProps, DerivationStep } from "./derivation.mjs";
20
21
  import { GradientDescent, GradientDescentProps } from "./gradient-descent.mjs";
21
- import { AnswerSpec, ExprCheckOpts, checkAnswer, checkExpression, checkNumber, parseValue } from "../kit/answer-check.mjs";
22
22
  import { Derived, InteractiveProblem, InteractiveProblemProps, ProblemAsk, ProblemEquation, ProblemParam } from "./interactive/preset.mjs";
23
23
  import { TriangleTrig, TriangleTrigProps } from "./triangle-trig/preset.mjs";
24
+ import { BrokenTreeLab, BrokenTreeProps } from "./broken-tree/preset.mjs";
25
+ import { StraightLineLab, StraightLineMode, StraightLineProps } from "./straight-line/preset.mjs";
26
+ import { CircleLab, CircleProps } from "./circle/preset.mjs";
27
+ import { ConicKind, ConicLab, ConicProps } from "./conic/preset.mjs";
28
+ import { DomainRangeLab, DomainRangeProps } from "./domain-range/preset.mjs";
29
+ import { LinearModelLab, LinearModelProps } from "./linear-model/preset.mjs";
30
+ import { RateMachineLab, RateMachineProps } from "./rate-machine/preset.mjs";
31
+ import { SequencePredict, SequencePredictProps, SequenceRule } from "./sequence-predict/preset.mjs";
32
+ import { PercentBarLab, PercentBarProps, PercentSegment } from "./percent-bar/preset.mjs";
33
+ import { ComplexMode, ComplexPlaneLab, ComplexPlaneProps } from "./complex/preset.mjs";
34
+ import { Complex, core_d_exports } from "./complex/core.mjs";
35
+ import { COMPLEX_RULES } from "./complex/rules.mjs";
36
+ import { TrigSignsLab, TrigSignsProps } from "./trig/preset.mjs";
37
+ import { core_d_exports as core_d_exports$2 } from "./trig/core.mjs";
38
+ import { TRIG_RULES } from "./trig/rules.mjs";
39
+ import { FractionBarLab, FractionBarProps } from "./fraction-bar/preset.mjs";
40
+ import { RatioShareLab, RatioShareProps } from "./ratio-share/preset.mjs";
41
+ import { ReflectAxis, Transform, TransformKind, TransformLab, TransformProps, applyTf } from "./transform/preset.mjs";
42
+ import { ReceiptLab, ReceiptProps } from "./receipt/preset.mjs";
43
+ import { SystemSolveLab, SystemSolveProps } from "./system-solve/preset.mjs";
44
+ import { CoordPlane, CoordPlaneProps, GradientTriangle, Lin, circleExpandedTex, circleTex, distance, interceptTex, intersectLines, lineFrom, lineTex, lineThrough, midpoint, num, parallelThrough, perpThrough, snapPoint, snapTo } from "../kit/coords.mjs";
24
45
  import { Fn1, Line, areaBetween, integrate, intersections, normalAt, roots, tangentAt } from "../kit/expr-analysis.mjs";
25
- export { AREA_MODEL_ASSET, type AnswerSpec, AreaModelLab, type AreaModelProps, BALANCE_ALGEBRA_ASSET, BalanceAlgebraLab, type BalanceAlgebraProps, type BalanceEquation, Derivation, type DerivationProps, type DerivationStep, DerivativeExplorer, type DerivativeExplorerProps, type Derived, type ExprCheckOpts, type Fn1, FunctionMachineLab, type FunctionMachineProps, GradientDescent, type GradientDescentProps, type GraphEquation, type GraphParam, Grapher, type GrapherProps, GrowingPatternLab, type GrowingPatternProps, HarmonicFormLab, type HarmonicFormProps, IntegralExplorer, type IntegralExplorerProps, InteractiveProblem, type InteractiveProblemProps, LimitExplorer, type LimitExplorerProps, type Line, LinearSystemLab, type LinearSystemProps, MYSTERY_BUCKET_ASSET, MysteryBucketLab, type MysteryBucketProps, NumberLineLab, type NumberLineProps, PATTERN_FIGURE_ASSET, type ParabolaProps, type ProblemAsk, type ProblemEquation, type ProblemParam, type SystemLine, TRIG_FNS, TriangleTrig, type TriangleTrigProps, TrigExplorer, type TrigFn, VertexParabolaLab, areaBetween, areaModelDoc, balanceAlgebraDoc, checkAnswer, checkExpression, checkNumber, growingPatternDoc, integrate, intersections, mysteryBucketDoc, normalAt, parseValue, roots, tangentAt };
46
+ import { PolyRoots, core_d_exports as core_d_exports$1, factorTex, solveEquation } from "./poly/core.mjs";
47
+ import { PolySolution, polyCoeffs, solutionTex, solvePoly } from "../kit/solve.mjs";
48
+ import { factorSteps, solveSteps } from "./poly/steps.mjs";
49
+ import { PolynomialSolverLab, PolynomialSolverProps } from "./poly/preset.mjs";
50
+ export { AREA_MODEL_ASSET, type AnswerSpec, AreaModelLab, type AreaModelProps, BALANCE_ALGEBRA_ASSET, BalanceAlgebraLab, type BalanceAlgebraProps, type BalanceEquation, BrokenTreeLab, type BrokenTreeProps, COMPLEX_RULES, CircleLab, type CircleProps, type Complex, type ComplexMode, ComplexPlaneLab, type ComplexPlaneProps, type ConicKind, ConicLab, type ConicProps, CoordPlane, type CoordPlaneProps, Derivation, type DerivationProps, type DerivationStep, DerivativeExplorer, type DerivativeExplorerProps, type Derived, DomainRangeLab, type DomainRangeProps, type ExprCheckOpts, type Fn1, FractionBarLab, type FractionBarProps, FunctionMachineLab, type FunctionMachineProps, GradientDescent, type GradientDescentProps, GradientTriangle, type GraphEquation, type GraphParam, Grapher, type GrapherProps, GrowingPatternLab, type GrowingPatternProps, HarmonicFormLab, type HarmonicFormProps, IntegralExplorer, type IntegralExplorerProps, InteractiveProblem, type InteractiveProblemProps, LimitExplorer, type LimitExplorerProps, type Lin, type Line, LinearModelLab, type LinearModelProps, LinearSystemLab, type LinearSystemProps, MYSTERY_BUCKET_ASSET, MysteryBucketLab, type MysteryBucketProps, NumberLineLab, type NumberLineProps, PATTERN_FIGURE_ASSET, type ParabolaProps, PercentBarLab, type PercentBarProps, type PercentSegment, type PolyRoots, type PolySolution, PolynomialSolverLab, type PolynomialSolverProps, type ProblemAsk, type ProblemEquation, type ProblemParam, RateMachineLab, type RateMachineProps, RatioShareLab, type RatioShareProps, ReceiptLab, type ReceiptProps, type ReflectAxis, SequencePredict, type SequencePredictProps, type SequenceRule, StraightLineLab, type StraightLineMode, type StraightLineProps, type SystemLine, SystemSolveLab, type SystemSolveProps, TRIG_FNS, TRIG_RULES, type Transform, type TransformKind, TransformLab, type TransformProps, TriangleTrig, type TriangleTrigProps, TrigExplorer, type TrigFn, TrigSignsLab, type TrigSignsProps, VertexParabolaLab, applyTf, areaBetween, areaModelDoc, balanceAlgebraDoc, checkAnswer, checkExpression, checkNumber, circleExpandedTex, circleTex, core_d_exports as complex, distance, factorSteps, factorTex, growingPatternDoc, integrate, interceptTex, intersectLines, intersections, lineFrom, lineTex, lineThrough, midpoint, mysteryBucketDoc, normalAt, num, parallelThrough, parseValue, perpThrough, core_d_exports$1 as poly, polyCoeffs, roots, snapPoint, snapTo, solutionTex, solveEquation, solvePoly, solveSteps, tangentAt, core_d_exports$2 as trig };
@@ -1,3 +1,4 @@
1
+ import { checkAnswer, checkExpression, checkNumber, parseValue } from "../kit/answer-check.mjs";
1
2
  import { Grapher } from "./grapher/preset.mjs";
2
3
  import { DerivativeExplorer } from "./derivative-explorer/preset.mjs";
3
4
  import { IntegralExplorer } from "./integral-explorer/preset.mjs";
@@ -19,8 +20,32 @@ import { TRIG_FNS, TrigExplorer } from "./trig-explorer.mjs";
19
20
  import { Derivation } from "./derivation.mjs";
20
21
  import { GradientDescent } from "./gradient-descent.mjs";
21
22
  import { areaBetween, integrate, intersections, normalAt, roots, tangentAt } from "../kit/expr-analysis.mjs";
22
- import { checkAnswer, checkExpression, checkNumber, parseValue } from "../kit/answer-check.mjs";
23
23
  import { InteractiveProblem } from "./interactive/preset.mjs";
24
24
  import { TriangleTrig } from "./triangle-trig/preset.mjs";
25
+ import { BrokenTreeLab } from "./broken-tree/preset.mjs";
26
+ import { CoordPlane, GradientTriangle, circleExpandedTex, circleTex, distance, interceptTex, intersectLines, lineFrom, lineTex, lineThrough, midpoint, num, parallelThrough, perpThrough, snapPoint, snapTo } from "../kit/coords.mjs";
27
+ import { StraightLineLab } from "./straight-line/preset.mjs";
28
+ import { CircleLab } from "./circle/preset.mjs";
29
+ import { ConicLab } from "./conic/preset.mjs";
30
+ import { DomainRangeLab } from "./domain-range/preset.mjs";
31
+ import { LinearModelLab } from "./linear-model/preset.mjs";
32
+ import { RateMachineLab } from "./rate-machine/preset.mjs";
33
+ import { SequencePredict } from "./sequence-predict/preset.mjs";
34
+ import { PercentBarLab } from "./percent-bar/preset.mjs";
35
+ import { core_exports } from "./complex/core.mjs";
36
+ import { ComplexPlaneLab } from "./complex/preset.mjs";
37
+ import { COMPLEX_RULES } from "./complex/rules.mjs";
38
+ import { core_exports as core_exports$2 } from "./trig/core.mjs";
39
+ import { TrigSignsLab } from "./trig/preset.mjs";
40
+ import { TRIG_RULES } from "./trig/rules.mjs";
41
+ import { FractionBarLab } from "./fraction-bar/preset.mjs";
42
+ import { RatioShareLab } from "./ratio-share/preset.mjs";
43
+ import { TransformLab, applyTf } from "./transform/preset.mjs";
44
+ import { ReceiptLab } from "./receipt/preset.mjs";
45
+ import { SystemSolveLab } from "./system-solve/preset.mjs";
46
+ import { core_exports as core_exports$1, factorTex, solveEquation } from "./poly/core.mjs";
47
+ import { polyCoeffs, solutionTex, solvePoly } from "../kit/solve.mjs";
48
+ import { factorSteps, solveSteps } from "./poly/steps.mjs";
49
+ import { PolynomialSolverLab } from "./poly/preset.mjs";
25
50
 
26
- export { AREA_MODEL_ASSET, AreaModelLab, BALANCE_ALGEBRA_ASSET, BalanceAlgebraLab, Derivation, DerivativeExplorer, FunctionMachineLab, GradientDescent, Grapher, GrowingPatternLab, HarmonicFormLab, IntegralExplorer, InteractiveProblem, LimitExplorer, LinearSystemLab, MYSTERY_BUCKET_ASSET, MysteryBucketLab, NumberLineLab, PATTERN_FIGURE_ASSET, TRIG_FNS, TriangleTrig, TrigExplorer, VertexParabolaLab, areaBetween, areaModelDoc, balanceAlgebraDoc, checkAnswer, checkExpression, checkNumber, growingPatternDoc, integrate, intersections, mysteryBucketDoc, normalAt, parseValue, roots, tangentAt };
51
+ export { AREA_MODEL_ASSET, AreaModelLab, BALANCE_ALGEBRA_ASSET, BalanceAlgebraLab, BrokenTreeLab, COMPLEX_RULES, CircleLab, ComplexPlaneLab, ConicLab, CoordPlane, Derivation, DerivativeExplorer, DomainRangeLab, FractionBarLab, FunctionMachineLab, GradientDescent, GradientTriangle, Grapher, GrowingPatternLab, HarmonicFormLab, IntegralExplorer, InteractiveProblem, LimitExplorer, LinearModelLab, LinearSystemLab, MYSTERY_BUCKET_ASSET, MysteryBucketLab, NumberLineLab, PATTERN_FIGURE_ASSET, PercentBarLab, PolynomialSolverLab, RateMachineLab, RatioShareLab, ReceiptLab, SequencePredict, StraightLineLab, SystemSolveLab, TRIG_FNS, TRIG_RULES, TransformLab, TriangleTrig, TrigExplorer, TrigSignsLab, VertexParabolaLab, applyTf, areaBetween, areaModelDoc, balanceAlgebraDoc, checkAnswer, checkExpression, checkNumber, circleExpandedTex, circleTex, core_exports as complex, distance, factorSteps, factorTex, growingPatternDoc, integrate, interceptTex, intersectLines, intersections, lineFrom, lineTex, lineThrough, midpoint, mysteryBucketDoc, normalAt, num, parallelThrough, parseValue, perpThrough, core_exports$1 as poly, polyCoeffs, roots, snapPoint, snapTo, solutionTex, solveEquation, solvePoly, solveSteps, tangentAt, core_exports$2 as trig };
@@ -11,7 +11,7 @@ import { Axes, Grid, MovableDot, Plot, Polygon, Stage, compileExpr, evaluate, to
11
11
 
12
12
  //#region src/math/integral-explorer/preset.tsx
13
13
  /**
14
- * IntegralExplorer — the integral as "area under the curve," on @classytic/stage.
14
+ * IntegralExplorer, the integral as "area under the curve," on @classytic/stage.
15
15
  * Shades f(x) over [a,b] with n Riemann rectangles (SVG Polygons); drag the
16
16
  * endpoints, crank n, switch left/mid/right, and watch the estimate converge to
17
17
  * the Simpson reference. Reuses the pure `riemannSum`/`integrate` helpers.
@@ -71,7 +71,7 @@ function IntegralExplorer({ equation = "0.4*x^2 + 0.5", xRange = [-1, 4], a: aIn
71
71
  children: [
72
72
  "“",
73
73
  equation,
74
- "” — ",
74
+ "”, ",
75
75
  model.error
76
76
  ]
77
77
  })]
@@ -3,17 +3,17 @@
3
3
  import { Slider } from "../../kit/controls.mjs";
4
4
  import { Callout, ControlBar, Field, LabFrame } from "../../kit/frame.mjs";
5
5
  import { AskBox } from "../../kit/pedagogy.mjs";
6
- import { areaBetween, intersections, normalAt, roots, tangentAt } from "../../kit/expr-analysis.mjs";
7
6
  import { checkAnswer } from "../../kit/answer-check.mjs";
7
+ import { areaBetween, intersections, normalAt, roots, tangentAt } from "../../kit/expr-analysis.mjs";
8
8
  import { useMemo, useState } from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  import { Axes, Dot, Grid, Plot, Stage, compileExpr } from "@classytic/stage";
11
11
 
12
12
  //#region src/math/interactive/preset.tsx
13
13
  /**
14
- * InteractiveProblem — the authorable engine: a CREATOR writes a config (equations,
14
+ * InteractiveProblem, the authorable engine: a CREATOR writes a config (equations,
15
15
  * params, derived quantities, an optional ask+check) and gets a live, graded
16
- * interactive graph. No bespoke component per question — the same engine plots any
16
+ * interactive graph. No bespoke component per question, the same engine plots any
17
17
  * equations, exposes params as sliders, DERIVES what the question needs (roots,
18
18
  * intersections, tangent/normal, area) from the symbolic engine, and CHECKS the
19
19
  * student's answer symbolically + numerically.
@@ -11,10 +11,10 @@ import { Axes, Grid, MovableDot, Plot, Point, Segment, Stage, compileExpr, evalu
11
11
 
12
12
  //#region src/math/limit-explorer/preset.tsx
13
13
  /**
14
- * LimitExplorer — "what value does f approach as x → c?", on @classytic/stage.
14
+ * LimitExplorer, "what value does f approach as x → c?", on @classytic/stage.
15
15
  * Plots f(x), drops a dashed line at x = c, and walks dots in from both sides
16
16
  * (h = 1, 0.1, 0.01, 0.001). When the two sides converge to one value, that's
17
- * the limit — even where f(c) itself is a hole. Reuses `estimateOneSidedLimit`.
17
+ * the limit, even where f(c) itself is a hole. Reuses `estimateOneSidedLimit`.
18
18
  */
19
19
  const STEPS = [
20
20
  1,
@@ -22,7 +22,7 @@ const STEPS = [
22
22
  .01,
23
23
  .001
24
24
  ];
25
- const fmt$1 = (v) => Number.isFinite(v) ? v.toFixed(4) : "—";
25
+ const fmt$1 = (v) => Number.isFinite(v) ? v.toFixed(4) : ", ";
26
26
  function LimitExplorer({ equation = "(x^2 - 1)/(x - 1)", xRange = [-1, 3], c: cInit = 1, title = "Approaching a limit", height = 320 } = {}) {
27
27
  const [xMin, xMax] = xRange;
28
28
  const [c, setC] = useState(clamp(cInit, xMin, xMax));
@@ -60,7 +60,7 @@ function LimitExplorer({ equation = "(x^2 - 1)/(x - 1)", xRange = [-1, 3], c: cI
60
60
  children: [
61
61
  "“",
62
62
  equation,
63
- "” — ",
63
+ "”, ",
64
64
  model.error
65
65
  ]
66
66
  })]
@@ -0,0 +1 @@
1
+ import { LinearModelLab, LinearModelProps } from "./preset.mjs";
@@ -0,0 +1,53 @@
1
+ import { LabAskSpec } from "../../kit/ask.mjs";
2
+ import { ReactNode } from "react";
3
+
4
+ //#region src/math/linear-model/preset.d.ts
5
+ interface LinearModelProps {
6
+ /** Hidden rule: y = slope·x + intercept. */
7
+ slope?: number;
8
+ intercept?: number;
9
+ /** Inputs already shown as data points (e.g. [0, 1]). */
10
+ given?: number[];
11
+ /** The input the learner predicts (e.g. 2). */
12
+ predictX?: number;
13
+ xMax?: number;
14
+ yMax?: number;
15
+ xStep?: number;
16
+ yStep?: number;
17
+ /** How close (in y units) counts as correct. Default ½ a y-step. */
18
+ tolerance?: number;
19
+ xLabel?: string;
20
+ yLabel?: string;
21
+ unit?: string;
22
+ /** The concrete twin beside the graph: 'none', 'vessel' (supports objects), or any
23
+ * registered level scene ('tank' | 'bar' | 'battery' | 'jar' | 'pie' | 'balloon' |
24
+ * 'thermometer' | …). Author picks the skin; new scenes come from registerScene. */
25
+ scene?: string;
26
+ /** Extra concrete twins shown alongside `scene` (multi-representation): the same
27
+ * quantity as a balloon AND a battery AND the graph, all live-linked. */
28
+ extraScenes?: string[];
29
+ /** Drop discrete objects (marbles) into the vessel = the input count. Off → just liquid. */
30
+ vesselObjects?: boolean;
31
+ /**
32
+ * What the concrete twin's LEVEL tracks:
33
+ * 'guess' (default) the liquid rises/falls live as you drag the point, so the
34
+ * quantity is something you feel increase and decrease; it turns green
35
+ * when your reading is right.
36
+ * 'truth' the twin sits at the real measured level (poured on load) and your
37
+ * reading is a dashed line you match to it ("the real lab result").
38
+ */
39
+ vesselBinds?: 'guess' | 'truth';
40
+ /** Word for one object/scene caption (default: the x label). */
41
+ objectLabel?: string;
42
+ liquidColor?: string;
43
+ objectColor?: string;
44
+ height?: number;
45
+ title?: string;
46
+ prompt?: string;
47
+ activity?: string;
48
+ /** Optional graded follow-up (typed or multiple choice). */
49
+ ask?: LabAskSpec;
50
+ }
51
+ declare function LinearModelLab(props?: LinearModelProps): ReactNode;
52
+ //#endregion
53
+ export { LinearModelLab, LinearModelProps };
@@ -0,0 +1,164 @@
1
+ 'use client';
2
+
3
+ import { Callout, LabFrame } from "../../kit/frame.mjs";
4
+ import { Feedback, useCheckpoint } from "../../kit/pedagogy.mjs";
5
+ import { useReducedMotion } from "../../kit/anim.mjs";
6
+ import { LabAsk } from "../../kit/ask.mjs";
7
+ import { PredictPlot } from "../../kit/predict.mjs";
8
+ import { Vessel } from "../../kit/vessel.mjs";
9
+ import { getScene } from "../../kit/scenes.mjs";
10
+ import { useEffect, useState } from "react";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+
13
+ //#region src/math/linear-model/preset.tsx
14
+ /**
15
+ * LinearModelLab, the "concrete → graph" proportion/rate lab. A quantity rises in a
16
+ * vessel on one side and is a point on the graph on the other; the learner PLOTS the
17
+ * value for the next input by dragging a point. Discover the rule y = slope·x + intercept
18
+ * from data, then (optionally) answer a follow-up.
19
+ *
20
+ * It is NOT the marble lab wearing different hats: the concrete scene is configurable so a
21
+ * creator builds their OWN idea. `scene='vessel'` is a glass that fills (water pours in on
22
+ * load, the level rises smoothly as you read it); `vesselObjects` decides whether discrete
23
+ * things drop in (marbles for "marbles → volume") or it's just liquid (a bottle filling at
24
+ * a steady rate, savings growing, charge over time). `scene='none'` drops the twin entirely.
25
+ * Swap the labels, units, colours and objects and the same engine is a dozen different labs.
26
+ */
27
+ const num = (n) => String(Math.round(n * 100) / 100);
28
+ function LinearModelLab(props = {}) {
29
+ const { slope = 5, intercept = 10, given = [0, 1], predictX = 2, xMax = 6, yMax = 40, xStep = 1, yStep = 5, xLabel = "Marbles", yLabel = "Volume", unit = "mL", scene = "vessel", extraScenes = [], vesselObjects = false, vesselBinds = "guess", objectLabel, liquidColor = "var(--stage-accent)", objectColor = "#e85aa6", height = 340, title = "Find the volume", prompt = `Each step adds the same amount. Drag the point to the ${yLabel.toLowerCase()} at ${predictX} ${(objectLabel ?? xLabel).toLowerCase()}.`, activity = "linear-model", ask } = props;
30
+ const rule = (x) => slope * x + intercept;
31
+ const target = rule(predictX);
32
+ const tol = props.tolerance ?? yStep * .5;
33
+ const data = given.map((x) => ({
34
+ x,
35
+ y: rule(x)
36
+ }));
37
+ const [guess, setGuess] = useState({
38
+ x: predictX,
39
+ y: 0
40
+ });
41
+ const solved = Math.abs(guess.y - target) <= tol;
42
+ const moved = guess.y > .001;
43
+ const tone = solved ? "ok" : moved ? "no" : "idle";
44
+ const reduce = useReducedMotion();
45
+ const [filled, setFilled] = useState(false);
46
+ useEffect(() => {
47
+ const t = setTimeout(() => setFilled(true), reduce ? 0 : 80);
48
+ return () => clearTimeout(t);
49
+ }, [reduce]);
50
+ useCheckpoint({
51
+ solved,
52
+ activity,
53
+ response: `${xLabel}=${predictX} → ${num(guess.y)} ${unit}`
54
+ });
55
+ const figure = /* @__PURE__ */ jsx(PredictPlot, {
56
+ data,
57
+ guess,
58
+ onGuess: (p) => setGuess(p),
59
+ tone,
60
+ xMax,
61
+ yMax,
62
+ xStep,
63
+ yStep,
64
+ xLabel,
65
+ yLabel,
66
+ height,
67
+ rule: solved ? {
68
+ slope,
69
+ intercept
70
+ } : null
71
+ });
72
+ const readout = /* @__PURE__ */ jsx(Callout, {
73
+ tone: "result",
74
+ children: /* @__PURE__ */ jsxs("div", {
75
+ style: {
76
+ display: "grid",
77
+ gap: 6,
78
+ fontSize: 13,
79
+ fontVariantNumeric: "tabular-nums"
80
+ },
81
+ children: [
82
+ /* @__PURE__ */ jsxs("span", { children: ["Your reading: ", /* @__PURE__ */ jsxs("strong", {
83
+ style: { color: `var(--stage-${solved ? "good" : moved ? "warn" : "fg"})` },
84
+ children: [
85
+ num(guess.y),
86
+ " ",
87
+ unit
88
+ ]
89
+ })] }),
90
+ /* @__PURE__ */ jsx(Feedback, {
91
+ ok: solved,
92
+ okText: `Spot on, ${num(target)} ${unit}.`,
93
+ tryText: "Read the pattern off the given points."
94
+ }),
95
+ solved && /* @__PURE__ */ jsxs("span", { children: [
96
+ "Rule: ",
97
+ /* @__PURE__ */ jsxs("strong", { children: [
98
+ "+",
99
+ num(slope),
100
+ " ",
101
+ unit
102
+ ] }),
103
+ " per ",
104
+ (objectLabel ?? xLabel).toLowerCase().replace(/s$/, ""),
105
+ "."
106
+ ] })
107
+ ]
108
+ })
109
+ });
110
+ const sceneLabel = `${predictX} ${(objectLabel ?? xLabel).toLowerCase()}`;
111
+ const truthFrac = (filled ? target : 0) / yMax;
112
+ const guessFrac = guess.y / yMax;
113
+ const live = vesselBinds === "guess";
114
+ const levelFrac = live ? guessFrac : truthFrac;
115
+ const readingFrac = live ? void 0 : guessFrac;
116
+ const levelColor = solved ? "var(--stage-good)" : liquidColor;
117
+ const names = scene === "none" ? [] : [scene, ...extraScenes];
118
+ const multi = names.length > 1;
119
+ const dim = multi ? Math.round((height - 8) / names.length) - 6 : height - 8;
120
+ const twins = names.map((name, i) => {
121
+ return /* @__PURE__ */ jsx("div", { children: name === "vessel" ? /* @__PURE__ */ jsx(Vessel, {
122
+ width: multi ? 110 : 132,
123
+ height: dim,
124
+ fillFrac: levelFrac,
125
+ guessFrac: readingFrac,
126
+ guessTone: tone,
127
+ objects: vesselObjects ? predictX : 0,
128
+ liquidColor: levelColor,
129
+ objectColor,
130
+ label: multi ? void 0 : sceneLabel,
131
+ scaleMax: multi ? void 0 : yMax,
132
+ scaleStep: yStep * 2,
133
+ unit
134
+ }) : getScene(name)?.render({
135
+ frac: levelFrac,
136
+ guessFrac: readingFrac,
137
+ guessTone: tone,
138
+ color: levelColor,
139
+ label: multi ? void 0 : sceneLabel,
140
+ width: multi ? 118 : 138,
141
+ height: dim
142
+ }) }, i);
143
+ }).filter((t) => t.props.children);
144
+ return /* @__PURE__ */ jsx(LabFrame, {
145
+ title,
146
+ prompt,
147
+ aside: twins.length ? /* @__PURE__ */ jsxs("div", {
148
+ style: {
149
+ display: "grid",
150
+ gap: 10,
151
+ justifyItems: "center"
152
+ },
153
+ children: [twins, readout]
154
+ }) : readout,
155
+ footer: ask ? /* @__PURE__ */ jsx(LabAsk, {
156
+ ask,
157
+ activity: `${activity}-followup`
158
+ }) : void 0,
159
+ children: figure
160
+ });
161
+ }
162
+
163
+ //#endregion
164
+ export { LinearModelLab };
@@ -10,13 +10,13 @@ import { Axes, Dot, Grid, MovableDot, Plot, Stage } from "@classytic/stage";
10
10
 
11
11
  //#region src/math/linear-system/preset.tsx
12
12
  /**
13
- * LinearSystemLab — two unknowns, two clues, one answer. Each equation is drawn
13
+ * LinearSystemLab, two unknowns, two clues, one answer. Each equation is drawn
14
14
  * as a LINE: every point on it is an (x, y) pair that obeys that clue. The ONE
15
- * point that obeys BOTH clues is where the lines cross — the solution to the
15
+ * point that obeys BOTH clues is where the lines cross, the solution to the
16
16
  * system. The learner drags a marker to find it; live ✓/✗ tells them whether the
17
17
  * point currently satisfies each clue, so the crossing is "where both go green".
18
18
  *
19
- * SVG <Stage> + Plot + a draggable MovableDot — accessible, theme-aware, on the
19
+ * SVG <Stage> + Plot + a draggable MovableDot, accessible, theme-aware, on the
20
20
  * same engine as every other lab. (Lines in slope-intercept y = m·x + b; the
21
21
  * intersection is solved exactly.)
22
22
  */
@@ -32,7 +32,7 @@ const DEFAULT_LINES = [{
32
32
  label: "clue B",
33
33
  color: "var(--stage-accent-2)"
34
34
  }];
35
- function LinearSystemLab({ lines = DEFAULT_LINES, xRange = [-1, 7], yRange = [-1, 7], title = "Two unknowns, one answer", prompt = "Drag the point to where BOTH lines cross — that (x, y) obeys both clues.", height = 360 } = {}) {
35
+ function LinearSystemLab({ lines = DEFAULT_LINES, xRange = [-1, 7], yRange = [-1, 7], title = "Two unknowns, one answer", prompt = "Drag the point to where BOTH lines cross, that (x, y) obeys both clues.", height = 360 } = {}) {
36
36
  const [l1, l2] = lines;
37
37
  const sol = useMemo(() => {
38
38
  const dm = l1.m - l2.m;
@@ -11,9 +11,9 @@ import { Scene, registerAsset } from "@classytic/stage";
11
11
 
12
12
  //#region src/math/mystery-bucket/preset.tsx
13
13
  /**
14
- * MysteryBucket — the essentials opener. A sealed bucket of hidden weight sits
14
+ * MysteryBucket, the essentials opener. A sealed bucket of hidden weight sits
15
15
  * on a balance; the learner adds 1-unit weights to the other pan until the beam
16
- * is level. When it balances, the bucket's weight is revealed — they've "weighed
16
+ * is level. When it balances, the bucket's weight is revealed, they've "weighed
17
17
  * the unknown" with no symbols at all. This is the concrete ground the letter x
18
18
  * (and coefficients, and equations) is built on in later lessons.
19
19
  *
@@ -49,7 +49,7 @@ function mysteryBucketDoc(params) {
49
49
  bindings: []
50
50
  };
51
51
  }
52
- function MysteryBucketLab({ bucketWeight = 5, bucketCount = 1, maxWeights = 12, start = 0, title = "The mystery bucket", prompt = "Add weights until the scale is level — then you’ve weighed the mystery.", height = 340 } = {}) {
52
+ function MysteryBucketLab({ bucketWeight = 5, bucketCount = 1, maxWeights = 12, start = 0, title = "The mystery bucket", prompt = "Add weights until the scale is level, then you’ve weighed the mystery.", height = 340 } = {}) {
53
53
  const buckets = Math.max(1, Math.round(bucketCount));
54
54
  const per = clamp(Math.round(bucketWeight), 1, maxWeights);
55
55
  const total = per * buckets;
@@ -74,15 +74,15 @@ function MysteryBucketLab({ bucketWeight = 5, bucketCount = 1, maxWeights = 12,
74
74
  solved: balanced,
75
75
  activity: "mystery-bucket"
76
76
  });
77
- const reveal = buckets === 1 ? `The bucket weighs ${per}.` : `${buckets} buckets balance ${total} — so each bucket weighs ${per}.`;
78
- const status = balanced ? `Level! ${reveal}` : count < total ? "The bucket side is heavier — add more weights." : "Too heavy now — take some off.";
77
+ const reveal = buckets === 1 ? `The bucket weighs ${per}.` : `${buckets} buckets balance ${total}, so each bucket weighs ${per}.`;
78
+ const status = balanced ? `Level! ${reveal}` : count < total ? "The bucket side is heavier, add more weights." : "Too heavy now, take some off.";
79
79
  const figure = /* @__PURE__ */ jsx(Scene, {
80
80
  doc,
81
81
  interactive: false,
82
82
  showGrid: false,
83
83
  showAxes: false,
84
84
  height,
85
- ariaLabel: `Balance: a mystery bucket against ${count} unit weights — ${balanced ? "level" : "tipping"}`
85
+ ariaLabel: `Balance: a mystery bucket against ${count} unit weights, ${balanced ? "level" : "tipping"}`
86
86
  });
87
87
  return /* @__PURE__ */ jsx(LabFrame, {
88
88
  title,
@@ -10,10 +10,10 @@ import { Dot, Label, MovableDot, Segment, Stage } from "@classytic/stage";
10
10
 
11
11
  //#region src/math/number-line/preset.tsx
12
12
  /**
13
- * NumberLineLab — see a number's place, including BELOW zero. A horizontal line
13
+ * NumberLineLab, see a number's place, including BELOW zero. A horizontal line
14
14
  * with a draggable marker that snaps to integers; optionally pose a target
15
15
  * ("drag to where x lands") so the learner discovers that taking away more than
16
- * you have lands you left of zero — a negative. Reusable for integers,
16
+ * you have lands you left of zero, a negative. Reusable for integers,
17
17
  * inequalities, and the "owing weight" intuition.
18
18
  */
19
19
  const snap = (v) => Math.round(v);
@@ -114,6 +114,7 @@ function NumberLineLab({ min = -8, max = 8, start = 0, target, title = "Number l
114
114
  min,
115
115
  max
116
116
  },
117
+ snap: 1,
117
118
  step: 1,
118
119
  color: markerColor,
119
120
  ariaLabel: "number-line marker"
@@ -8,9 +8,9 @@ import { Axes, Grid, MovableDot, Plot, Stage, Tex } from "@classytic/stage";
8
8
 
9
9
  //#region src/math/parabola/preset.tsx
10
10
  /**
11
- * Vertex-form parabola — drag the vertex (h,k); the curve y = a(x−h)²+k and its
11
+ * Vertex-form parabola, drag the vertex (h,k); the curve y = a(x−h)²+k and its
12
12
  * equation update live. A direct composition of @classytic/stage primitives
13
- * (Plot + a draggable handle + KaTeX), no scene DAG needed — shows the
13
+ * (Plot + a draggable handle + KaTeX), no scene DAG needed, shows the
14
14
  * primitives are usable on their own, not only through <Scene>.
15
15
  */
16
16
  function equationTex(a, h, k) {
@@ -54,6 +54,7 @@ function VertexParabolaLab({ a = 1, height = 380 }) {
54
54
  x: Math.round(p.x),
55
55
  y: Math.round(p.y)
56
56
  }),
57
+ snap: 1,
57
58
  color: "var(--stage-good)",
58
59
  ariaLabel: "parabola vertex"
59
60
  })
@@ -66,7 +67,7 @@ function VertexParabolaLab({ a = 1, height = 380 }) {
66
67
  children: [
67
68
  "Drag the ",
68
69
  /* @__PURE__ */ jsx("strong", { children: "vertex" }),
69
- " — the curve and the equation update. Vertex form ",
70
+ ", the curve and the equation update. Vertex form ",
70
71
  /* @__PURE__ */ jsx(Tex$1, { tex: "y = a(x-h)^2 + k" }),
71
72
  "."
72
73
  ]
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { CheckButton, Chip, LabStyles, StatusPill, Stepper } from "../../kit/controls.mjs";
4
- import { ControlBar, LabFrame, LiveRegion } from "../../kit/frame.mjs";
4
+ import { ControlBar, ControlExpr, LabFrame, LiveRegion } from "../../kit/frame.mjs";
5
5
  import { useCheckpoint } from "../../kit/pedagogy.mjs";
6
6
  import { PATTERN_FIGURE_ASSET } from "./asset.mjs";
7
7
  import { useMemo, useState } from "react";
@@ -10,7 +10,7 @@ import { Scene, controlsFromScene, registerAsset, resolve, useControlSurface, us
10
10
 
11
11
  //#region src/math/pattern/preset.tsx
12
12
  /**
13
- * Growing pattern → formula — a SceneDoc FACTORY (Brilliant-style visual
13
+ * Growing pattern → formula, a SceneDoc FACTORY (Brilliant-style visual
14
14
  * algebra), built on @classytic/stage. A creator declares the linear rule
15
15
  * count(n) = a·n + b; the template GENERATES the figures for n = 1..k and asks
16
16
  * the learner to find the rule. A linear rule is fixed by any two points, so
@@ -219,11 +219,8 @@ function GrowingPatternLab({ a = 2, b = 3, steps = 4, prompt = "Find the rule fo
219
219
  return /* @__PURE__ */ jsx(LabFrame, {
220
220
  prompt,
221
221
  controls: /* @__PURE__ */ jsxs(ControlBar, { children: [
222
- check === "steppers" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
223
- /* @__PURE__ */ jsx("span", {
224
- style: { fontWeight: 600 },
225
- children: "Your rule:"
226
- }),
222
+ check === "steppers" ? /* @__PURE__ */ jsxs(ControlExpr, { children: [
223
+ /* @__PURE__ */ jsx("span", { children: "Your rule:" }),
227
224
  /* @__PURE__ */ jsx(Stepper, {
228
225
  label: "a",
229
226
  value: aGuess,
@@ -234,10 +231,7 @@ function GrowingPatternLab({ a = 2, b = 3, steps = 4, prompt = "Find the rule fo
234
231
  setResult(null);
235
232
  }
236
233
  }),
237
- /* @__PURE__ */ jsx("span", {
238
- className: "sep",
239
- children: "· n \xA0+"
240
- }),
234
+ /* @__PURE__ */ jsx("span", { children: "· n\xA0+" }),
241
235
  /* @__PURE__ */ jsx(Stepper, {
242
236
  label: "b",
243
237
  value: bGuess,
@@ -275,14 +269,14 @@ function GrowingPatternLab({ a = 2, b = 3, steps = 4, prompt = "Find the rule fo
275
269
  result === "correct" && /* @__PURE__ */ jsxs(StatusPill, {
276
270
  ok: true,
277
271
  children: [
278
- "✓ Correct — predicts n = ",
272
+ "✓ Correct, predicts n = ",
279
273
  predictN,
280
274
  " too!"
281
275
  ]
282
276
  }),
283
277
  result === "wrong" && /* @__PURE__ */ jsx(StatusPill, {
284
278
  ok: false,
285
- children: "Not quite — match every step"
279
+ children: "Not quite, match every step"
286
280
  })
287
281
  ] }),
288
282
  footer: /* @__PURE__ */ jsx(LiveRegion, { children: result === "correct" ? `Correct. The rule is ${answer}.` : "" }),
@@ -0,0 +1 @@
1
+ import { PercentBarLab, PercentBarProps, PercentSegment } from "./preset.mjs";
@@ -0,0 +1,37 @@
1
+ import { ReactNode } from "react";
2
+
3
+ //#region src/math/percent-bar/preset.d.ts
4
+ interface PercentSegment {
5
+ /** Share of the whole, 0..1 (segments are normalized together). */
6
+ frac: number;
7
+ label?: string;
8
+ color?: string;
9
+ }
10
+ interface PercentBarProps {
11
+ /** The quantity the full bar represents (100%). Default 100. */
12
+ whole?: number;
13
+ /** Unit on the concrete amount, e.g. "students", "mL", "$". */
14
+ unit?: string;
15
+ /** Starting fill in percent (0..100). Default 0. */
16
+ start?: number;
17
+ /** Goal in percent; solved when the fill lands on it. Omit for free explore. */
18
+ target?: number;
19
+ /** Snap granularity in percent. Default 5. */
20
+ snapPct?: number;
21
+ /** Show the concrete amount (percent × whole) alongside the percent. */
22
+ showValue?: boolean;
23
+ /** Optional authored breakdown drawn on a reference bar above the slider. */
24
+ segments?: PercentSegment[];
25
+ /** Caption for the reference bar (e.g. "The class", "Monthly budget"). */
26
+ referenceLabel?: string;
27
+ /** Optional concrete twin of the percentage: any level scene ('pie' | 'battery' |
28
+ * 'jar' | 'balloon' | …). A percentage shown as a pie filling is the obvious one. */
29
+ scene?: string;
30
+ height?: number;
31
+ title?: string;
32
+ prompt?: string;
33
+ activity?: string;
34
+ }
35
+ declare function PercentBarLab(props?: PercentBarProps): ReactNode;
36
+ //#endregion
37
+ export { PercentBarLab, PercentBarProps, PercentSegment };