@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.
- package/dist/_virtual/_rolldown/runtime.mjs +18 -0
- package/dist/biology/enzyme-rate/preset.mjs +5 -5
- package/dist/biology/genetic-cross/core.d.mts +7 -7
- package/dist/biology/genetic-cross/core.mjs +4 -4
- package/dist/biology/genetic-cross/grid.mjs +132 -123
- package/dist/biology/genetic-cross/preset.mjs +4 -4
- package/dist/biology/genetic-cross/sex-linked.mjs +7 -7
- package/dist/biology/photosynthesis-factors/preset.mjs +8 -8
- package/dist/biology/respiration/preset.mjs +4 -4
- package/dist/biology/sequence/central-dogma.mjs +5 -5
- package/dist/biology/sequence/core.d.mts +6 -6
- package/dist/biology/sequence/core.mjs +1 -1
- package/dist/biology/sequence/preset.mjs +6 -6
- package/dist/blocks/authoring.mjs +5 -5
- package/dist/blocks/biology.d.mts +2 -2
- package/dist/blocks/biology.mjs +5 -5
- package/dist/blocks/chem.d.mts +2 -2
- package/dist/blocks/chem.mjs +13 -13
- package/dist/blocks/circuits.d.mts +293 -4
- package/dist/blocks/circuits.mjs +874 -9
- package/dist/blocks/discrete.d.mts +30 -2
- package/dist/blocks/discrete.mjs +74 -4
- package/dist/blocks/economics.mjs +1 -1
- package/dist/blocks/geography.mjs +1 -1
- package/dist/blocks/geometry.mjs +3 -3
- package/dist/blocks/ict.d.mts +90 -1
- package/dist/blocks/ict.mjs +217 -7
- package/dist/blocks/index.d.mts +3064 -657
- package/dist/blocks/index.mjs +9 -9
- package/dist/blocks/lab-block.mjs +5 -5
- package/dist/blocks/lab-config.d.mts +1 -1
- package/dist/blocks/lab-config.mjs +4 -4
- package/dist/blocks/lab-gallery.d.mts +1 -1
- package/dist/blocks/lab-gallery.mjs +2 -2
- package/dist/blocks/language.d.mts +6 -6
- package/dist/blocks/language.mjs +12 -12
- package/dist/blocks/lesson.mjs +4 -4
- package/dist/blocks/math.d.mts +577 -11
- package/dist/blocks/math.mjs +1648 -14
- package/dist/blocks/ml.d.mts +45 -1
- package/dist/blocks/ml.mjs +80 -6
- package/dist/blocks/physics.d.mts +9 -4
- package/dist/blocks/physics.mjs +75 -28
- package/dist/blocks/statistics.mjs +1 -1
- package/dist/build/CircuitEditor.d.mts +14 -0
- package/dist/build/CircuitEditor.mjs +787 -0
- package/dist/build/CircuitPlayer.d.mts +19 -0
- package/dist/build/CircuitPlayer.mjs +53 -0
- package/dist/build/CircuitScene.d.mts +61 -0
- package/dist/build/CircuitScene.mjs +383 -0
- package/dist/build/contract.d.mts +116 -0
- package/dist/build/editor-ops.d.mts +65 -0
- package/dist/build/editor-ops.mjs +306 -0
- package/dist/build/editor-ui.mjs +121 -0
- package/dist/build/flow.d.mts +14 -0
- package/dist/build/flow.mjs +119 -0
- package/dist/build/index.d.mts +10 -0
- package/dist/build/index.mjs +10 -0
- package/dist/build/parts/ammeter.d.mts +1 -0
- package/dist/build/parts/ammeter.mjs +32 -0
- package/dist/build/parts/bulb.d.mts +1 -0
- package/dist/build/parts/bulb.mjs +50 -0
- package/dist/build/parts/capacitor.d.mts +1 -0
- package/dist/build/parts/capacitor.mjs +26 -0
- package/dist/build/parts/cell.d.mts +1 -0
- package/dist/build/parts/cell.mjs +40 -0
- package/dist/build/parts/diode.d.mts +1 -0
- package/dist/build/parts/diode.mjs +33 -0
- package/dist/build/parts/index.d.mts +5 -0
- package/dist/build/parts/index.mjs +43 -0
- package/dist/build/parts/mosfet.d.mts +1 -0
- package/dist/build/parts/mosfet.mjs +95 -0
- package/dist/build/parts/node.d.mts +1 -0
- package/dist/build/parts/node.mjs +32 -0
- package/dist/build/parts/resistor.d.mts +1 -0
- package/dist/build/parts/resistor.mjs +49 -0
- package/dist/build/parts/shared.mjs +42 -0
- package/dist/build/parts/switch.d.mts +1 -0
- package/dist/build/parts/switch.mjs +34 -0
- package/dist/build/parts.d.mts +1 -0
- package/dist/build/registry.d.mts +9 -0
- package/dist/build/registry.mjs +15 -0
- package/dist/build/solve.d.mts +8 -0
- package/dist/build/solve.mjs +0 -0
- package/dist/catalog/registry.d.mts +2 -2
- package/dist/catalog/templates.d.mts +1 -1
- package/dist/catalog/templates.mjs +6 -6
- package/dist/chem/battery.mjs +1 -1
- package/dist/chem/bohr-atom.mjs +4 -4
- package/dist/chem/diffusion/preset.mjs +4 -4
- package/dist/chem/electrochem/preset.mjs +5 -5
- package/dist/chem/equilibrium/preset.d.mts +1 -1
- package/dist/chem/equilibrium/preset.mjs +6 -6
- package/dist/chem/gas-box/preset.mjs +6 -6
- package/dist/chem/kinetics/preset.mjs +6 -6
- package/dist/chem/periodic-trends/preset.mjs +7 -7
- package/dist/chem/reaction-lab.mjs +3 -3
- package/dist/chem/reaction-profile.mjs +4 -4
- package/dist/chem/solution/dilution.mjs +6 -6
- package/dist/chem/solution/field.d.mts +2 -2
- package/dist/chem/solution/field.mjs +2 -2
- package/dist/chem/solution/solution-box.mjs +7 -7
- package/dist/chem/stoichiometry/preset.mjs +5 -5
- package/dist/chem/titration/preset.mjs +5 -5
- package/dist/circuits/ac-dc/asset.mjs +1 -1
- package/dist/circuits/ac-dc/preset.mjs +2 -2
- package/dist/circuits/brownout/index.d.mts +1 -0
- package/dist/circuits/brownout/preset.d.mts +22 -0
- package/dist/circuits/brownout/preset.mjs +399 -0
- package/dist/circuits/capacitor-leak/preset.mjs +13 -8
- package/dist/circuits/circuit/asset.mjs +71 -14
- package/dist/circuits/circuit/preset.mjs +23 -5
- package/dist/circuits/circuit-builder.mjs +60 -132
- package/dist/circuits/circuit-lab.mjs +60 -40
- package/dist/circuits/cmos-gate/index.d.mts +1 -0
- package/dist/circuits/cmos-gate/preset.d.mts +75 -0
- package/dist/circuits/cmos-gate/preset.mjs +1491 -0
- package/dist/circuits/diode/index.d.mts +1 -0
- package/dist/circuits/diode/preset.d.mts +25 -0
- package/dist/circuits/diode/preset.mjs +266 -0
- package/dist/circuits/index.d.mts +7 -1
- package/dist/circuits/index.mjs +7 -1
- package/dist/circuits/rc-charging/index.d.mts +1 -0
- package/dist/circuits/rc-charging/preset.d.mts +27 -0
- package/dist/circuits/rc-charging/preset.mjs +329 -0
- package/dist/circuits/semiconductor/index.d.mts +1 -0
- package/dist/circuits/semiconductor/preset.d.mts +102 -0
- package/dist/circuits/semiconductor/preset.mjs +1855 -0
- package/dist/circuits/transistor/index.d.mts +1 -0
- package/dist/circuits/transistor/preset.d.mts +27 -0
- package/dist/circuits/transistor/preset.mjs +329 -0
- package/dist/commerce/accounting/core.d.mts +1 -1
- package/dist/commerce/accounting/equation-balance.mjs +5 -5
- package/dist/commerce/accounting/journal-poster.mjs +8 -8
- package/dist/commerce/accounting/statement-sorter.mjs +4 -4
- package/dist/commerce/economics/core.d.mts +2 -2
- package/dist/commerce/economics/core.mjs +1 -1
- package/dist/commerce/economics/demand-shift-vs-move.mjs +6 -6
- package/dist/commerce/economics/elasticity-revenue.mjs +6 -6
- package/dist/commerce/economics/market-equilibrium.mjs +5 -5
- package/dist/core/easing.d.mts +3 -3
- package/dist/core/easing.mjs +2 -2
- package/dist/core/numeric.d.mts +3 -3
- package/dist/core/numeric.mjs +2 -2
- package/dist/core/reactive.d.mts +1 -1
- package/dist/core/reactive.mjs +1 -1
- package/dist/core/rng.d.mts +2 -2
- package/dist/core/rng.mjs +1 -1
- package/dist/core/tex.mjs +2 -2
- package/dist/core/timeline.d.mts +1 -1
- package/dist/core/timeline.mjs +1 -1
- package/dist/core/util.mjs +11 -1
- package/dist/discrete/arrangements/preset.mjs +6 -14
- package/dist/discrete/bayes/preset.mjs +43 -35
- package/dist/discrete/binomial/preset.mjs +2 -2
- package/dist/discrete/combination-studio/figure.d.mts +6 -0
- package/dist/discrete/combination-studio/figure.mjs +159 -0
- package/dist/discrete/combination-studio/index.d.mts +2 -0
- package/dist/discrete/combination-studio/preset.d.mts +44 -0
- package/dist/discrete/combination-studio/preset.mjs +440 -0
- package/dist/discrete/core/combinatorics.d.mts +23 -3
- package/dist/discrete/core/combinatorics.mjs +38 -3
- package/dist/discrete/core/pigeonhole.d.mts +1 -1
- package/dist/discrete/core/pigeonhole.mjs +1 -1
- package/dist/discrete/core/probability.d.mts +3 -3
- package/dist/discrete/core/probability.mjs +3 -3
- package/dist/discrete/core/sets.d.mts +1 -1
- package/dist/discrete/counting-slots/preset.mjs +8 -8
- package/dist/discrete/counting-tree/preset.mjs +65 -8
- package/dist/discrete/expected-value/preset.mjs +13 -13
- package/dist/discrete/hypergeometric/preset.mjs +48 -15
- package/dist/discrete/index.d.mts +4 -2
- package/dist/discrete/index.mjs +4 -2
- package/dist/discrete/karnaugh/preset.mjs +26 -20
- package/dist/discrete/lln/preset.mjs +44 -3
- package/dist/discrete/logic-circuit/preset.mjs +2 -2
- package/dist/discrete/monte-carlo/preset.d.mts +1 -1
- package/dist/discrete/monte-carlo/preset.mjs +14 -14
- package/dist/discrete/monty-hall/preset.mjs +6 -6
- package/dist/discrete/outcome-builder/preset.mjs +3 -3
- package/dist/discrete/pascal/preset.mjs +37 -7
- package/dist/discrete/rules.d.mts +20 -0
- package/dist/discrete/rules.mjs +264 -0
- package/dist/discrete/sample-space/preset.mjs +4 -4
- package/dist/discrete/selection/preset.mjs +7 -13
- package/dist/discrete/truth-table/preset.mjs +32 -9
- package/dist/discrete/venn/preset.mjs +71 -48
- package/dist/geography/cycle-lab/preset.mjs +17 -10
- package/dist/geography/cycles.d.mts +3 -3
- package/dist/geography/cycles.mjs +3 -3
- package/dist/geometry/board/preset.d.mts +2 -0
- package/dist/geometry/board/preset.mjs +11 -15
- package/dist/geometry/builder.mjs +3 -3
- package/dist/ict/number-systems/base-odometer.mjs +4 -4
- package/dist/ict/number-systems/bit-grouper.d.mts +1 -1
- package/dist/ict/number-systems/bit-grouper.mjs +4 -4
- package/dist/ict/number-systems/place-value-dial.d.mts +1 -1
- package/dist/ict/number-systems/place-value-dial.mjs +3 -3
- package/dist/ict/number-systems/wheel.d.mts +3 -3
- package/dist/ict/number-systems/wheel.mjs +4 -4
- package/dist/kit/annotate.mjs +3 -3
- package/dist/kit/answer-check.d.mts +2 -2
- package/dist/kit/answer-check.mjs +34 -6
- package/dist/kit/ask.d.mts +19 -0
- package/dist/kit/ask.mjs +46 -0
- package/dist/kit/bar-strip.mjs +53 -0
- package/dist/kit/calc.d.mts +33 -0
- package/dist/kit/calc.mjs +27 -0
- package/dist/kit/carrier-engine.mjs +147 -0
- package/dist/kit/clue-scene.d.mts +86 -0
- package/dist/kit/clue-scene.mjs +424 -0
- package/dist/kit/cluster.d.mts +30 -0
- package/dist/kit/cluster.mjs +81 -0
- package/dist/kit/controls.mjs +11 -5
- package/dist/kit/coords.d.mts +88 -0
- package/dist/kit/coords.mjs +192 -0
- package/dist/kit/data-scene.d.mts +27 -0
- package/dist/kit/data-scene.mjs +199 -0
- package/dist/kit/diagram.mjs +111 -50
- package/dist/kit/electronics.mjs +552 -60
- package/dist/kit/expr-analysis.d.mts +18 -6
- package/dist/kit/expr-analysis.mjs +82 -28
- package/dist/kit/frame.d.mts +3 -3
- package/dist/kit/frame.mjs +25 -6
- package/dist/kit/gameshow.mjs +2 -2
- package/dist/kit/index.d.mts +14 -2
- package/dist/kit/index.mjs +13 -1
- package/dist/kit/logic-gates.mjs +246 -47
- package/dist/kit/palette.mjs +26 -0
- package/dist/kit/pedagogy.d.mts +4 -4
- package/dist/kit/pedagogy.mjs +21 -17
- package/dist/kit/play.d.mts +1 -1
- package/dist/kit/play.mjs +3 -3
- package/dist/kit/predict.d.mts +55 -0
- package/dist/kit/predict.mjs +146 -0
- package/dist/kit/receipt.d.mts +29 -0
- package/dist/kit/receipt.mjs +94 -0
- package/dist/kit/rich.mjs +2 -2
- package/dist/kit/rule.d.mts +59 -0
- package/dist/kit/rule.mjs +215 -0
- package/dist/kit/scale.mjs +1 -1
- package/dist/kit/scene-library.d.mts +22 -0
- package/dist/kit/scene-library.mjs +311 -0
- package/dist/kit/scene-studio.d.mts +14 -0
- package/dist/kit/scene-studio.mjs +338 -0
- package/dist/kit/scenes.d.mts +31 -0
- package/dist/kit/scenes.mjs +569 -0
- package/dist/kit/slot-fill.d.mts +61 -0
- package/dist/kit/slot-fill.mjs +207 -0
- package/dist/kit/solve.d.mts +21 -0
- package/dist/kit/solve.mjs +75 -0
- package/dist/kit/space.mjs +5 -5
- package/dist/kit/steps.mjs +2 -2
- package/dist/kit/vessel.d.mts +69 -0
- package/dist/kit/vessel.mjs +191 -0
- package/dist/language/agreement/preset.mjs +2 -2
- package/dist/language/article-lens/preset.d.mts +1 -1
- package/dist/language/article-lens/preset.mjs +8 -8
- package/dist/language/deck.d.mts +3 -3
- package/dist/language/deck.mjs +1 -1
- package/dist/language/preposition-scene/preset.d.mts +2 -2
- package/dist/language/preposition-scene/preset.mjs +5 -5
- package/dist/language/sentence-builder/preset.mjs +5 -5
- package/dist/language/transform/preset.d.mts +2 -2
- package/dist/language/transform/preset.mjs +5 -5
- package/dist/language/ui.d.mts +3 -3
- package/dist/language/ui.mjs +4 -4
- package/dist/language/word-match/preset.mjs +3 -3
- package/dist/logic/LogicBuildLab.d.mts +22 -0
- package/dist/logic/LogicBuildLab.mjs +170 -0
- package/dist/logic/LogicEditScene.d.mts +31 -0
- package/dist/logic/LogicEditScene.mjs +276 -0
- package/dist/logic/LogicEditor.d.mts +14 -0
- package/dist/logic/LogicEditor.mjs +413 -0
- package/dist/logic/LogicScene.d.mts +32 -0
- package/dist/logic/LogicScene.mjs +277 -0
- package/dist/logic/contract.d.mts +72 -0
- package/dist/logic/display.d.mts +24 -0
- package/dist/logic/display.mjs +127 -0
- package/dist/logic/edit-ops.d.mts +44 -0
- package/dist/logic/edit-ops.mjs +177 -0
- package/dist/logic/evaluate.d.mts +11 -0
- package/dist/logic/evaluate.mjs +93 -0
- package/dist/logic/gates.d.mts +10 -0
- package/dist/logic/gates.mjs +73 -0
- package/dist/logic/index.d.mts +14 -0
- package/dist/logic/index.mjs +13 -0
- package/dist/logic/lab.d.mts +32 -0
- package/dist/logic/lab.mjs +160 -0
- package/dist/logic/presets.d.mts +12 -0
- package/dist/logic/presets.mjs +241 -0
- package/dist/logic/registry.d.mts +9 -0
- package/dist/logic/registry.mjs +15 -0
- package/dist/math/area-model/preset.mjs +70 -44
- package/dist/math/balance-algebra/preset.mjs +14 -5
- package/dist/math/broken-tree/index.d.mts +1 -0
- package/dist/math/broken-tree/preset.d.mts +26 -0
- package/dist/math/broken-tree/preset.mjs +435 -0
- package/dist/math/circle/index.d.mts +1 -0
- package/dist/math/circle/preset.d.mts +44 -0
- package/dist/math/circle/preset.mjs +198 -0
- package/dist/math/complex/core.d.mts +93 -0
- package/dist/math/complex/core.mjs +239 -0
- package/dist/math/complex/index.d.mts +3 -0
- package/dist/math/complex/preset.d.mts +31 -0
- package/dist/math/complex/preset.mjs +377 -0
- package/dist/math/complex/rules.d.mts +6 -0
- package/dist/math/complex/rules.mjs +121 -0
- package/dist/math/conic/index.d.mts +1 -0
- package/dist/math/conic/preset.d.mts +30 -0
- package/dist/math/conic/preset.mjs +334 -0
- package/dist/math/derivation.mjs +5 -5
- package/dist/math/derivative-explorer/preset.mjs +5 -5
- package/dist/math/domain-range/index.d.mts +1 -0
- package/dist/math/domain-range/preset.d.mts +33 -0
- package/dist/math/domain-range/preset.mjs +313 -0
- package/dist/math/fraction-bar/index.d.mts +1 -0
- package/dist/math/fraction-bar/preset.d.mts +27 -0
- package/dist/math/fraction-bar/preset.mjs +197 -0
- package/dist/math/function-machine/preset.mjs +2 -2
- package/dist/math/gradient-descent.mjs +6 -6
- package/dist/math/grapher/preset.d.mts +1 -1
- package/dist/math/grapher/preset.mjs +4 -4
- package/dist/math/harmonic-form/preset.mjs +6 -6
- package/dist/math/index.d.mts +27 -2
- package/dist/math/index.mjs +27 -2
- package/dist/math/integral-explorer/preset.mjs +2 -2
- package/dist/math/interactive/preset.mjs +3 -3
- package/dist/math/limit-explorer/preset.mjs +4 -4
- package/dist/math/linear-model/index.d.mts +1 -0
- package/dist/math/linear-model/preset.d.mts +53 -0
- package/dist/math/linear-model/preset.mjs +164 -0
- package/dist/math/linear-system/preset.mjs +4 -4
- package/dist/math/mystery-bucket/preset.mjs +6 -6
- package/dist/math/number-line/preset.mjs +3 -2
- package/dist/math/parabola/preset.mjs +4 -3
- package/dist/math/pattern/preset.mjs +7 -13
- package/dist/math/percent-bar/index.d.mts +1 -0
- package/dist/math/percent-bar/preset.d.mts +37 -0
- package/dist/math/percent-bar/preset.mjs +275 -0
- package/dist/math/poly/core.d.mts +50 -0
- package/dist/math/poly/core.mjs +268 -0
- package/dist/math/poly/index.d.mts +3 -0
- package/dist/math/poly/preset.d.mts +23 -0
- package/dist/math/poly/preset.mjs +141 -0
- package/dist/math/poly/steps.d.mts +10 -0
- package/dist/math/poly/steps.mjs +99 -0
- package/dist/math/rate-machine/index.d.mts +1 -0
- package/dist/math/rate-machine/preset.d.mts +35 -0
- package/dist/math/rate-machine/preset.mjs +281 -0
- package/dist/math/ratio-share/index.d.mts +1 -0
- package/dist/math/ratio-share/preset.d.mts +24 -0
- package/dist/math/ratio-share/preset.mjs +204 -0
- package/dist/math/receipt/index.d.mts +1 -0
- package/dist/math/receipt/preset.d.mts +22 -0
- package/dist/math/receipt/preset.mjs +137 -0
- package/dist/math/sequence-predict/index.d.mts +1 -0
- package/dist/math/sequence-predict/preset.d.mts +34 -0
- package/dist/math/sequence-predict/preset.mjs +130 -0
- package/dist/math/straight-line/index.d.mts +1 -0
- package/dist/math/straight-line/preset.d.mts +37 -0
- package/dist/math/straight-line/preset.mjs +374 -0
- package/dist/math/system-solve/index.d.mts +1 -0
- package/dist/math/system-solve/preset.d.mts +21 -0
- package/dist/math/system-solve/preset.mjs +227 -0
- package/dist/math/transform/index.d.mts +1 -0
- package/dist/math/transform/preset.d.mts +41 -0
- package/dist/math/transform/preset.mjs +343 -0
- package/dist/math/triangle-trig/preset.mjs +12 -9
- package/dist/math/trig/core.d.mts +37 -0
- package/dist/math/trig/core.mjs +150 -0
- package/dist/math/trig/diagrams.d.mts +1 -0
- package/dist/math/trig/diagrams.mjs +321 -0
- package/dist/math/trig/index.d.mts +3 -0
- package/dist/math/trig/preset.d.mts +25 -0
- package/dist/math/trig/preset.mjs +260 -0
- package/dist/math/trig/rules.d.mts +6 -0
- package/dist/math/trig/rules.mjs +159 -0
- package/dist/math/trig-explorer.mjs +4 -4
- package/dist/ml/boundary/preset.mjs +8 -3
- package/dist/ml/classifier/preset.mjs +31 -6
- package/dist/ml/kmeans/preset.mjs +4 -4
- package/dist/ml/knn/preset.mjs +47 -12
- package/dist/ml/regression/preset.mjs +36 -7
- package/dist/physics/atwood/preset.mjs +4 -4
- package/dist/physics/bullet-walls/preset.d.mts +1 -1
- package/dist/physics/bullet-walls/preset.mjs +7 -7
- package/dist/physics/carnot/preset.mjs +6 -6
- package/dist/physics/circular-motion/preset.mjs +36 -5
- package/dist/physics/collision-track/preset.mjs +35 -5
- package/dist/physics/efficiency/preset.d.mts +2 -2
- package/dist/physics/efficiency/preset.mjs +5 -5
- package/dist/physics/electric-field/preset.mjs +32 -23
- package/dist/physics/electric-flux/index.d.mts +1 -0
- package/dist/physics/electric-flux/preset.d.mts +29 -0
- package/dist/physics/electric-flux/preset.mjs +264 -0
- package/dist/physics/energy-skate/preset.mjs +5 -5
- package/dist/physics/entropy/preset.mjs +7 -7
- package/dist/physics/expansion/preset.mjs +13 -13
- package/dist/physics/exponential/asset.mjs +1 -1
- package/dist/physics/exponential/preset.mjs +4 -4
- package/dist/physics/gas-process/preset.mjs +3 -3
- package/dist/physics/gauss-law/index.d.mts +1 -0
- package/dist/physics/gauss-law/preset.d.mts +20 -0
- package/dist/physics/gauss-law/preset.mjs +286 -0
- package/dist/physics/gravitation/preset.mjs +7 -7
- package/dist/physics/gravity-drop.mjs +4 -4
- package/dist/physics/heat-transfer/preset.d.mts +1 -1
- package/dist/physics/heat-transfer/preset.mjs +10 -10
- package/dist/physics/impulse/preset.mjs +5 -5
- package/dist/physics/index.d.mts +4 -1
- package/dist/physics/index.mjs +4 -1
- package/dist/physics/kepler/preset.mjs +4 -4
- package/dist/physics/lever/preset.mjs +3 -3
- package/dist/physics/lorentz/preset.mjs +11 -11
- package/dist/physics/magnetism/preset.mjs +3 -3
- package/dist/physics/optics/preset.mjs +2 -2
- package/dist/physics/orbit-lab.mjs +5 -5
- package/dist/physics/projectile-lab.mjs +4 -4
- package/dist/physics/rain-relative/preset.mjs +5 -5
- package/dist/physics/ramp-forces/preset.mjs +5 -5
- package/dist/physics/river-boat.mjs +6 -6
- package/dist/physics/shm/preset.mjs +9 -9
- package/dist/physics/stopping-distance/preset.mjs +3 -3
- package/dist/physics/temperature-scales/preset.mjs +105 -116
- package/dist/physics/terminal-velocity/preset.mjs +5 -5
- package/dist/physics/thermal/preset.mjs +5 -5
- package/dist/physics/vector-board/preset.mjs +7 -6
- package/dist/physics/vector-scene.mjs +2 -2
- package/dist/physics/vector-types/preset.mjs +37 -3
- package/dist/physics/water-density/preset.mjs +12 -12
- package/dist/physics/waves/doppler.mjs +2 -2
- package/dist/physics/waves/preset.mjs +4 -4
- package/dist/physics/waves/ripple.mjs +6 -6
- package/dist/physics/waves/string.mjs +5 -5
- package/dist/physics/work-energy/preset.mjs +4 -4
- package/dist/physics/work-potential/index.d.mts +1 -0
- package/dist/physics/work-potential/preset.d.mts +20 -0
- package/dist/physics/work-potential/preset.mjs +276 -0
- package/dist/schemas/index.d.mts +6 -6
- package/dist/schemas/index.mjs +3 -3
- package/dist/statistics/center-spread/preset.mjs +3 -3
- package/dist/statistics/core/descriptive.d.mts +2 -2
- package/dist/statistics/core/descriptive.mjs +2 -2
- package/dist/statistics/core/normal.d.mts +3 -3
- package/dist/statistics/core/normal.mjs +3 -3
- package/dist/statistics/core/sequences.d.mts +1 -1
- package/dist/statistics/galton/preset.mjs +2 -2
- package/dist/statistics/histogram/preset.mjs +6 -6
- package/dist/statistics/normal/preset.mjs +2 -2
- package/dist/statistics/sampling/preset.mjs +4 -4
- package/dist/statistics/sequence/preset.mjs +58 -15
- package/dist/statistics/z-table/preset.mjs +17 -4
- package/package.json +11 -3
- package/styles.css +4 -1
|
@@ -12,13 +12,13 @@ import { CanvasLayer, useControlSurface } from "@classytic/stage";
|
|
|
12
12
|
|
|
13
13
|
//#region src/physics/waves/ripple.tsx
|
|
14
14
|
/**
|
|
15
|
-
* RippleTankLab
|
|
15
|
+
* RippleTankLab, two-source interference in 2-D, the famous ripple tank. Two point
|
|
16
16
|
* sources send out circular waves; where crests meet crests the water heaves
|
|
17
17
|
* (CONSTRUCTIVE, a bright antinodal line, path difference = nλ) and where a crest
|
|
18
18
|
* meets a trough it goes flat (DESTRUCTIVE, a dark nodal line, Δ = (n+½)λ). Drag the
|
|
19
19
|
* sources, change the wavelength, and the fan of interference fringes opens and
|
|
20
20
|
* closes. Two views: "ripples" (the live animated field) and "fringes" (the static
|
|
21
|
-
* interference amplitude
|
|
21
|
+
* interference amplitude, crisp bright/dark hyperbolas).
|
|
22
22
|
*
|
|
23
23
|
* A genuine per-cell field → CanvasLayer heatmap. Distances are in pixels so the
|
|
24
24
|
* wavefronts stay circular regardless of the box's aspect. Honours reduced-motion.
|
|
@@ -29,7 +29,7 @@ const VIEW = {
|
|
|
29
29
|
yMin: 0,
|
|
30
30
|
yMax: 1
|
|
31
31
|
};
|
|
32
|
-
function RippleTankLab({ wavelength = .1, view: view0 = "ripples", title = "Ripple tank
|
|
32
|
+
function RippleTankLab({ wavelength = .1, view: view0 = "ripples", title = "Ripple tank: two-source interference", prompt, objectives, hints: hintList, controlId, height = 320 }) {
|
|
33
33
|
const [lam, setLam] = useState(wavelength);
|
|
34
34
|
const [view, setView] = useState(view0);
|
|
35
35
|
const [mounted, setMounted] = useState(false);
|
|
@@ -166,14 +166,14 @@ function RippleTankLab({ wavelength = .1, view: view0 = "ripples", title = "Ripp
|
|
|
166
166
|
style: { color: "var(--stage-good)" },
|
|
167
167
|
children: "bright"
|
|
168
168
|
}),
|
|
169
|
-
"
|
|
169
|
+
", crests meet · ",
|
|
170
170
|
/* @__PURE__ */ jsx(Tex$1, { tex: "\\Delta = n\\lambda" })
|
|
171
171
|
] }), /* @__PURE__ */ jsxs("span", { children: [
|
|
172
172
|
/* @__PURE__ */ jsx("span", {
|
|
173
173
|
style: { color: "var(--stage-accent)" },
|
|
174
174
|
children: "dark"
|
|
175
175
|
}),
|
|
176
|
-
"
|
|
176
|
+
", crest + trough · ",
|
|
177
177
|
/* @__PURE__ */ jsx(Tex$1, { tex: "\\Delta = \\left(n + \\tfrac12\\right)\\lambda" })
|
|
178
178
|
] })]
|
|
179
179
|
})]
|
|
@@ -181,7 +181,7 @@ function RippleTankLab({ wavelength = .1, view: view0 = "ripples", title = "Ripp
|
|
|
181
181
|
className: "lab-prompt",
|
|
182
182
|
style: { fontSize: 13 },
|
|
183
183
|
children: [
|
|
184
|
-
view === "fringes" ? "Static interference pattern: the bright hyperbolas are where the two waves always reinforce; the dark ones where they always cancel." : "Live ripples
|
|
184
|
+
view === "fringes" ? "Static interference pattern: the bright hyperbolas are where the two waves always reinforce; the dark ones where they always cancel." : "Live ripples, watch crests collide. The still (grey) lines between the churn are where the waves cancel.",
|
|
185
185
|
" ",
|
|
186
186
|
"Shorter wavelength or wider sources → more, tighter fringes."
|
|
187
187
|
]
|
|
@@ -12,14 +12,14 @@ import { CanvasLayer, useControlSurface } from "@classytic/stage";
|
|
|
12
12
|
|
|
13
13
|
//#region src/physics/waves/string.tsx
|
|
14
14
|
/**
|
|
15
|
-
* StringReflectionLab
|
|
16
|
-
* • pulse
|
|
15
|
+
* StringReflectionLab, where standing waves COME FROM. Two lessons in one string:
|
|
16
|
+
* • pulse, send a single bump down the string and watch it bounce off the end.
|
|
17
17
|
* A FIXED end flips it (inverts); a FREE end sends it back upright. The string
|
|
18
18
|
* itself is always incident + reflected added together (both shown faint).
|
|
19
|
-
* • resonance
|
|
19
|
+
* • resonance, send a continuous wave; it reflects and superposes with itself.
|
|
20
20
|
* At most frequencies the ends won't sit still, but at the special resonant
|
|
21
21
|
* frequencies fₙ = n·c/2L the reflection locks in and a clean STANDING wave (the
|
|
22
|
-
* nth harmonic) appears
|
|
22
|
+
* nth harmonic) appears, nodes pinned to both ends. That's how a string sings.
|
|
23
23
|
*
|
|
24
24
|
* Exact boundary behaviour via the image method; animated on <CanvasLayer>,
|
|
25
25
|
* play-gated, reduced-motion aware. The standing-wave maths matches the wave kernel.
|
|
@@ -228,7 +228,7 @@ function StringReflectionLab({ mode: mode0 = "pulse", end: end0 = "fixed", frequ
|
|
|
228
228
|
}), /* @__PURE__ */ jsx("p", {
|
|
229
229
|
className: "lab-prompt",
|
|
230
230
|
style: { fontSize: 13 },
|
|
231
|
-
children: resonant ? `Resonance! The reflection locks in
|
|
231
|
+
children: resonant ? `Resonance! The reflection locks in, a clean ${nNear}-loop standing wave with nodes on both ends.` : "Off resonance: the ends won’t hold still. Nudge f toward a harmonic (or snap) until it locks."
|
|
232
232
|
})] }),
|
|
233
233
|
controls: /* @__PURE__ */ jsxs(ControlBar, { children: [/* @__PURE__ */ jsx(Field, {
|
|
234
234
|
label: "mode",
|
|
@@ -9,11 +9,11 @@ import { Axes, Dot, Grid, Label, Polygon, Segment, Stage } from "@classytic/stag
|
|
|
9
9
|
|
|
10
10
|
//#region src/physics/work-energy/preset.tsx
|
|
11
11
|
/**
|
|
12
|
-
* WorkEnergyLab
|
|
13
|
-
* graph. Two situations on one figure
|
|
12
|
+
* WorkEnergyLab, "work done" you can SEE: work is the AREA under the force–distance
|
|
13
|
+
* graph. Two situations on one figure, a SPRING (F = kx, so W = ½kx², the triangle)
|
|
14
14
|
* and a CONSTANT force (W = Fx, the rectangle). Drag the distance and the shaded area
|
|
15
15
|
* (the work) grows with it; the equation updates in real maths (KaTeX). Interactive,
|
|
16
|
-
* not a timed sim
|
|
16
|
+
* not a timed sim, the graph recomputes as you drag.
|
|
17
17
|
*/
|
|
18
18
|
const X_MAX = 4;
|
|
19
19
|
const ACCENT = "var(--stage-accent)";
|
|
@@ -118,7 +118,7 @@ function Picture({ mode, x }) {
|
|
|
118
118
|
]
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
|
-
function WorkEnergyLab({ mode: mode0 = "spring", title = "Work done
|
|
121
|
+
function WorkEnergyLab({ mode: mode0 = "spring", title = "Work done: it’s the area under the force", prompt = "Pull the distance up and watch the work (the shaded area) grow. A spring fights back harder the further you go, so its work grows as x².", objectives = [
|
|
122
122
|
"Read work as the area under a force–distance graph",
|
|
123
123
|
"Spring: W = ½kx² (the triangle)",
|
|
124
124
|
"Constant force: W = Fx (the rectangle)"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { WorkPotentialLab, WorkPotentialProps } from "./preset.mjs";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LabAskSpec } from "../../kit/ask.mjs";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/physics/work-potential/preset.d.ts
|
|
5
|
+
interface WorkPotentialProps {
|
|
6
|
+
title?: string;
|
|
7
|
+
prompt?: string;
|
|
8
|
+
ask?: LabAskSpec;
|
|
9
|
+
height?: number;
|
|
10
|
+
activity?: string;
|
|
11
|
+
}
|
|
12
|
+
declare function WorkPotentialLab({
|
|
13
|
+
title,
|
|
14
|
+
prompt,
|
|
15
|
+
ask,
|
|
16
|
+
height,
|
|
17
|
+
activity
|
|
18
|
+
}?: WorkPotentialProps): ReactNode;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { WorkPotentialLab, WorkPotentialProps };
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Chip } from "../../kit/controls.mjs";
|
|
4
|
+
import { Callout, ControlBar, Field, LabFrame } from "../../kit/frame.mjs";
|
|
5
|
+
import { LabAsk } from "../../kit/ask.mjs";
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Circle, Label, MovableDot, Segment, Stage, useCoords } from "@classytic/stage";
|
|
9
|
+
import { potentialAt } from "@classytic/stage/field";
|
|
10
|
+
|
|
11
|
+
//#region src/physics/work-potential/preset.tsx
|
|
12
|
+
/**
|
|
13
|
+
* WorkPotentialLab, electric potential and the work to move a charge, made
|
|
14
|
+
* visible through EQUIPOTENTIALS. A source charge sets up a potential V = kQ/r;
|
|
15
|
+
* the dashed rings join points at the SAME potential (like contour lines on a map).
|
|
16
|
+
* Field lines run straight out, always at right angles to the rings.
|
|
17
|
+
*
|
|
18
|
+
* Drag the two points A and B. The work the field does on a test charge q moving
|
|
19
|
+
* A → B is W = q(V_A − V_B), and it depends ONLY on the endpoints, never the path:
|
|
20
|
+
* • move B around a ring (same V): ΔV = 0, so W = 0, no work along an equipotential.
|
|
21
|
+
* • move B to a different ring: W = qΔV, whatever route you imagine taking.
|
|
22
|
+
*
|
|
23
|
+
* V is computed from the shared field model (V = Σ kq/r). Authorable via props +
|
|
24
|
+
* an optional checked question.
|
|
25
|
+
*/
|
|
26
|
+
const VIEW = {
|
|
27
|
+
xMin: -6,
|
|
28
|
+
xMax: 6,
|
|
29
|
+
yMin: -4,
|
|
30
|
+
yMax: 4
|
|
31
|
+
};
|
|
32
|
+
const POS = "var(--stage-danger, #e03131)";
|
|
33
|
+
const NEG = "var(--stage-accent, #3b82f6)";
|
|
34
|
+
const RING = "color-mix(in oklab, var(--stage-accent) 45%, transparent)";
|
|
35
|
+
const A_COL = "var(--stage-good)";
|
|
36
|
+
const B_COL = "var(--stage-accent-2)";
|
|
37
|
+
const RING_R = [
|
|
38
|
+
1,
|
|
39
|
+
1.6,
|
|
40
|
+
2.5,
|
|
41
|
+
3.6
|
|
42
|
+
];
|
|
43
|
+
const fmt$1 = (n) => Math.abs(n) < .005 ? "0" : n.toFixed(2);
|
|
44
|
+
/** The source-charge glyph (disc + ± symbol), drawn ON TOP so the handle never hides it. */
|
|
45
|
+
function SourceGlyph({ at, q }) {
|
|
46
|
+
const [x, y] = useCoords().toPx(at.x, at.y);
|
|
47
|
+
return /* @__PURE__ */ jsxs("g", {
|
|
48
|
+
style: { pointerEvents: "none" },
|
|
49
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
50
|
+
cx: x,
|
|
51
|
+
cy: y,
|
|
52
|
+
r: 13,
|
|
53
|
+
fill: q > 0 ? POS : NEG,
|
|
54
|
+
stroke: "var(--stage-bg)",
|
|
55
|
+
strokeWidth: 2
|
|
56
|
+
}), /* @__PURE__ */ jsx("text", {
|
|
57
|
+
x,
|
|
58
|
+
y: y + 5,
|
|
59
|
+
textAnchor: "middle",
|
|
60
|
+
fontSize: 17,
|
|
61
|
+
fontWeight: 800,
|
|
62
|
+
fill: "white",
|
|
63
|
+
children: q > 0 ? "+" : "−"
|
|
64
|
+
})]
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function WorkPotentialLab({ title = "Potential & work: equipotentials and W = qΔV", prompt = "Drag A and B. The work to move a charge from A to B is W = qΔV, the change in potential. Slide a point around a ring and the work is zero.", ask, height = 420, activity = "work-potential" } = {}) {
|
|
68
|
+
const [source, setSource] = useState({
|
|
69
|
+
x: 0,
|
|
70
|
+
y: 0
|
|
71
|
+
});
|
|
72
|
+
const [Q, setQ] = useState(1);
|
|
73
|
+
const [A, setA] = useState({
|
|
74
|
+
x: -3,
|
|
75
|
+
y: 1.6
|
|
76
|
+
});
|
|
77
|
+
const [B, setB] = useState({
|
|
78
|
+
x: 2.6,
|
|
79
|
+
y: -1
|
|
80
|
+
});
|
|
81
|
+
const [qSign, setQSign] = useState(1);
|
|
82
|
+
const sources = [{
|
|
83
|
+
kind: "point",
|
|
84
|
+
at: source,
|
|
85
|
+
q: Q
|
|
86
|
+
}];
|
|
87
|
+
const V = (p) => potentialAt(sources, p);
|
|
88
|
+
const Va = V(A), Vb = V(B);
|
|
89
|
+
const dV = Va - Vb;
|
|
90
|
+
const W = qSign * dV;
|
|
91
|
+
const sameRing = Math.abs(dV) < .02;
|
|
92
|
+
const figure = /* @__PURE__ */ jsxs(Stage, {
|
|
93
|
+
view: VIEW,
|
|
94
|
+
height,
|
|
95
|
+
preserveAspect: true,
|
|
96
|
+
ariaLabel: "Equipotential rings around a charge, with two draggable points and the work between them",
|
|
97
|
+
children: [
|
|
98
|
+
Array.from({ length: 8 }, (_, i) => {
|
|
99
|
+
const a = Math.PI * 2 * i / 8;
|
|
100
|
+
const d = {
|
|
101
|
+
x: Math.cos(a),
|
|
102
|
+
y: Math.sin(a)
|
|
103
|
+
};
|
|
104
|
+
return {
|
|
105
|
+
from: {
|
|
106
|
+
x: source.x + d.x * .4,
|
|
107
|
+
y: source.y + d.y * .4
|
|
108
|
+
},
|
|
109
|
+
to: {
|
|
110
|
+
x: source.x + d.x * 5.5,
|
|
111
|
+
y: source.y + d.y * 5.5
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}).map((r, i) => /* @__PURE__ */ jsx(Segment, {
|
|
115
|
+
from: r.from,
|
|
116
|
+
to: r.to,
|
|
117
|
+
color: "color-mix(in oklab, var(--stage-accent) 22%, transparent)",
|
|
118
|
+
weight: 1.2
|
|
119
|
+
}, `r${i}`)),
|
|
120
|
+
RING_R.map((r, i) => /* @__PURE__ */ jsxs("g", { children: [/* @__PURE__ */ jsx(Circle, {
|
|
121
|
+
center: source,
|
|
122
|
+
r,
|
|
123
|
+
color: RING,
|
|
124
|
+
fill: "none",
|
|
125
|
+
weight: 1.6,
|
|
126
|
+
dashed: true
|
|
127
|
+
}), /* @__PURE__ */ jsx(Label, {
|
|
128
|
+
x: source.x + r * .82,
|
|
129
|
+
y: source.y + r * .57,
|
|
130
|
+
text: `V=${fmt$1(Q / r)}`,
|
|
131
|
+
color: RING,
|
|
132
|
+
size: 10,
|
|
133
|
+
dx: 2
|
|
134
|
+
})] }, `ring${i}`)),
|
|
135
|
+
/* @__PURE__ */ jsx(Segment, {
|
|
136
|
+
from: A,
|
|
137
|
+
to: B,
|
|
138
|
+
color: "var(--stage-muted)",
|
|
139
|
+
weight: 1.6,
|
|
140
|
+
dashed: true
|
|
141
|
+
}),
|
|
142
|
+
/* @__PURE__ */ jsx(Label, {
|
|
143
|
+
x: A.x,
|
|
144
|
+
y: A.y,
|
|
145
|
+
text: `A · V=${fmt$1(Va)}`,
|
|
146
|
+
color: A_COL,
|
|
147
|
+
size: 12,
|
|
148
|
+
weight: 700,
|
|
149
|
+
dx: 10,
|
|
150
|
+
dy: -8,
|
|
151
|
+
anchor: "start"
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ jsx(Label, {
|
|
154
|
+
x: B.x,
|
|
155
|
+
y: B.y,
|
|
156
|
+
text: `B · V=${fmt$1(Vb)}`,
|
|
157
|
+
color: B_COL,
|
|
158
|
+
size: 12,
|
|
159
|
+
weight: 700,
|
|
160
|
+
dx: 10,
|
|
161
|
+
dy: -8,
|
|
162
|
+
anchor: "start"
|
|
163
|
+
}),
|
|
164
|
+
/* @__PURE__ */ jsx(MovableDot, {
|
|
165
|
+
value: source,
|
|
166
|
+
onMove: setSource,
|
|
167
|
+
color: Q > 0 ? POS : NEG,
|
|
168
|
+
ariaLabel: "source charge",
|
|
169
|
+
r: 8
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ jsx(MovableDot, {
|
|
172
|
+
value: A,
|
|
173
|
+
onMove: setA,
|
|
174
|
+
color: A_COL,
|
|
175
|
+
ariaLabel: "point A, drag it",
|
|
176
|
+
r: 7
|
|
177
|
+
}),
|
|
178
|
+
/* @__PURE__ */ jsx(MovableDot, {
|
|
179
|
+
value: B,
|
|
180
|
+
onMove: setB,
|
|
181
|
+
color: B_COL,
|
|
182
|
+
ariaLabel: "point B, drag it",
|
|
183
|
+
r: 7
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ jsx(SourceGlyph, {
|
|
186
|
+
at: source,
|
|
187
|
+
q: Q
|
|
188
|
+
})
|
|
189
|
+
]
|
|
190
|
+
});
|
|
191
|
+
return /* @__PURE__ */ jsx(LabFrame, {
|
|
192
|
+
title,
|
|
193
|
+
prompt,
|
|
194
|
+
controls: /* @__PURE__ */ jsxs(ControlBar, { children: [/* @__PURE__ */ jsx(Field, {
|
|
195
|
+
label: "source charge",
|
|
196
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
197
|
+
className: "lab-field-row",
|
|
198
|
+
children: [/* @__PURE__ */ jsx(Chip, {
|
|
199
|
+
selected: Q > 0,
|
|
200
|
+
onClick: () => setQ(1),
|
|
201
|
+
children: "+"
|
|
202
|
+
}), /* @__PURE__ */ jsx(Chip, {
|
|
203
|
+
selected: Q < 0,
|
|
204
|
+
onClick: () => setQ(-1),
|
|
205
|
+
children: "−"
|
|
206
|
+
})]
|
|
207
|
+
})
|
|
208
|
+
}), /* @__PURE__ */ jsx(Field, {
|
|
209
|
+
label: "moving charge q",
|
|
210
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
211
|
+
className: "lab-field-row",
|
|
212
|
+
children: [/* @__PURE__ */ jsx(Chip, {
|
|
213
|
+
selected: qSign > 0,
|
|
214
|
+
onClick: () => setQSign(1),
|
|
215
|
+
children: "+"
|
|
216
|
+
}), /* @__PURE__ */ jsx(Chip, {
|
|
217
|
+
selected: qSign < 0,
|
|
218
|
+
onClick: () => setQSign(-1),
|
|
219
|
+
children: "−"
|
|
220
|
+
})]
|
|
221
|
+
})
|
|
222
|
+
})] }),
|
|
223
|
+
aside: /* @__PURE__ */ jsx(Callout, {
|
|
224
|
+
tone: "result",
|
|
225
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
226
|
+
style: {
|
|
227
|
+
display: "grid",
|
|
228
|
+
gap: 6,
|
|
229
|
+
fontVariantNumeric: "tabular-nums",
|
|
230
|
+
fontSize: 13
|
|
231
|
+
},
|
|
232
|
+
children: [
|
|
233
|
+
/* @__PURE__ */ jsxs("span", {
|
|
234
|
+
style: { color: A_COL },
|
|
235
|
+
children: [
|
|
236
|
+
"V",
|
|
237
|
+
/* @__PURE__ */ jsx("sub", { children: "A" }),
|
|
238
|
+
" = ",
|
|
239
|
+
/* @__PURE__ */ jsx("strong", { children: fmt$1(Va) })
|
|
240
|
+
]
|
|
241
|
+
}),
|
|
242
|
+
/* @__PURE__ */ jsxs("span", {
|
|
243
|
+
style: { color: B_COL },
|
|
244
|
+
children: [
|
|
245
|
+
"V",
|
|
246
|
+
/* @__PURE__ */ jsx("sub", { children: "B" }),
|
|
247
|
+
" = ",
|
|
248
|
+
/* @__PURE__ */ jsx("strong", { children: fmt$1(Vb) })
|
|
249
|
+
]
|
|
250
|
+
}),
|
|
251
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
252
|
+
"ΔV = V",
|
|
253
|
+
/* @__PURE__ */ jsx("sub", { children: "A" }),
|
|
254
|
+
" − V",
|
|
255
|
+
/* @__PURE__ */ jsx("sub", { children: "B" }),
|
|
256
|
+
" = ",
|
|
257
|
+
/* @__PURE__ */ jsx("strong", { children: fmt$1(dV) })
|
|
258
|
+
] }),
|
|
259
|
+
/* @__PURE__ */ jsxs("span", { children: ["W = q·ΔV = ", /* @__PURE__ */ jsx("strong", { children: fmt$1(W) })] }),
|
|
260
|
+
/* @__PURE__ */ jsx("span", {
|
|
261
|
+
style: { color: "var(--stage-muted)" },
|
|
262
|
+
children: sameRing ? "A and B on the same ring: ΔV = 0, so no work." : "W depends only on the endpoints, not the path."
|
|
263
|
+
})
|
|
264
|
+
]
|
|
265
|
+
})
|
|
266
|
+
}),
|
|
267
|
+
footer: ask ? /* @__PURE__ */ jsx(LabAsk, {
|
|
268
|
+
ask,
|
|
269
|
+
activity
|
|
270
|
+
}) : void 0,
|
|
271
|
+
children: figure
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
//#endregion
|
|
276
|
+
export { WorkPotentialLab };
|
package/dist/schemas/index.d.mts
CHANGED
|
@@ -14,22 +14,22 @@ declare const posSchema: z.ZodEnum<{
|
|
|
14
14
|
}>;
|
|
15
15
|
declare const relationSchema: z.ZodEnum<{
|
|
16
16
|
in: "in";
|
|
17
|
-
at: "at";
|
|
18
|
-
between: "between";
|
|
19
17
|
on: "on";
|
|
20
18
|
over: "over";
|
|
21
19
|
above: "above";
|
|
22
20
|
under: "under";
|
|
23
21
|
below: "below";
|
|
24
22
|
beside: "beside";
|
|
23
|
+
between: "between";
|
|
25
24
|
behind: "behind";
|
|
26
25
|
infront: "infront";
|
|
26
|
+
at: "at";
|
|
27
27
|
}>;
|
|
28
28
|
declare const articleAnswerSchema: z.ZodEnum<{
|
|
29
29
|
a: "a";
|
|
30
30
|
an: "an";
|
|
31
31
|
the: "the";
|
|
32
|
-
"
|
|
32
|
+
", ": ", ";
|
|
33
33
|
}>;
|
|
34
34
|
declare const vec2Schema: z.ZodObject<{
|
|
35
35
|
x: z.ZodNumber;
|
|
@@ -136,7 +136,7 @@ declare const articleItemSchema: z.ZodObject<{
|
|
|
136
136
|
a: "a";
|
|
137
137
|
an: "an";
|
|
138
138
|
the: "the";
|
|
139
|
-
"
|
|
139
|
+
", ": ", ";
|
|
140
140
|
}>;
|
|
141
141
|
why: z.ZodOptional<z.ZodString>;
|
|
142
142
|
}, z.core.$strip>;
|
|
@@ -154,16 +154,16 @@ declare const prepItemSchema: z.ZodObject<{
|
|
|
154
154
|
options: z.ZodArray<z.ZodString>;
|
|
155
155
|
scene: z.ZodEnum<{
|
|
156
156
|
in: "in";
|
|
157
|
-
at: "at";
|
|
158
|
-
between: "between";
|
|
159
157
|
on: "on";
|
|
160
158
|
over: "over";
|
|
161
159
|
above: "above";
|
|
162
160
|
under: "under";
|
|
163
161
|
below: "below";
|
|
164
162
|
beside: "beside";
|
|
163
|
+
between: "between";
|
|
165
164
|
behind: "behind";
|
|
166
165
|
infront: "infront";
|
|
166
|
+
at: "at";
|
|
167
167
|
}>;
|
|
168
168
|
figure: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
169
169
|
kind: z.ZodEnum<{
|
package/dist/schemas/index.mjs
CHANGED
|
@@ -2,13 +2,13 @@ import { z } from "zod";
|
|
|
2
2
|
|
|
3
3
|
//#region src/schemas/index.ts
|
|
4
4
|
/**
|
|
5
|
-
* @classytic/labs/schemas
|
|
5
|
+
* @classytic/labs/schemas, the validation contract for every authorable lab.
|
|
6
6
|
*
|
|
7
7
|
* Real zod schemas for the lab DATA shapes (decks, tiles, items, vectors) that the
|
|
8
8
|
* language + physics blocks reuse to validate authored arrays (no `z.any()`). zod is
|
|
9
9
|
* isolated to this subpath + `/blocks`.
|
|
10
10
|
*
|
|
11
|
-
* Per-lab PROP schemas are NOT here
|
|
11
|
+
* Per-lab PROP schemas are NOT here, each lives on its own `defineBlock({ schema })`
|
|
12
12
|
* (the single source of truth), so there's no parallel registry to drift. A consuming
|
|
13
13
|
* app builds LLM tools straight from the block schemas if it wants.
|
|
14
14
|
*
|
|
@@ -44,7 +44,7 @@ const articleAnswerSchema = z.enum([
|
|
|
44
44
|
"a",
|
|
45
45
|
"an",
|
|
46
46
|
"the",
|
|
47
|
-
"
|
|
47
|
+
", "
|
|
48
48
|
]);
|
|
49
49
|
const vec2Schema = z.object({
|
|
50
50
|
x: z.number(),
|
|
@@ -11,12 +11,12 @@ import { useControlSurface } from "@classytic/stage";
|
|
|
11
11
|
|
|
12
12
|
//#region src/statistics/center-spread/preset.tsx
|
|
13
13
|
/**
|
|
14
|
-
* CenterSpreadLab
|
|
14
|
+
* CenterSpreadLab, centre & spread you can FEEL. Data points sit on a number
|
|
15
15
|
* line; drag them and the mean rides under the line as a BALANCE-POINT fulcrum
|
|
16
16
|
* (the mean is literally where the data balances), the median holds its ground,
|
|
17
17
|
* the mode stack lights up, and a shaded mean ± σ band breathes wider as the data
|
|
18
18
|
* spreads. The punchline lives in the dragging: yank one point far out and the
|
|
19
|
-
* mean chases it while the median barely moves
|
|
19
|
+
* mean chases it while the median barely moves, why we report the median for
|
|
20
20
|
* skewed data. Optional `challenge` turns it into "drag until the mean is 5".
|
|
21
21
|
*
|
|
22
22
|
* All numbers come from the descriptive-stats kernel; the lab only POINTS at them.
|
|
@@ -272,7 +272,7 @@ function CenterSpreadLab({ data = [
|
|
|
272
272
|
children: [
|
|
273
273
|
stat("mean", mu.toFixed(2), "var(--stage-good)"),
|
|
274
274
|
stat("median", String(md), "var(--stage-accent-2, #d6336c)"),
|
|
275
|
-
stat("mode", mo.length ? mo.join(", ") : "
|
|
275
|
+
stat("mode", mo.length ? mo.join(", ") : ", ", "var(--stage-warn)"),
|
|
276
276
|
stat("range", String(rg)),
|
|
277
277
|
stat("variance", variance(vals).toFixed(2)),
|
|
278
278
|
stat(/* @__PURE__ */ jsx(Tex$1, { tex: "\\\\sigma" }), sd.toFixed(2), "var(--stage-accent)"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/statistics/core/descriptive.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* Descriptive statistics
|
|
3
|
+
* Descriptive statistics, the pure kernel the statistics labs trust as the
|
|
4
4
|
* source of truth (centre, spread, position). No dependencies; every lab POINTS
|
|
5
5
|
* to these numbers rather than recomputing them, so the figure and the readout
|
|
6
6
|
* can never disagree. Median uses the standard average-of-middle-two for even n;
|
|
@@ -15,7 +15,7 @@ declare function mode(xs: number[]): number[];
|
|
|
15
15
|
declare const range: (xs: number[]) => number;
|
|
16
16
|
declare function variance(xs: number[], sample?: boolean): number;
|
|
17
17
|
declare const stddev: (xs: number[], sample?: boolean) => number;
|
|
18
|
-
/** Linear-interpolated quantile (q in [0,1])
|
|
18
|
+
/** Linear-interpolated quantile (q in [0,1]), the inclusive "p = (n−1)q" method. */
|
|
19
19
|
declare function quantile(xs: number[], q: number): number;
|
|
20
20
|
interface FiveNumber {
|
|
21
21
|
min: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/statistics/core/descriptive.ts
|
|
2
2
|
/**
|
|
3
|
-
* Descriptive statistics
|
|
3
|
+
* Descriptive statistics, the pure kernel the statistics labs trust as the
|
|
4
4
|
* source of truth (centre, spread, position). No dependencies; every lab POINTS
|
|
5
5
|
* to these numbers rather than recomputing them, so the figure and the readout
|
|
6
6
|
* can never disagree. Median uses the standard average-of-middle-two for even n;
|
|
@@ -31,7 +31,7 @@ function variance(xs, sample = false) {
|
|
|
31
31
|
return sum(xs.map((x) => (x - m) ** 2)) / (xs.length - (sample ? 1 : 0));
|
|
32
32
|
}
|
|
33
33
|
const stddev = (xs, sample = false) => Math.sqrt(variance(xs, sample));
|
|
34
|
-
/** Linear-interpolated quantile (q in [0,1])
|
|
34
|
+
/** Linear-interpolated quantile (q in [0,1]), the inclusive "p = (n−1)q" method. */
|
|
35
35
|
function quantile(xs, q) {
|
|
36
36
|
if (!xs.length) return 0;
|
|
37
37
|
const s = [...xs].sort((a, b) => a - b);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
//#region src/statistics/core/normal.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* Normal-distribution kernel
|
|
3
|
+
* Normal-distribution kernel, the bell curve's pdf/cdf, the z-score, and the
|
|
4
4
|
* area between two points (the probability a value lands in a range). The cdf uses
|
|
5
|
-
* the Abramowitz–Stegun erf approximation (max error ~1.5e-7
|
|
5
|
+
* the Abramowitz–Stegun erf approximation (max error ~1.5e-7, far tighter than
|
|
6
6
|
* any teaching needs). The labs render these; they never re-derive them.
|
|
7
7
|
*/
|
|
8
8
|
/** Gauss error function (A&S 7.1.26). */
|
|
@@ -15,7 +15,7 @@ declare function normalCdf(x: number, mu?: number, sigma?: number): number;
|
|
|
15
15
|
declare function normalBetween(a: number, b: number, mu?: number, sigma?: number): number;
|
|
16
16
|
/** The standard score: how many σ a value sits from the mean. */
|
|
17
17
|
declare function zScore(x: number, mu?: number, sigma?: number): number;
|
|
18
|
-
/** The 68–95–99.7 rule
|
|
18
|
+
/** The 68–95–99.7 rule, P(within k·σ of the mean). */
|
|
19
19
|
declare function withinSigma(k: number): number;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { erf, normalBetween, normalCdf, normalPdf, withinSigma, zScore };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
//#region src/statistics/core/normal.ts
|
|
2
2
|
/**
|
|
3
|
-
* Normal-distribution kernel
|
|
3
|
+
* Normal-distribution kernel, the bell curve's pdf/cdf, the z-score, and the
|
|
4
4
|
* area between two points (the probability a value lands in a range). The cdf uses
|
|
5
|
-
* the Abramowitz–Stegun erf approximation (max error ~1.5e-7
|
|
5
|
+
* the Abramowitz–Stegun erf approximation (max error ~1.5e-7, far tighter than
|
|
6
6
|
* any teaching needs). The labs render these; they never re-derive them.
|
|
7
7
|
*/
|
|
8
8
|
/** Gauss error function (A&S 7.1.26). */
|
|
@@ -28,7 +28,7 @@ function normalBetween(a, b, mu = 0, sigma = 1) {
|
|
|
28
28
|
function zScore(x, mu = 0, sigma = 1) {
|
|
29
29
|
return (x - mu) / sigma;
|
|
30
30
|
}
|
|
31
|
-
/** The 68–95–99.7 rule
|
|
31
|
+
/** The 68–95–99.7 rule, P(within k·σ of the mean). */
|
|
32
32
|
function withinSigma(k) {
|
|
33
33
|
return normalBetween(-k, k, 0, 1);
|
|
34
34
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/statistics/core/sequences.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* Sequences & series kernel
|
|
3
|
+
* Sequences & series kernel, arithmetic and geometric, the two patterns every
|
|
4
4
|
* series lesson rests on. Pure functions: the nth term, the first n terms, and
|
|
5
5
|
* the partial sum (closed form), plus the geometric infinite-sum (|r|<1). The
|
|
6
6
|
* lab draws bars/areas from `terms()` and proves the closed form against the
|
|
@@ -13,9 +13,9 @@ import { CanvasLayer, useControlSurface, useFrameLoop, useInView } from "@classy
|
|
|
13
13
|
|
|
14
14
|
//#region src/statistics/galton/preset.tsx
|
|
15
15
|
/**
|
|
16
|
-
* GaltonBoardLab
|
|
16
|
+
* GaltonBoardLab, the bean machine: balls rain down through a triangle of pegs,
|
|
17
17
|
* bouncing left or right by pure chance, and pile up into a BELL CURVE. It is the
|
|
18
|
-
* Central Limit Theorem you can watch happen
|
|
18
|
+
* Central Limit Theorem you can watch happen, each ball is a sum of coin-flips
|
|
19
19
|
* (a binomial), and a pile of them traces the normal distribution. The bridge from
|
|
20
20
|
* "coin flips / law of large numbers" into the curve all of statistics & ML runs on.
|
|
21
21
|
*
|
|
@@ -10,7 +10,7 @@ import { useControlSurface } from "@classytic/stage";
|
|
|
10
10
|
|
|
11
11
|
//#region src/statistics/histogram/preset.tsx
|
|
12
12
|
/**
|
|
13
|
-
* HistogramBoxLab
|
|
13
|
+
* HistogramBoxLab, the SHAPE of data. A histogram (adjustable bins) sits above a
|
|
14
14
|
* box-and-whisker on a SHARED axis, so the two views of the same numbers line up:
|
|
15
15
|
* the histogram shows the distribution's shape, the box plot its five-number summary
|
|
16
16
|
* (min · Q1 · median · Q3 · max) and outliers (beyond 1.5·IQR). Click in the plot to
|
|
@@ -321,11 +321,11 @@ function HistogramBoxLab({ data = PRESETS.symmetric, bins = 8, min = 0, max = 20
|
|
|
321
321
|
},
|
|
322
322
|
children: [
|
|
323
323
|
stat("n", String(vals.length)),
|
|
324
|
-
stat("mean", vals.length ? mean(vals).toFixed(1) : "
|
|
325
|
-
stat("median", vals.length ? String(median(vals)) : "
|
|
326
|
-
stat("Q1", vals.length ? String(fn.q1) : "
|
|
327
|
-
stat("Q3", vals.length ? String(fn.q3) : "
|
|
328
|
-
stat("IQR", vals.length ? String(fn.iqr) : "
|
|
324
|
+
stat("mean", vals.length ? mean(vals).toFixed(1) : ", "),
|
|
325
|
+
stat("median", vals.length ? String(median(vals)) : ", "),
|
|
326
|
+
stat("Q1", vals.length ? String(fn.q1) : ", "),
|
|
327
|
+
stat("Q3", vals.length ? String(fn.q3) : ", "),
|
|
328
|
+
stat("IQR", vals.length ? String(fn.iqr) : ", "),
|
|
329
329
|
stat("outliers", String(outliers.length))
|
|
330
330
|
]
|
|
331
331
|
})] });
|
|
@@ -12,7 +12,7 @@ import { useControlSurface } from "@classytic/stage";
|
|
|
12
12
|
|
|
13
13
|
//#region src/statistics/normal/preset.tsx
|
|
14
14
|
/**
|
|
15
|
-
* NormalDistributionLab
|
|
15
|
+
* NormalDistributionLab, the bell curve as a working instrument. Drag μ and σ and
|
|
16
16
|
* the curve slides + widens; drag the two shaded handles and read P(a ≤ X ≤ b) as
|
|
17
17
|
* the AREA under the curve, with each bound's z-score (how many σ from the mean).
|
|
18
18
|
* A second mode draws the 68–95–99.7 rule as nested bands. This is the tool every
|
|
@@ -302,7 +302,7 @@ function NormalDistributionLab({ mu = 0, sigma = 1, a = -1, b = 1, mode: mode0 =
|
|
|
302
302
|
y: yOf(normalPdf(m + 2 * sig, m, sig)),
|
|
303
303
|
dx: 26,
|
|
304
304
|
dy: -34,
|
|
305
|
-
text: "rare
|
|
305
|
+
text: "rare, beyond 2σ",
|
|
306
306
|
tone: "warn"
|
|
307
307
|
})
|
|
308
308
|
] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [handle(lo, "a", za), handle(hi, "b", zb)] })
|