@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { TransistorLab, TransistorProps } from "./preset.mjs";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { LabAskSpec } from "../../kit/ask.mjs";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/circuits/transistor/preset.d.ts
|
|
5
|
+
interface TransistorProps {
|
|
6
|
+
supply?: number;
|
|
7
|
+
vth?: number;
|
|
8
|
+
loadK?: number;
|
|
9
|
+
/** which panels to show: the schematic, the transfer graph, or both (default). */
|
|
10
|
+
show?: 'both' | 'circuit' | 'graph';
|
|
11
|
+
title?: string;
|
|
12
|
+
prompt?: string;
|
|
13
|
+
ask?: LabAskSpec;
|
|
14
|
+
activity?: string;
|
|
15
|
+
}
|
|
16
|
+
declare function TransistorLab({
|
|
17
|
+
supply,
|
|
18
|
+
vth,
|
|
19
|
+
loadK,
|
|
20
|
+
show,
|
|
21
|
+
title,
|
|
22
|
+
prompt,
|
|
23
|
+
ask,
|
|
24
|
+
activity
|
|
25
|
+
}?: TransistorProps): ReactNode;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { TransistorLab, TransistorProps };
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Slider } from "../../kit/controls.mjs";
|
|
4
|
+
import { Callout, ControlBar, Field, LabFrame } from "../../kit/frame.mjs";
|
|
5
|
+
import { ChallengeCard, useChallenge, useCheckpoint } from "../../kit/pedagogy.mjs";
|
|
6
|
+
import { BulbGlyph, CellGlyph, FlowDots, MosfetGlyph, Tag, Wire } from "../../kit/electronics.mjs";
|
|
7
|
+
import { useReducedMotion } from "../../kit/anim.mjs";
|
|
8
|
+
import { LabAsk } from "../../kit/ask.mjs";
|
|
9
|
+
import { CoordPlane } from "../../kit/coords.mjs";
|
|
10
|
+
import { useState } from "react";
|
|
11
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { Dot, Label, Polyline, Segment, useFrameLoop } from "@classytic/stage";
|
|
13
|
+
import { solveDC } from "@classytic/stage/circuit";
|
|
14
|
+
|
|
15
|
+
//#region src/circuits/transistor/preset.tsx
|
|
16
|
+
/**
|
|
17
|
+
* TransistorLab — an NMOS as the thing that lets a tiny input steer a big current.
|
|
18
|
+
* Drawn with the shared electronics glyphs (CellGlyph / BulbGlyph / MosfetGlyph) on
|
|
19
|
+
* a real schematic: a supply lights a lamp through the transistor, and the GATE
|
|
20
|
+
* voltage decides whether the channel conducts. Below the threshold the lamp is
|
|
21
|
+
* dark; past it the gate opens a much larger drain current and the lamp glows. The
|
|
22
|
+
* transfer curve and operating point are swept straight from the circuit engine.
|
|
23
|
+
*/
|
|
24
|
+
const PREDICT_Q = [{
|
|
25
|
+
id: "on",
|
|
26
|
+
prompt: "A MOSFET conducts only when the gate voltage exceeds its threshold Vₜₕ. With the gate held BELOW Vₜₕ, is the transistor ON or OFF?",
|
|
27
|
+
choices: [{
|
|
28
|
+
value: "on",
|
|
29
|
+
label: "ON (lamp lit, drain current flows)"
|
|
30
|
+
}, {
|
|
31
|
+
value: "off",
|
|
32
|
+
label: "OFF (lamp dark, no drain current)"
|
|
33
|
+
}],
|
|
34
|
+
answer: "off",
|
|
35
|
+
explain: "Below threshold the channel never forms, so no drain current flows and the lamp stays dark. The transistor only turns ON once the gate climbs past Vₜₕ, opening a much larger drain current."
|
|
36
|
+
}];
|
|
37
|
+
const K = .02;
|
|
38
|
+
const C_OK = "var(--stage-good)";
|
|
39
|
+
const C_BAD = "var(--stage-danger, #e03131)";
|
|
40
|
+
const W = 520, H = 210, xL = 55, xR = 430, yT = 48, yB = 172, HALF = 28;
|
|
41
|
+
const CELL_X = 120, LAMP_X = 250;
|
|
42
|
+
const MCX = xR - 9, MCY = 220 / 2, MHALF = (yB - yT) / 2;
|
|
43
|
+
const GATE_TERM = MCX - 13 - 24;
|
|
44
|
+
const LOOP = [
|
|
45
|
+
[xL, yT],
|
|
46
|
+
[xR, yT],
|
|
47
|
+
[xR, yB],
|
|
48
|
+
[xL, yB],
|
|
49
|
+
[xL, yT]
|
|
50
|
+
];
|
|
51
|
+
function TransistorLab({ supply = 5, vth = 2, loadK = 1, show = "both", title = "The transistor: a small input controls a big current", prompt = "Turn the gate voltage. Below the threshold the channel is shut and the lamp is dark; past it, the gate opens a much larger drain current.", ask, activity = "transistor" } = {}) {
|
|
52
|
+
const [Vg, setVg] = useState(3);
|
|
53
|
+
const [Rk, setRk] = useState(loadK);
|
|
54
|
+
const [phase, setPhase] = useState(0);
|
|
55
|
+
const reduce = useReducedMotion();
|
|
56
|
+
const ch = useChallenge(PREDICT_Q);
|
|
57
|
+
useCheckpoint({
|
|
58
|
+
solved: ch.allCorrect,
|
|
59
|
+
activity: `${activity}:predict`
|
|
60
|
+
});
|
|
61
|
+
const R = Rk * 1e3;
|
|
62
|
+
const mk = (vg) => [
|
|
63
|
+
{
|
|
64
|
+
kind: "V",
|
|
65
|
+
n1: 1,
|
|
66
|
+
n2: 0,
|
|
67
|
+
value: supply
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
kind: "V",
|
|
71
|
+
n1: 3,
|
|
72
|
+
n2: 0,
|
|
73
|
+
value: vg
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
kind: "R",
|
|
77
|
+
n1: 1,
|
|
78
|
+
n2: 2,
|
|
79
|
+
value: R,
|
|
80
|
+
id: "load"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
kind: "M",
|
|
84
|
+
n1: 2,
|
|
85
|
+
n2: 0,
|
|
86
|
+
n3: 3,
|
|
87
|
+
value: 0,
|
|
88
|
+
vth,
|
|
89
|
+
k: K,
|
|
90
|
+
id: "q"
|
|
91
|
+
}
|
|
92
|
+
];
|
|
93
|
+
const sol = solveDC(mk(Vg));
|
|
94
|
+
const Id = (sol.current["q"] ?? 0) * 1e3;
|
|
95
|
+
const Vdrain = sol.nodeV[2] ?? 0;
|
|
96
|
+
const maxId = supply / R * 1e3;
|
|
97
|
+
const on = Id > .05;
|
|
98
|
+
const brightness = Math.max(0, Math.min(1, Id / maxId));
|
|
99
|
+
useFrameLoop((f) => setPhase((p) => (p + f.dtMs / 1e3 * (.1 + .4 * brightness)) % 1), { running: on && !reduce });
|
|
100
|
+
const scene = /* @__PURE__ */ jsx("div", {
|
|
101
|
+
style: {
|
|
102
|
+
borderRadius: 14,
|
|
103
|
+
overflow: "hidden",
|
|
104
|
+
background: "var(--stage-bg)",
|
|
105
|
+
border: "1px solid var(--stage-grid)"
|
|
106
|
+
},
|
|
107
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
108
|
+
viewBox: `0 0 ${W} ${H}`,
|
|
109
|
+
width: "100%",
|
|
110
|
+
role: "img",
|
|
111
|
+
"aria-label": `NMOS circuit, ${on ? "on, lamp lit" : "off, lamp dark"}`,
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ jsx(Wire, {
|
|
114
|
+
points: LOOP,
|
|
115
|
+
live: on
|
|
116
|
+
}),
|
|
117
|
+
on && /* @__PURE__ */ jsx(FlowDots, {
|
|
118
|
+
points: LOOP,
|
|
119
|
+
phase
|
|
120
|
+
}),
|
|
121
|
+
/* @__PURE__ */ jsx(CellGlyph, {
|
|
122
|
+
cx: CELL_X,
|
|
123
|
+
cy: yT,
|
|
124
|
+
half: HALF,
|
|
125
|
+
live: on,
|
|
126
|
+
label: `${supply} V`
|
|
127
|
+
}),
|
|
128
|
+
/* @__PURE__ */ jsx(BulbGlyph, {
|
|
129
|
+
cx: LAMP_X,
|
|
130
|
+
cy: yT,
|
|
131
|
+
half: HALF,
|
|
132
|
+
live: on,
|
|
133
|
+
brightness,
|
|
134
|
+
label: "lamp"
|
|
135
|
+
}),
|
|
136
|
+
/* @__PURE__ */ jsx(MosfetGlyph, {
|
|
137
|
+
cx: MCX,
|
|
138
|
+
cy: MCY,
|
|
139
|
+
half: MHALF,
|
|
140
|
+
on,
|
|
141
|
+
live: on
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ jsx("line", {
|
|
144
|
+
x1: GATE_TERM - 48,
|
|
145
|
+
y1: MCY,
|
|
146
|
+
x2: GATE_TERM,
|
|
147
|
+
y2: MCY,
|
|
148
|
+
stroke: "var(--stage-wire)",
|
|
149
|
+
strokeWidth: 2.5,
|
|
150
|
+
strokeLinecap: "round"
|
|
151
|
+
}),
|
|
152
|
+
/* @__PURE__ */ jsx("circle", {
|
|
153
|
+
cx: GATE_TERM - 48,
|
|
154
|
+
cy: MCY,
|
|
155
|
+
r: 3,
|
|
156
|
+
fill: "var(--stage-metal)"
|
|
157
|
+
}),
|
|
158
|
+
/* @__PURE__ */ jsx(Tag, {
|
|
159
|
+
x: GATE_TERM - 52,
|
|
160
|
+
y: MCY - 8,
|
|
161
|
+
text: "gate",
|
|
162
|
+
color: "var(--stage-fg)",
|
|
163
|
+
size: 11,
|
|
164
|
+
weight: 600,
|
|
165
|
+
anchor: "end"
|
|
166
|
+
}),
|
|
167
|
+
/* @__PURE__ */ jsx(Tag, {
|
|
168
|
+
x: GATE_TERM - 52,
|
|
169
|
+
y: 124,
|
|
170
|
+
text: `${Vg.toFixed(1)} V`,
|
|
171
|
+
color: on ? C_OK : C_BAD,
|
|
172
|
+
size: 11,
|
|
173
|
+
weight: 700,
|
|
174
|
+
anchor: "end"
|
|
175
|
+
})
|
|
176
|
+
]
|
|
177
|
+
})
|
|
178
|
+
});
|
|
179
|
+
const pts = [];
|
|
180
|
+
for (let vg = 0; vg <= 5.0001; vg += .1) pts.push({
|
|
181
|
+
x: vg,
|
|
182
|
+
y: (solveDC(mk(vg)).current["q"] ?? 0) * 1e3
|
|
183
|
+
});
|
|
184
|
+
const gview = {
|
|
185
|
+
xMin: 0,
|
|
186
|
+
xMax: 5,
|
|
187
|
+
yMin: 0,
|
|
188
|
+
yMax: Math.max(2, Math.ceil(maxId * 1.1))
|
|
189
|
+
};
|
|
190
|
+
const graph = /* @__PURE__ */ jsxs(CoordPlane, {
|
|
191
|
+
view: gview,
|
|
192
|
+
height: 150,
|
|
193
|
+
preserveAspect: false,
|
|
194
|
+
step: 1,
|
|
195
|
+
ariaLabel: "NMOS transfer curve",
|
|
196
|
+
children: [
|
|
197
|
+
/* @__PURE__ */ jsx(Segment, {
|
|
198
|
+
from: {
|
|
199
|
+
x: vth,
|
|
200
|
+
y: 0
|
|
201
|
+
},
|
|
202
|
+
to: {
|
|
203
|
+
x: vth,
|
|
204
|
+
y: gview.yMax
|
|
205
|
+
},
|
|
206
|
+
color: "var(--stage-muted)",
|
|
207
|
+
weight: 1,
|
|
208
|
+
dashed: true
|
|
209
|
+
}),
|
|
210
|
+
/* @__PURE__ */ jsx(Label, {
|
|
211
|
+
x: vth,
|
|
212
|
+
y: gview.yMax,
|
|
213
|
+
text: `Vₜₕ = ${vth} V`,
|
|
214
|
+
color: "var(--stage-muted)",
|
|
215
|
+
size: 10,
|
|
216
|
+
dy: -4,
|
|
217
|
+
dx: 4,
|
|
218
|
+
anchor: "start"
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ jsx(Polyline, {
|
|
221
|
+
points: pts,
|
|
222
|
+
color: "var(--stage-accent)",
|
|
223
|
+
weight: 2.5
|
|
224
|
+
}),
|
|
225
|
+
/* @__PURE__ */ jsx(Dot, {
|
|
226
|
+
x: Vg,
|
|
227
|
+
y: Math.max(0, Math.min(gview.yMax, Id)),
|
|
228
|
+
r: 5,
|
|
229
|
+
color: on ? C_OK : C_BAD
|
|
230
|
+
}),
|
|
231
|
+
/* @__PURE__ */ jsx(Label, {
|
|
232
|
+
x: 5,
|
|
233
|
+
y: gview.yMax * .95,
|
|
234
|
+
text: "drain current (mA) vs gate (V)",
|
|
235
|
+
color: "var(--stage-muted)",
|
|
236
|
+
size: 10,
|
|
237
|
+
anchor: "end"
|
|
238
|
+
})
|
|
239
|
+
]
|
|
240
|
+
});
|
|
241
|
+
const figure = show === "circuit" ? scene : show === "graph" ? graph : /* @__PURE__ */ jsxs("div", {
|
|
242
|
+
style: {
|
|
243
|
+
display: "flex",
|
|
244
|
+
flexDirection: "column",
|
|
245
|
+
gap: 10
|
|
246
|
+
},
|
|
247
|
+
children: [scene, graph]
|
|
248
|
+
});
|
|
249
|
+
return /* @__PURE__ */ jsx(LabFrame, {
|
|
250
|
+
title,
|
|
251
|
+
prompt,
|
|
252
|
+
controls: /* @__PURE__ */ jsxs(ControlBar, { children: [/* @__PURE__ */ jsx(Field, {
|
|
253
|
+
label: "gate voltage",
|
|
254
|
+
value: `${Vg.toFixed(1)} V`,
|
|
255
|
+
children: /* @__PURE__ */ jsx(Slider, {
|
|
256
|
+
value: Vg,
|
|
257
|
+
min: 0,
|
|
258
|
+
max: 5,
|
|
259
|
+
step: .1,
|
|
260
|
+
onChange: setVg,
|
|
261
|
+
ariaLabel: "gate voltage"
|
|
262
|
+
})
|
|
263
|
+
}), /* @__PURE__ */ jsx(Field, {
|
|
264
|
+
label: "load R",
|
|
265
|
+
value: `${Rk.toFixed(1)} kΩ`,
|
|
266
|
+
children: /* @__PURE__ */ jsx(Slider, {
|
|
267
|
+
value: Rk,
|
|
268
|
+
min: .5,
|
|
269
|
+
max: 5,
|
|
270
|
+
step: .1,
|
|
271
|
+
onChange: setRk,
|
|
272
|
+
ariaLabel: "load resistance"
|
|
273
|
+
})
|
|
274
|
+
})] }),
|
|
275
|
+
aside: /* @__PURE__ */ jsxs("div", {
|
|
276
|
+
style: {
|
|
277
|
+
display: "flex",
|
|
278
|
+
flexDirection: "column",
|
|
279
|
+
gap: 10
|
|
280
|
+
},
|
|
281
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
282
|
+
className: "lab-pill",
|
|
283
|
+
"data-state": on ? "ok" : "no",
|
|
284
|
+
role: "status",
|
|
285
|
+
style: { alignSelf: "flex-start" },
|
|
286
|
+
children: on ? `✓ ON, lamp ${Math.round(brightness * 100)}% bright` : "✗ OFF, gate below threshold, lamp dark"
|
|
287
|
+
}), /* @__PURE__ */ jsx(Callout, {
|
|
288
|
+
tone: "result",
|
|
289
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
290
|
+
style: {
|
|
291
|
+
display: "grid",
|
|
292
|
+
gap: 6,
|
|
293
|
+
fontVariantNumeric: "tabular-nums",
|
|
294
|
+
fontSize: 13
|
|
295
|
+
},
|
|
296
|
+
children: [
|
|
297
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
298
|
+
"gate V",
|
|
299
|
+
/* @__PURE__ */ jsx("sub", { children: "gs" }),
|
|
300
|
+
" = ",
|
|
301
|
+
/* @__PURE__ */ jsxs("strong", { children: [Vg.toFixed(1), " V"] }),
|
|
302
|
+
" (threshold ",
|
|
303
|
+
vth,
|
|
304
|
+
" V)"
|
|
305
|
+
] }),
|
|
306
|
+
/* @__PURE__ */ jsxs("span", { children: ["drain current = ", /* @__PURE__ */ jsx("strong", { children: Math.abs(Id) < .001 ? "≈ 0" : Id.toFixed(2) + " mA" })] }),
|
|
307
|
+
/* @__PURE__ */ jsxs("span", { children: ["drain voltage = ", /* @__PURE__ */ jsxs("strong", { children: [Vdrain.toFixed(2), " V"] })] }),
|
|
308
|
+
/* @__PURE__ */ jsx("span", {
|
|
309
|
+
style: { color: "var(--stage-muted)" },
|
|
310
|
+
children: "a small gate voltage steers a much larger drain current, switch or amplifier"
|
|
311
|
+
})
|
|
312
|
+
]
|
|
313
|
+
})
|
|
314
|
+
})]
|
|
315
|
+
}),
|
|
316
|
+
footer: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ChallengeCard, {
|
|
317
|
+
questions: PREDICT_Q,
|
|
318
|
+
state: ch,
|
|
319
|
+
title: "Predict first"
|
|
320
|
+
}), ask ? /* @__PURE__ */ jsx(LabAsk, {
|
|
321
|
+
ask,
|
|
322
|
+
activity
|
|
323
|
+
}) : null] }),
|
|
324
|
+
children: figure
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
//#endregion
|
|
329
|
+
export { TransistorLab };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/commerce/accounting/core.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* The SIMPLE, CORRECT double-entry core
|
|
3
|
+
* The SIMPLE, CORRECT double-entry core, the single source of truth every
|
|
4
4
|
* accounting lab shares. Deliberately NOT the industry @classytic/ledger engine
|
|
5
5
|
* (events/repositories/FX/fiscal-close): a teaching lab needs only the rules,
|
|
6
6
|
* which are these (verified against that production ledger):
|
|
@@ -12,17 +12,17 @@ import { Circle, Label, Segment, Stage, StageAssetDefs } from "@classytic/stage"
|
|
|
12
12
|
|
|
13
13
|
//#region src/commerce/accounting/equation-balance.tsx
|
|
14
14
|
/**
|
|
15
|
-
* EquationBalanceLab
|
|
15
|
+
* EquationBalanceLab, the balance sheet that must stay LEVEL.
|
|
16
16
|
*
|
|
17
17
|
* Apply each authored transaction one at a time; weights slide onto a two-pan
|
|
18
|
-
* scale (left = Assets, right = Liabilities + Equity) and the beam re-levels
|
|
18
|
+
* scale (left = Assets, right = Liabilities + Equity) and the beam re-levels ,
|
|
19
19
|
* because every balanced entry changes both sides equally, "Assets = Liabilities
|
|
20
20
|
* + Equity" stops being a formula and becomes a felt constraint. A free-post mode
|
|
21
21
|
* lets the learner nudge ONE side and watch the books visibly tip (the #1
|
|
22
22
|
* misconception drill). Reuses the shared ScaleFrame; tokenized; reduced-motion safe.
|
|
23
23
|
*
|
|
24
24
|
* The A = L + E rearrangement (Equity = Assets − Liabilities) belongs in a paired
|
|
25
|
-
* MathDerivation
|
|
25
|
+
* MathDerivation, this lab only makes the constraint felt.
|
|
26
26
|
*/
|
|
27
27
|
const DEMO_ACCOUNTS = [
|
|
28
28
|
{
|
|
@@ -92,7 +92,7 @@ const PIVOT = {
|
|
|
92
92
|
y: 1.2
|
|
93
93
|
};
|
|
94
94
|
const HB = 4.2, PAN_HANG = 1.35, PAN_R = 1.75, BASE_Y = -3.6;
|
|
95
|
-
function EquationBalanceLab({ accounts = DEMO_ACCOUNTS, transactions = DEMO_TXNS, freePost = false, start = 0, title = "The balance sheet that must stay level", prompt = "Apply each transaction
|
|
95
|
+
function EquationBalanceLab({ accounts = DEMO_ACCOUNTS, transactions = DEMO_TXNS, freePost = false, start = 0, title = "The balance sheet that must stay level", prompt = "Apply each transaction, Assets must always equal Liabilities + Equity.", height = 320, objectives }) {
|
|
96
96
|
const [applied, setApplied] = useState(clamp(start, 0, transactions.length));
|
|
97
97
|
const [extraA, setExtraA] = useState(0);
|
|
98
98
|
const [extraLE, setExtraLE] = useState(0);
|
|
@@ -282,7 +282,7 @@ function EquationBalanceLab({ accounts = DEMO_ACCOUNTS, transactions = DEMO_TXNS
|
|
|
282
282
|
})] }),
|
|
283
283
|
footer: /* @__PURE__ */ jsx(StatusPill, {
|
|
284
284
|
ok: balanced,
|
|
285
|
-
children: balanced ? "Books balance ✓" : `Off by ${money(Math.abs(imbalance))}
|
|
285
|
+
children: balanced ? "Books balance ✓" : `Off by ${money(Math.abs(imbalance))}, not balanced`
|
|
286
286
|
}),
|
|
287
287
|
children: figure
|
|
288
288
|
});
|
|
@@ -10,16 +10,16 @@ import { useLearner } from "@classytic/stage";
|
|
|
10
10
|
|
|
11
11
|
//#region src/commerce/accounting/journal-poster.tsx
|
|
12
12
|
/**
|
|
13
|
-
* JournalPosterLab
|
|
13
|
+
* JournalPosterLab, post the entry, fill the T-accounts, balance the trial.
|
|
14
14
|
*
|
|
15
15
|
* For each authored business event the learner picks the DEBIT account (left) and
|
|
16
16
|
* the CREDIT account (right) from the chart of accounts. On Post the lab gives
|
|
17
17
|
* INSTANT feedback: a correct entry drops into the matching T-accounts' left/right
|
|
18
|
-
* columns (green); a wrong pick is coached with the reason ("Cash is an Asset
|
|
18
|
+
* columns (green); a wrong pick is coached with the reason ("Cash is an Asset, it
|
|
19
19
|
* increases with a DEBIT, the left side") instead of just "wrong". A live trial
|
|
20
20
|
* balance sums ΣDebit vs ΣCredit and only reads level when they match.
|
|
21
21
|
*
|
|
22
|
-
* Reuses the shared accounting core (normalBalance / debit=credit)
|
|
22
|
+
* Reuses the shared accounting core (normalBalance / debit=credit), no ledger dep.
|
|
23
23
|
* The DEALER mnemonic + trial-balance traps belong in a paired MathDerivation.
|
|
24
24
|
*/
|
|
25
25
|
const DEMO_ACCOUNTS = [
|
|
@@ -91,7 +91,7 @@ const DEMO_TXNS = [
|
|
|
91
91
|
amount: 800
|
|
92
92
|
}
|
|
93
93
|
];
|
|
94
|
-
function JournalPosterLab({ accounts = DEMO_ACCOUNTS, transactions = DEMO_TXNS, showTrialBalance = true, title = "Post the entry
|
|
94
|
+
function JournalPosterLab({ accounts = DEMO_ACCOUNTS, transactions = DEMO_TXNS, showTrialBalance = true, title = "Post the entry: fill the T-accounts", prompt = "Choose the debit (left) and credit (right) account for each event.", objectives }) {
|
|
95
95
|
const [idx, setIdx] = useState(0);
|
|
96
96
|
const [debitId, setDebitId] = useState(null);
|
|
97
97
|
const [creditId, setCreditId] = useState(null);
|
|
@@ -107,7 +107,7 @@ function JournalPosterLab({ accounts = DEMO_ACCOUNTS, transactions = DEMO_TXNS,
|
|
|
107
107
|
const c = catOf(id);
|
|
108
108
|
if (!c) return "";
|
|
109
109
|
const article = /^[AEIOU]/.test(c) ? "an" : "a";
|
|
110
|
-
return `${nameOf(id)} is ${article} ${c}
|
|
110
|
+
return `${nameOf(id)} is ${article} ${c}, it increases with a ${normalBalance(c).toUpperCase()} (${normalBalance(c) === "debit" ? "left" : "right"}).`;
|
|
111
111
|
};
|
|
112
112
|
const txn = transactions[idx];
|
|
113
113
|
const allDone = idx >= transactions.length;
|
|
@@ -228,7 +228,7 @@ function JournalPosterLab({ accounts = DEMO_ACCOUNTS, transactions = DEMO_TXNS,
|
|
|
228
228
|
color: "var(--stage-good)",
|
|
229
229
|
margin: 0
|
|
230
230
|
},
|
|
231
|
-
children: "All entries posted
|
|
231
|
+
children: "All entries posted ✓, the trial balance is level."
|
|
232
232
|
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
233
233
|
/* @__PURE__ */ jsxs("p", {
|
|
234
234
|
style: {
|
|
@@ -277,7 +277,7 @@ function JournalPosterLab({ accounts = DEMO_ACCOUNTS, transactions = DEMO_TXNS,
|
|
|
277
277
|
border: "1px dashed var(--stage-grid)",
|
|
278
278
|
background: debitId ? "color-mix(in oklab, var(--stage-accent) 14%, transparent)" : "transparent"
|
|
279
279
|
},
|
|
280
|
-
children: ["DEBIT (left): ", /* @__PURE__ */ jsx("b", { children: debitId ? nameOf(debitId) : "
|
|
280
|
+
children: ["DEBIT (left): ", /* @__PURE__ */ jsx("b", { children: debitId ? nameOf(debitId) : ", " })]
|
|
281
281
|
}), /* @__PURE__ */ jsxs("span", {
|
|
282
282
|
style: {
|
|
283
283
|
flex: 1,
|
|
@@ -286,7 +286,7 @@ function JournalPosterLab({ accounts = DEMO_ACCOUNTS, transactions = DEMO_TXNS,
|
|
|
286
286
|
border: "1px dashed var(--stage-grid)",
|
|
287
287
|
background: creditId ? "color-mix(in oklab, var(--stage-accent-2) 14%, transparent)" : "transparent"
|
|
288
288
|
},
|
|
289
|
-
children: ["CREDIT (right): ", /* @__PURE__ */ jsx("b", { children: creditId ? nameOf(creditId) : "
|
|
289
|
+
children: ["CREDIT (right): ", /* @__PURE__ */ jsx("b", { children: creditId ? nameOf(creditId) : ", " })]
|
|
290
290
|
})]
|
|
291
291
|
}),
|
|
292
292
|
/* @__PURE__ */ jsx("div", {
|
|
@@ -9,9 +9,9 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
|
9
9
|
|
|
10
10
|
//#region src/commerce/accounting/statement-sorter.tsx
|
|
11
11
|
/**
|
|
12
|
-
* StatementSorterLab
|
|
12
|
+
* StatementSorterLab, sort the accounts into the two statements.
|
|
13
13
|
*
|
|
14
|
-
* The financial statements aren't new objects
|
|
14
|
+
* The financial statements aren't new objects, they're a SORTING of the ledger
|
|
15
15
|
* accounts into their home: Income/Expense → Income Statement (this period's
|
|
16
16
|
* "result"), Asset/Liability/Equity → Balance Sheet (the cumulative "standing").
|
|
17
17
|
* The learner sends each account to a statement (wrong picks are coached, not just
|
|
@@ -69,7 +69,7 @@ function StatementSorterLab({ accounts = DEMO, asOfLabel = "", showClosing = tru
|
|
|
69
69
|
[a.id]: tray
|
|
70
70
|
}));
|
|
71
71
|
setHint(null);
|
|
72
|
-
} else setHint(`${a.name} is ${a.category === "Asset" || a.category === "Income" ? "an" : "a"} ${a.category}
|
|
72
|
+
} else setHint(`${a.name} is ${a.category === "Asset" || a.category === "Income" ? "an" : "a"} ${a.category}, it belongs on the ${statementOf(a.category)}.`);
|
|
73
73
|
};
|
|
74
74
|
const unsorted = accounts.filter((a) => !place[a.id]);
|
|
75
75
|
const inTray = (t) => accounts.filter((a) => place[a.id] === t);
|
|
@@ -293,7 +293,7 @@ function StatementSorterLab({ accounts = DEMO, asOfLabel = "", showClosing = tru
|
|
|
293
293
|
children: "Close the books → carry profit to Equity"
|
|
294
294
|
}), closed && /* @__PURE__ */ jsx(StatusPill, {
|
|
295
295
|
ok: balanced,
|
|
296
|
-
children: balanced ? "Net profit carried to Equity
|
|
296
|
+
children: balanced ? "Net profit carried to Equity, A = L + E holds ✓" : "Equation does not balance"
|
|
297
297
|
})]
|
|
298
298
|
}), /* @__PURE__ */ jsx(LiveRegion, { children: hint ?? (closed ? `Net profit ${money(profit)} carried to equity; assets ${money(assets)} equal liabilities plus equity ${money(liabilities + equity)}.` : `${unsorted.length} accounts left to sort.`) })] }),
|
|
299
299
|
children: figure
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/commerce/economics/core.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* The simple linear supply/demand core
|
|
3
|
+
* The simple linear supply/demand core, single source of truth shared by every
|
|
4
4
|
* economics lab (market equilibrium, shift-vs-move, elasticity). Pure functions,
|
|
5
5
|
* no dependencies.
|
|
6
6
|
*
|
|
@@ -18,7 +18,7 @@ declare const demandP: (d: Curve, q: number) => number;
|
|
|
18
18
|
declare const supplyP: (s: Curve, q: number) => number;
|
|
19
19
|
declare const demandQ: (d: Curve, p: number) => number;
|
|
20
20
|
declare const supplyQ: (s: Curve, p: number) => number;
|
|
21
|
-
/** Where Qd = Qs
|
|
21
|
+
/** Where Qd = Qs, the market-clearing price + quantity. */
|
|
22
22
|
declare function equilibrium(d: Curve, s: Curve): {
|
|
23
23
|
q: number;
|
|
24
24
|
p: number;
|
|
@@ -3,7 +3,7 @@ const demandP = (d, q) => d.intercept - d.slope * q;
|
|
|
3
3
|
const supplyP = (s, q) => s.intercept + s.slope * q;
|
|
4
4
|
const demandQ = (d, p) => Math.max(0, (d.intercept - p) / d.slope);
|
|
5
5
|
const supplyQ = (s, p) => Math.max(0, (p - s.intercept) / s.slope);
|
|
6
|
-
/** Where Qd = Qs
|
|
6
|
+
/** Where Qd = Qs, the market-clearing price + quantity. */
|
|
7
7
|
function equilibrium(d, s) {
|
|
8
8
|
const q = (d.intercept - s.intercept) / (d.slope + s.slope);
|
|
9
9
|
return {
|
|
@@ -11,12 +11,12 @@ import { Axes, Dot, Label, MovableDot, Segment, Stage } from "@classytic/stage";
|
|
|
11
11
|
|
|
12
12
|
//#region src/commerce/economics/demand-shift-vs-move.tsx
|
|
13
13
|
/**
|
|
14
|
-
* DemandShiftVsMoveLab
|
|
14
|
+
* DemandShiftVsMoveLab, shift the curve vs move along it.
|
|
15
15
|
*
|
|
16
16
|
* The #1 micro misconception. Dragging the PRICE slider slides a dot ALONG a
|
|
17
|
-
* fixed demand curve
|
|
17
|
+
* fixed demand curve, a change in QUANTITY demanded (the curve never moves).
|
|
18
18
|
* Clicking a non-price TRIBE factor (Tastes, Related-good prices, Income, Buyers,
|
|
19
|
-
* Expectations) translates the WHOLE curve
|
|
19
|
+
* Expectations) translates the WHOLE curve, a change in DEMAND, and the
|
|
20
20
|
* equilibrium moves along supply to a new P* and Q*. A predict-then-check asks
|
|
21
21
|
* for the P/Q direction before the reveal. The decision rule: only the good's OWN
|
|
22
22
|
* price (the axis variable) moves you along; anything else shifts the curve.
|
|
@@ -96,7 +96,7 @@ function DemandShiftVsMoveLab({ demand = DEMAND0, supply = SUPPLY0, shifters = S
|
|
|
96
96
|
if (!pending) return;
|
|
97
97
|
const truth = dirOf(pending);
|
|
98
98
|
const ok = guess === truth;
|
|
99
|
-
setVerdict(ok ? `✓ Right
|
|
99
|
+
setVerdict(ok ? `✓ Right, ${pending.label} shifts demand ${pending.delta > 0 ? "right" : "left"}, so P* and Q* both go ${truth}.` : `Not quite, ${pending.label} shifts demand ${pending.delta > 0 ? "right" : "left"}: P* and Q* both go ${truth}.`);
|
|
100
100
|
apply(pending);
|
|
101
101
|
setPending(null);
|
|
102
102
|
if (ok) setSolved(true);
|
|
@@ -301,11 +301,11 @@ function DemandShiftVsMoveLab({ demand = DEMAND0, supply = SUPPLY0, shifters = S
|
|
|
301
301
|
footer: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
302
302
|
last === "move" && /* @__PURE__ */ jsx(StatusPill, {
|
|
303
303
|
ok: false,
|
|
304
|
-
children: "MOVEMENT along the curve
|
|
304
|
+
children: "MOVEMENT along the curve, Δ quantity demanded (own price changed)"
|
|
305
305
|
}),
|
|
306
306
|
last === "shift" && /* @__PURE__ */ jsx(StatusPill, {
|
|
307
307
|
ok: true,
|
|
308
|
-
children: "SHIFT of the whole curve
|
|
308
|
+
children: "SHIFT of the whole curve, Δ demand (a TRIBE factor)"
|
|
309
309
|
}),
|
|
310
310
|
!last && /* @__PURE__ */ jsx("p", {
|
|
311
311
|
className: "lab-prompt",
|
|
@@ -10,12 +10,12 @@ import { Axes, Dot, Label, MovableDot, Polygon, Segment, Stage } from "@classyti
|
|
|
10
10
|
|
|
11
11
|
//#region src/commerce/economics/elasticity-revenue.tsx
|
|
12
12
|
/**
|
|
13
|
-
* ElasticityRevenueLab
|
|
13
|
+
* ElasticityRevenueLab, the stretch test: elasticity is NOT slope.
|
|
14
14
|
*
|
|
15
|
-
* Rotate one demand line about a pivot from steep (inelastic
|
|
16
|
-
* e.g. insulin) to flat (elastic
|
|
15
|
+
* Rotate one demand line about a pivot from steep (inelastic, few substitutes,
|
|
16
|
+
* e.g. insulin) to flat (elastic, many substitutes, e.g. one water brand). Drag
|
|
17
17
|
* the price down the line and the total-revenue rectangle (P×Q) grows on the
|
|
18
|
-
* elastic upper half and shrinks on the inelastic lower half
|
|
18
|
+
* elastic upper half and shrinks on the inelastic lower half, the revenue
|
|
19
19
|
* see-saw. The point-elasticity pill flips ELASTIC → UNIT → INELASTIC down a
|
|
20
20
|
* SINGLE straight line, killing the "slope = elasticity" error.
|
|
21
21
|
*
|
|
@@ -38,7 +38,7 @@ const PRESETS = [
|
|
|
38
38
|
function ElasticityRevenueLab({ pivot = {
|
|
39
39
|
p: 5,
|
|
40
40
|
q: 5
|
|
41
|
-
}, priceMax = 11, qtyMax = 13, anchorPresets = PRESETS, title = "The stretch test
|
|
41
|
+
}, priceMax = 11, qtyMax = 13, anchorPresets = PRESETS, title = "The stretch test: elasticity is not slope", prompt = "Rotate the curve (substitutes), then drag the price: watch the revenue box + the elasticity flip.", height = 320, objectives }) {
|
|
42
42
|
const [b, setB] = useState(.8);
|
|
43
43
|
const curve = {
|
|
44
44
|
intercept: pivot.p + b * pivot.q,
|
|
@@ -185,7 +185,7 @@ function ElasticityRevenueLab({ pivot = {
|
|
|
185
185
|
})
|
|
186
186
|
]
|
|
187
187
|
})
|
|
188
|
-
}), /* @__PURE__ */ jsx(LiveRegion, { children: `At price ${price.toFixed(1)}, quantity ${q.toFixed(1)}, revenue ${revenue.toFixed(1)}. Elasticity ${E === Infinity ? "infinite" : E.toFixed(2)}
|
|
188
|
+
}), /* @__PURE__ */ jsx(LiveRegion, { children: `At price ${price.toFixed(1)}, quantity ${q.toFixed(1)}, revenue ${revenue.toFixed(1)}. Elasticity ${E === Infinity ? "infinite" : E.toFixed(2)}, ${kind}.` })] });
|
|
189
189
|
return /* @__PURE__ */ jsx(LabFrame, {
|
|
190
190
|
title,
|
|
191
191
|
prompt,
|
|
@@ -11,15 +11,15 @@ import { Axes, Dot, Label, MovableDot, Polygon, Segment, Stage } from "@classyti
|
|
|
11
11
|
|
|
12
12
|
//#region src/commerce/economics/market-equilibrium.tsx
|
|
13
13
|
/**
|
|
14
|
-
* MarketEquilibriumLab
|
|
14
|
+
* MarketEquilibriumLab, Marshall's scissors: where the market clears.
|
|
15
15
|
*
|
|
16
16
|
* Drag a horizontal PRICE line across a fixed demand line + supply line. At any
|
|
17
|
-
* non-equilibrium price the lab shades the HORIZONTAL gap between Qd and Qs
|
|
17
|
+
* non-equilibrium price the lab shades the HORIZONTAL gap between Qd and Qs ,
|
|
18
18
|
* amber SURPLUS above equilibrium (pressure pushes price down), red SHORTAGE
|
|
19
|
-
* below (pressure pushes price up)
|
|
19
|
+
* below (pressure pushes price up), and the band collapses to nothing at the
|
|
20
20
|
* crossing, where a green pill reads "market clears, Qd = Qs". Shift sliders move
|
|
21
21
|
* either curve to watch BOTH P* and Q* move. Reuses the shared econ core +
|
|
22
|
-
* Stage primitives; tokenized; reduced-motion safe (no autoplay
|
|
22
|
+
* Stage primitives; tokenized; reduced-motion safe (no autoplay, the learner drags).
|
|
23
23
|
*
|
|
24
24
|
* The algebra (solve a−bQ = c+dQ for Q*) belongs in a paired MathDerivation.
|
|
25
25
|
*/
|
|
@@ -34,7 +34,7 @@ const SUPPLY0 = {
|
|
|
34
34
|
function MarketEquilibriumLab({ demand = DEMAND0, supply = SUPPLY0, shiftControls = {
|
|
35
35
|
demand: true,
|
|
36
36
|
supply: true
|
|
37
|
-
}, priceMax = 10, qtyMax = 12, goodLabel = "the good", title = "Marshall's scissors
|
|
37
|
+
}, priceMax = 10, qtyMax = 12, goodLabel = "the good", title = "Marshall's scissors: where the market clears", prompt = "Drag the price. Above equilibrium → surplus; below → shortage; the gap is Qs − Qd.", height = 320, objectives }) {
|
|
38
38
|
const [dShift, setDShift] = useState(0);
|
|
39
39
|
const [sShift, setSShift] = useState(0);
|
|
40
40
|
const d = {
|
package/dist/core/easing.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/core/easing.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* Easing / rate functions
|
|
3
|
+
* Easing / rate functions, pure `(t in [0,1]) => number`. Ported from manim's
|
|
4
4
|
* `rate_functions` + the standard web set. Shape `alpha` before interpolation.
|
|
5
5
|
*/
|
|
6
6
|
type Easing = (t: number) => number;
|
|
@@ -14,7 +14,7 @@ declare const easeInOut: Easing;
|
|
|
14
14
|
declare const rushInto: Easing;
|
|
15
15
|
/** Decelerate to rest (manim `rush_from`). */
|
|
16
16
|
declare const rushFrom: Easing;
|
|
17
|
-
/** Go to 1 then back to 0 (manim `there_and_back`)
|
|
17
|
+
/** Go to 1 then back to 0 (manim `there_and_back`), great for pulses. */
|
|
18
18
|
declare const thereAndBack: Easing;
|
|
19
19
|
/** Overshoot then settle. */
|
|
20
20
|
declare const elastic: Easing;
|
|
@@ -22,7 +22,7 @@ declare const elastic: Easing;
|
|
|
22
22
|
declare function cubicBezier(x1: number, y1: number, x2: number, y2: number): Easing;
|
|
23
23
|
/** Squash an easing into the sub-window [a,b] of [0,1] (manim `squish_rate_func`). */
|
|
24
24
|
declare function squish(fn: Easing, a?: number, b?: number): Easing;
|
|
25
|
-
/** Built-in registry
|
|
25
|
+
/** Built-in registry, extend with `registerEasing` (see ./registry). */
|
|
26
26
|
declare const EASINGS: Record<string, Easing>;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { EASINGS, Easing, cubicBezier, easeInCubic, easeInOut, easeOutCubic, elastic, linear, rushFrom, rushInto, smooth, squish, thereAndBack };
|