@classytic/labs 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +105 -0
- package/dist/biology/enzyme-rate/index.d.mts +1 -0
- package/dist/biology/enzyme-rate/preset.d.mts +25 -0
- package/dist/biology/enzyme-rate/preset.mjs +256 -0
- package/dist/biology/genetic-cross/core.d.mts +64 -0
- package/dist/biology/genetic-cross/core.mjs +147 -0
- package/dist/biology/genetic-cross/grid.mjs +239 -0
- package/dist/biology/genetic-cross/index.d.mts +3 -0
- package/dist/biology/genetic-cross/preset.d.mts +26 -0
- package/dist/biology/genetic-cross/preset.mjs +184 -0
- package/dist/biology/genetic-cross/sex-linked.d.mts +27 -0
- package/dist/biology/genetic-cross/sex-linked.mjs +226 -0
- package/dist/biology/index.d.mts +11 -0
- package/dist/biology/index.mjs +12 -0
- package/dist/biology/photosynthesis-factors/index.d.mts +1 -0
- package/dist/biology/photosynthesis-factors/preset.d.mts +25 -0
- package/dist/biology/photosynthesis-factors/preset.mjs +270 -0
- package/dist/biology/punnett-cross/index.d.mts +1 -0
- package/dist/biology/punnett-cross/preset.d.mts +27 -0
- package/dist/biology/punnett-cross/preset.mjs +21 -0
- package/dist/biology/respiration/index.d.mts +1 -0
- package/dist/biology/respiration/preset.d.mts +17 -0
- package/dist/biology/respiration/preset.mjs +179 -0
- package/dist/biology/sequence/central-dogma.d.mts +17 -0
- package/dist/biology/sequence/central-dogma.mjs +339 -0
- package/dist/biology/sequence/core.d.mts +38 -0
- package/dist/biology/sequence/core.mjs +178 -0
- package/dist/biology/sequence/index.d.mts +3 -0
- package/dist/biology/sequence/preset.d.mts +20 -0
- package/dist/biology/sequence/preset.mjs +235 -0
- package/dist/blocks/accounting.d.mts +142 -0
- package/dist/blocks/accounting.mjs +446 -0
- package/dist/blocks/authoring.d.mts +12 -0
- package/dist/blocks/authoring.mjs +705 -0
- package/dist/blocks/biology.d.mts +197 -0
- package/dist/blocks/biology.mjs +513 -0
- package/dist/blocks/chem.d.mts +128 -0
- package/dist/blocks/chem.mjs +486 -0
- package/dist/blocks/circuits.d.mts +86 -0
- package/dist/blocks/circuits.mjs +348 -0
- package/dist/blocks/discrete.d.mts +62 -0
- package/dist/blocks/discrete.mjs +314 -0
- package/dist/blocks/economics.d.mts +56 -0
- package/dist/blocks/economics.mjs +203 -0
- package/dist/blocks/geography.d.mts +58 -0
- package/dist/blocks/geography.mjs +115 -0
- package/dist/blocks/geometry.d.mts +28 -0
- package/dist/blocks/geometry.mjs +160 -0
- package/dist/blocks/ict.d.mts +65 -0
- package/dist/blocks/ict.mjs +197 -0
- package/dist/blocks/index.d.mts +4555 -0
- package/dist/blocks/index.mjs +120 -0
- package/dist/blocks/lab-block.d.mts +16 -0
- package/dist/blocks/lab-block.mjs +74 -0
- package/dist/blocks/lab-config.d.mts +23 -0
- package/dist/blocks/lab-config.mjs +200 -0
- package/dist/blocks/lab-gallery.d.mts +30 -0
- package/dist/blocks/lab-gallery.mjs +208 -0
- package/dist/blocks/language.d.mts +349 -0
- package/dist/blocks/language.mjs +750 -0
- package/dist/blocks/lesson.d.mts +43 -0
- package/dist/blocks/lesson.mjs +140 -0
- package/dist/blocks/math.d.mts +411 -0
- package/dist/blocks/math.mjs +1536 -0
- package/dist/blocks/ml.d.mts +84 -0
- package/dist/blocks/ml.mjs +146 -0
- package/dist/blocks/physics.d.mts +259 -0
- package/dist/blocks/physics.mjs +868 -0
- package/dist/blocks/statistics.d.mts +29 -0
- package/dist/blocks/statistics.mjs +123 -0
- package/dist/catalog/index.d.mts +3 -0
- package/dist/catalog/index.mjs +8 -0
- package/dist/catalog/registry.d.mts +46 -0
- package/dist/catalog/registry.mjs +56 -0
- package/dist/catalog/templates.d.mts +11 -0
- package/dist/catalog/templates.mjs +141 -0
- package/dist/chem/battery.d.mts +16 -0
- package/dist/chem/battery.mjs +311 -0
- package/dist/chem/bohr-atom.d.mts +16 -0
- package/dist/chem/bohr-atom.mjs +212 -0
- package/dist/chem/diffusion/asset.mjs +76 -0
- package/dist/chem/diffusion/index.d.mts +1 -0
- package/dist/chem/diffusion/preset.d.mts +15 -0
- package/dist/chem/diffusion/preset.mjs +188 -0
- package/dist/chem/electrochem/index.d.mts +1 -0
- package/dist/chem/electrochem/preset.d.mts +23 -0
- package/dist/chem/electrochem/preset.mjs +402 -0
- package/dist/chem/equilibrium/index.d.mts +1 -0
- package/dist/chem/equilibrium/preset.d.mts +36 -0
- package/dist/chem/equilibrium/preset.mjs +416 -0
- package/dist/chem/gas-box/index.d.mts +1 -0
- package/dist/chem/gas-box/preset.d.mts +27 -0
- package/dist/chem/gas-box/preset.mjs +395 -0
- package/dist/chem/index.d.mts +16 -0
- package/dist/chem/index.mjs +17 -0
- package/dist/chem/kinetics/index.d.mts +1 -0
- package/dist/chem/kinetics/preset.d.mts +31 -0
- package/dist/chem/kinetics/preset.mjs +478 -0
- package/dist/chem/periodic-trends/index.d.mts +1 -0
- package/dist/chem/periodic-trends/preset.d.mts +21 -0
- package/dist/chem/periodic-trends/preset.mjs +831 -0
- package/dist/chem/reaction-lab.d.mts +18 -0
- package/dist/chem/reaction-lab.mjs +165 -0
- package/dist/chem/reaction-profile.d.mts +21 -0
- package/dist/chem/reaction-profile.mjs +287 -0
- package/dist/chem/solution/dilution.d.mts +27 -0
- package/dist/chem/solution/dilution.mjs +199 -0
- package/dist/chem/solution/field.d.mts +30 -0
- package/dist/chem/solution/field.mjs +145 -0
- package/dist/chem/solution/index.d.mts +3 -0
- package/dist/chem/solution/solution-box.d.mts +28 -0
- package/dist/chem/solution/solution-box.mjs +140 -0
- package/dist/chem/stoichiometry/index.d.mts +1 -0
- package/dist/chem/stoichiometry/preset.d.mts +29 -0
- package/dist/chem/stoichiometry/preset.mjs +392 -0
- package/dist/chem/titration/index.d.mts +1 -0
- package/dist/chem/titration/preset.d.mts +29 -0
- package/dist/chem/titration/preset.mjs +436 -0
- package/dist/circuits/ac-dc/asset.mjs +295 -0
- package/dist/circuits/ac-dc/index.d.mts +1 -0
- package/dist/circuits/ac-dc/preset.d.mts +16 -0
- package/dist/circuits/ac-dc/preset.mjs +134 -0
- package/dist/circuits/capacitor-leak/index.d.mts +1 -0
- package/dist/circuits/capacitor-leak/preset.d.mts +32 -0
- package/dist/circuits/capacitor-leak/preset.mjs +271 -0
- package/dist/circuits/circuit/asset.d.mts +6 -0
- package/dist/circuits/circuit/asset.mjs +367 -0
- package/dist/circuits/circuit/index.d.mts +2 -0
- package/dist/circuits/circuit/preset.d.mts +46 -0
- package/dist/circuits/circuit/preset.mjs +235 -0
- package/dist/circuits/circuit-builder.d.mts +30 -0
- package/dist/circuits/circuit-builder.mjs +412 -0
- package/dist/circuits/circuit-lab.d.mts +20 -0
- package/dist/circuits/circuit-lab.mjs +400 -0
- package/dist/circuits/index.d.mts +7 -0
- package/dist/circuits/index.mjs +8 -0
- package/dist/commerce/accounting/core.d.mts +48 -0
- package/dist/commerce/accounting/core.mjs +57 -0
- package/dist/commerce/accounting/equation-balance.d.mts +35 -0
- package/dist/commerce/accounting/equation-balance.mjs +292 -0
- package/dist/commerce/accounting/index.d.mts +4 -0
- package/dist/commerce/accounting/journal-poster.d.mts +29 -0
- package/dist/commerce/accounting/journal-poster.mjs +472 -0
- package/dist/commerce/accounting/statement-sorter.d.mts +25 -0
- package/dist/commerce/accounting/statement-sorter.mjs +304 -0
- package/dist/commerce/economics/core.d.mts +33 -0
- package/dist/commerce/economics/core.mjs +26 -0
- package/dist/commerce/economics/demand-shift-vs-move.d.mts +35 -0
- package/dist/commerce/economics/demand-shift-vs-move.mjs +324 -0
- package/dist/commerce/economics/elasticity-revenue.d.mts +31 -0
- package/dist/commerce/economics/elasticity-revenue.mjs +253 -0
- package/dist/commerce/economics/index.d.mts +4 -0
- package/dist/commerce/economics/market-equilibrium.d.mts +33 -0
- package/dist/commerce/economics/market-equilibrium.mjs +340 -0
- package/dist/commerce/index.d.mts +9 -0
- package/dist/commerce/index.mjs +10 -0
- package/dist/core/easing.d.mts +28 -0
- package/dist/core/easing.mjs +66 -0
- package/dist/core/index.d.mts +10 -0
- package/dist/core/index.mjs +11 -0
- package/dist/core/numeric.d.mts +37 -0
- package/dist/core/numeric.mjs +75 -0
- package/dist/core/reactive.d.mts +24 -0
- package/dist/core/reactive.mjs +51 -0
- package/dist/core/rng.d.mts +21 -0
- package/dist/core/rng.mjs +39 -0
- package/dist/core/tex.d.mts +14 -0
- package/dist/core/tex.mjs +44 -0
- package/dist/core/timeline.d.mts +34 -0
- package/dist/core/timeline.mjs +77 -0
- package/dist/core/util.d.mts +19 -0
- package/dist/core/util.mjs +31 -0
- package/dist/discrete/arrangements/preset.d.mts +28 -0
- package/dist/discrete/arrangements/preset.mjs +304 -0
- package/dist/discrete/bayes/preset.d.mts +33 -0
- package/dist/discrete/bayes/preset.mjs +476 -0
- package/dist/discrete/binomial/preset.d.mts +25 -0
- package/dist/discrete/binomial/preset.mjs +333 -0
- package/dist/discrete/core/combinatorics.d.mts +23 -0
- package/dist/discrete/core/combinatorics.mjs +57 -0
- package/dist/discrete/core/inclusionExclusion.d.mts +19 -0
- package/dist/discrete/core/inclusionExclusion.mjs +30 -0
- package/dist/discrete/core/pigeonhole.d.mts +15 -0
- package/dist/discrete/core/pigeonhole.mjs +24 -0
- package/dist/discrete/core/probability.d.mts +29 -0
- package/dist/discrete/core/probability.mjs +43 -0
- package/dist/discrete/core/sets.d.mts +21 -0
- package/dist/discrete/core/sets.mjs +45 -0
- package/dist/discrete/counting-slots/preset.d.mts +30 -0
- package/dist/discrete/counting-slots/preset.mjs +553 -0
- package/dist/discrete/counting-tree/index.d.mts +1 -0
- package/dist/discrete/counting-tree/preset.d.mts +44 -0
- package/dist/discrete/counting-tree/preset.mjs +364 -0
- package/dist/discrete/expected-value/preset.d.mts +28 -0
- package/dist/discrete/expected-value/preset.mjs +352 -0
- package/dist/discrete/hypergeometric/preset.d.mts +25 -0
- package/dist/discrete/hypergeometric/preset.mjs +330 -0
- package/dist/discrete/index.d.mts +26 -0
- package/dist/discrete/index.mjs +27 -0
- package/dist/discrete/karnaugh/index.d.mts +1 -0
- package/dist/discrete/karnaugh/preset.d.mts +30 -0
- package/dist/discrete/karnaugh/preset.mjs +452 -0
- package/dist/discrete/lln/asset.mjs +206 -0
- package/dist/discrete/lln/index.d.mts +1 -0
- package/dist/discrete/lln/preset.d.mts +17 -0
- package/dist/discrete/lln/preset.mjs +152 -0
- package/dist/discrete/logic-circuit/index.d.mts +1 -0
- package/dist/discrete/logic-circuit/preset.d.mts +47 -0
- package/dist/discrete/logic-circuit/preset.mjs +307 -0
- package/dist/discrete/monte-carlo/index.d.mts +1 -0
- package/dist/discrete/monte-carlo/preset.d.mts +64 -0
- package/dist/discrete/monte-carlo/preset.mjs +446 -0
- package/dist/discrete/monty-hall/index.d.mts +1 -0
- package/dist/discrete/monty-hall/preset.d.mts +23 -0
- package/dist/discrete/monty-hall/preset.mjs +491 -0
- package/dist/discrete/outcome-builder/preset.d.mts +24 -0
- package/dist/discrete/outcome-builder/preset.mjs +283 -0
- package/dist/discrete/pascal/preset.d.mts +24 -0
- package/dist/discrete/pascal/preset.mjs +372 -0
- package/dist/discrete/sample-space/index.d.mts +1 -0
- package/dist/discrete/sample-space/preset.d.mts +42 -0
- package/dist/discrete/sample-space/preset.mjs +395 -0
- package/dist/discrete/selection/preset.d.mts +33 -0
- package/dist/discrete/selection/preset.mjs +406 -0
- package/dist/discrete/truth-table/index.d.mts +1 -0
- package/dist/discrete/truth-table/preset.d.mts +30 -0
- package/dist/discrete/truth-table/preset.mjs +456 -0
- package/dist/discrete/venn/index.d.mts +1 -0
- package/dist/discrete/venn/preset.d.mts +32 -0
- package/dist/discrete/venn/preset.mjs +461 -0
- package/dist/geography/cycle-lab/index.d.mts +1 -0
- package/dist/geography/cycle-lab/preset.d.mts +25 -0
- package/dist/geography/cycle-lab/preset.mjs +254 -0
- package/dist/geography/cycles.d.mts +21 -0
- package/dist/geography/cycles.mjs +205 -0
- package/dist/geography/index.d.mts +4 -0
- package/dist/geography/index.mjs +5 -0
- package/dist/geometry/board/index.d.mts +1 -0
- package/dist/geometry/board/preset.d.mts +71 -0
- package/dist/geometry/board/preset.mjs +148 -0
- package/dist/geometry/builder.d.mts +18 -0
- package/dist/geometry/builder.mjs +332 -0
- package/dist/geometry/index.d.mts +4 -0
- package/dist/geometry/index.mjs +5 -0
- package/dist/geometry/intersecting-circles.d.mts +17 -0
- package/dist/geometry/intersecting-circles.mjs +104 -0
- package/dist/ict/index.d.mts +5 -0
- package/dist/ict/index.mjs +6 -0
- package/dist/ict/number-systems/base-odometer.d.mts +34 -0
- package/dist/ict/number-systems/base-odometer.mjs +160 -0
- package/dist/ict/number-systems/bit-grouper.d.mts +32 -0
- package/dist/ict/number-systems/bit-grouper.mjs +190 -0
- package/dist/ict/number-systems/index.d.mts +4 -0
- package/dist/ict/number-systems/place-value-dial.d.mts +29 -0
- package/dist/ict/number-systems/place-value-dial.mjs +153 -0
- package/dist/ict/number-systems/wheel.d.mts +73 -0
- package/dist/ict/number-systems/wheel.mjs +279 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.mjs +11 -0
- package/dist/kit/anim.mjs +52 -0
- package/dist/kit/annotate.mjs +116 -0
- package/dist/kit/answer-check.d.mts +38 -0
- package/dist/kit/answer-check.mjs +65 -0
- package/dist/kit/asset-util.mjs +15 -0
- package/dist/kit/controls.mjs +77 -0
- package/dist/kit/cycle.d.mts +44 -0
- package/dist/kit/cycle.mjs +188 -0
- package/dist/kit/diagram.mjs +176 -0
- package/dist/kit/electronics.mjs +357 -0
- package/dist/kit/expr-analysis.d.mts +37 -0
- package/dist/kit/expr-analysis.mjs +111 -0
- package/dist/kit/frame.d.mts +70 -0
- package/dist/kit/frame.mjs +205 -0
- package/dist/kit/freq-tree.mjs +99 -0
- package/dist/kit/gameshow.mjs +315 -0
- package/dist/kit/index.d.mts +5 -0
- package/dist/kit/index.mjs +6 -0
- package/dist/kit/logic-gates.d.mts +6 -0
- package/dist/kit/logic-gates.mjs +210 -0
- package/dist/kit/molecules.mjs +178 -0
- package/dist/kit/pedagogy.d.mts +126 -0
- package/dist/kit/pedagogy.mjs +331 -0
- package/dist/kit/play.d.mts +21 -0
- package/dist/kit/play.mjs +52 -0
- package/dist/kit/probability.mjs +141 -0
- package/dist/kit/proportion.mjs +112 -0
- package/dist/kit/reaction.mjs +102 -0
- package/dist/kit/rich.d.mts +10 -0
- package/dist/kit/rich.mjs +21 -0
- package/dist/kit/scale.mjs +230 -0
- package/dist/kit/space.mjs +326 -0
- package/dist/kit/steps.d.mts +24 -0
- package/dist/kit/steps.mjs +57 -0
- package/dist/kit/thermal.mjs +289 -0
- package/dist/language/agreement/index.d.mts +1 -0
- package/dist/language/agreement/preset.d.mts +27 -0
- package/dist/language/agreement/preset.mjs +113 -0
- package/dist/language/article-lens/index.d.mts +1 -0
- package/dist/language/article-lens/preset.d.mts +31 -0
- package/dist/language/article-lens/preset.mjs +125 -0
- package/dist/language/deck.d.mts +45 -0
- package/dist/language/deck.mjs +61 -0
- package/dist/language/icon.d.mts +40 -0
- package/dist/language/icon.mjs +73 -0
- package/dist/language/index.d.mts +10 -0
- package/dist/language/index.mjs +11 -0
- package/dist/language/preposition-scene/index.d.mts +1 -0
- package/dist/language/preposition-scene/preset.d.mts +34 -0
- package/dist/language/preposition-scene/preset.mjs +234 -0
- package/dist/language/sentence-builder/index.d.mts +1 -0
- package/dist/language/sentence-builder/preset.d.mts +32 -0
- package/dist/language/sentence-builder/preset.mjs +122 -0
- package/dist/language/transform/index.d.mts +1 -0
- package/dist/language/transform/preset.d.mts +31 -0
- package/dist/language/transform/preset.mjs +137 -0
- package/dist/language/ui.d.mts +53 -0
- package/dist/language/ui.mjs +88 -0
- package/dist/language/word-match/index.d.mts +1 -0
- package/dist/language/word-match/preset.d.mts +22 -0
- package/dist/language/word-match/preset.mjs +148 -0
- package/dist/math/area-model/asset.d.mts +6 -0
- package/dist/math/area-model/asset.mjs +270 -0
- package/dist/math/area-model/index.d.mts +2 -0
- package/dist/math/area-model/preset.d.mts +29 -0
- package/dist/math/area-model/preset.mjs +243 -0
- package/dist/math/balance-algebra/asset.d.mts +6 -0
- package/dist/math/balance-algebra/asset.mjs +150 -0
- package/dist/math/balance-algebra/index.d.mts +2 -0
- package/dist/math/balance-algebra/preset.d.mts +30 -0
- package/dist/math/balance-algebra/preset.mjs +228 -0
- package/dist/math/derivation.d.mts +22 -0
- package/dist/math/derivation.mjs +113 -0
- package/dist/math/derivative-explorer/index.d.mts +1 -0
- package/dist/math/derivative-explorer/preset.d.mts +19 -0
- package/dist/math/derivative-explorer/preset.mjs +227 -0
- package/dist/math/function-machine/index.d.mts +1 -0
- package/dist/math/function-machine/preset.d.mts +21 -0
- package/dist/math/function-machine/preset.mjs +177 -0
- package/dist/math/gradient-descent.d.mts +23 -0
- package/dist/math/gradient-descent.mjs +473 -0
- package/dist/math/grapher/index.d.mts +1 -0
- package/dist/math/grapher/preset.d.mts +40 -0
- package/dist/math/grapher/preset.mjs +313 -0
- package/dist/math/harmonic-form/index.d.mts +1 -0
- package/dist/math/harmonic-form/preset.d.mts +21 -0
- package/dist/math/harmonic-form/preset.mjs +387 -0
- package/dist/math/index.d.mts +25 -0
- package/dist/math/index.mjs +26 -0
- package/dist/math/integral-explorer/index.d.mts +1 -0
- package/dist/math/integral-explorer/preset.d.mts +23 -0
- package/dist/math/integral-explorer/preset.mjs +217 -0
- package/dist/math/interactive/index.d.mts +1 -0
- package/dist/math/interactive/preset.d.mts +72 -0
- package/dist/math/interactive/preset.mjs +202 -0
- package/dist/math/limit-explorer/index.d.mts +1 -0
- package/dist/math/limit-explorer/preset.d.mts +19 -0
- package/dist/math/limit-explorer/preset.mjs +216 -0
- package/dist/math/linear-system/index.d.mts +1 -0
- package/dist/math/linear-system/preset.d.mts +28 -0
- package/dist/math/linear-system/preset.mjs +164 -0
- package/dist/math/mystery-bucket/asset.d.mts +6 -0
- package/dist/math/mystery-bucket/asset.mjs +145 -0
- package/dist/math/mystery-bucket/index.d.mts +2 -0
- package/dist/math/mystery-bucket/preset.d.mts +36 -0
- package/dist/math/mystery-bucket/preset.mjs +116 -0
- package/dist/math/number-line/index.d.mts +1 -0
- package/dist/math/number-line/preset.d.mts +24 -0
- package/dist/math/number-line/preset.mjs +142 -0
- package/dist/math/parabola/index.d.mts +1 -0
- package/dist/math/parabola/preset.d.mts +13 -0
- package/dist/math/parabola/preset.mjs +79 -0
- package/dist/math/pattern/asset.d.mts +6 -0
- package/dist/math/pattern/asset.mjs +102 -0
- package/dist/math/pattern/index.d.mts +2 -0
- package/dist/math/pattern/preset.d.mts +32 -0
- package/dist/math/pattern/preset.mjs +294 -0
- package/dist/math/triangle-trig/index.d.mts +1 -0
- package/dist/math/triangle-trig/preset.d.mts +47 -0
- package/dist/math/triangle-trig/preset.mjs +245 -0
- package/dist/math/trig-explorer.d.mts +18 -0
- package/dist/math/trig-explorer.mjs +209 -0
- package/dist/ml/boundary/index.d.mts +1 -0
- package/dist/ml/boundary/preset.d.mts +24 -0
- package/dist/ml/boundary/preset.mjs +385 -0
- package/dist/ml/classifier/index.d.mts +1 -0
- package/dist/ml/classifier/preset.d.mts +25 -0
- package/dist/ml/classifier/preset.mjs +315 -0
- package/dist/ml/index.d.mts +6 -0
- package/dist/ml/index.mjs +7 -0
- package/dist/ml/kmeans/index.d.mts +1 -0
- package/dist/ml/kmeans/preset.d.mts +33 -0
- package/dist/ml/kmeans/preset.mjs +236 -0
- package/dist/ml/knn/index.d.mts +1 -0
- package/dist/ml/knn/preset.d.mts +28 -0
- package/dist/ml/knn/preset.mjs +279 -0
- package/dist/ml/regression/index.d.mts +1 -0
- package/dist/ml/regression/preset.d.mts +32 -0
- package/dist/ml/regression/preset.mjs +394 -0
- package/dist/physics/atwood/index.d.mts +1 -0
- package/dist/physics/atwood/preset.d.mts +23 -0
- package/dist/physics/atwood/preset.mjs +312 -0
- package/dist/physics/bullet-walls/index.d.mts +1 -0
- package/dist/physics/bullet-walls/preset.d.mts +28 -0
- package/dist/physics/bullet-walls/preset.mjs +373 -0
- package/dist/physics/carnot/index.d.mts +1 -0
- package/dist/physics/carnot/preset.d.mts +27 -0
- package/dist/physics/carnot/preset.mjs +427 -0
- package/dist/physics/circular-motion/index.d.mts +1 -0
- package/dist/physics/circular-motion/preset.d.mts +25 -0
- package/dist/physics/circular-motion/preset.mjs +293 -0
- package/dist/physics/collision-track/index.d.mts +1 -0
- package/dist/physics/collision-track/preset.d.mts +27 -0
- package/dist/physics/collision-track/preset.mjs +352 -0
- package/dist/physics/efficiency/index.d.mts +1 -0
- package/dist/physics/efficiency/preset.d.mts +33 -0
- package/dist/physics/efficiency/preset.mjs +343 -0
- package/dist/physics/electric-field/index.d.mts +1 -0
- package/dist/physics/electric-field/preset.d.mts +15 -0
- package/dist/physics/electric-field/preset.mjs +306 -0
- package/dist/physics/energy-skate/index.d.mts +1 -0
- package/dist/physics/energy-skate/preset.d.mts +25 -0
- package/dist/physics/energy-skate/preset.mjs +254 -0
- package/dist/physics/entropy/index.d.mts +1 -0
- package/dist/physics/entropy/preset.d.mts +18 -0
- package/dist/physics/entropy/preset.mjs +416 -0
- package/dist/physics/expansion/index.d.mts +1 -0
- package/dist/physics/expansion/preset.d.mts +26 -0
- package/dist/physics/expansion/preset.mjs +609 -0
- package/dist/physics/exponential/asset.mjs +221 -0
- package/dist/physics/exponential/index.d.mts +1 -0
- package/dist/physics/exponential/preset.d.mts +17 -0
- package/dist/physics/exponential/preset.mjs +182 -0
- package/dist/physics/gas-process/index.d.mts +1 -0
- package/dist/physics/gas-process/preset.d.mts +30 -0
- package/dist/physics/gas-process/preset.mjs +384 -0
- package/dist/physics/gravitation/index.d.mts +1 -0
- package/dist/physics/gravitation/preset.d.mts +24 -0
- package/dist/physics/gravitation/preset.mjs +345 -0
- package/dist/physics/gravity-drop.d.mts +9 -0
- package/dist/physics/gravity-drop.mjs +187 -0
- package/dist/physics/heat-transfer/index.d.mts +1 -0
- package/dist/physics/heat-transfer/preset.d.mts +27 -0
- package/dist/physics/heat-transfer/preset.mjs +626 -0
- package/dist/physics/impulse/index.d.mts +1 -0
- package/dist/physics/impulse/preset.d.mts +29 -0
- package/dist/physics/impulse/preset.mjs +453 -0
- package/dist/physics/index.d.mts +43 -0
- package/dist/physics/index.mjs +44 -0
- package/dist/physics/kepler/index.d.mts +1 -0
- package/dist/physics/kepler/preset.d.mts +27 -0
- package/dist/physics/kepler/preset.mjs +257 -0
- package/dist/physics/lever/asset.d.mts +6 -0
- package/dist/physics/lever/asset.mjs +220 -0
- package/dist/physics/lever/index.d.mts +2 -0
- package/dist/physics/lever/preset.d.mts +31 -0
- package/dist/physics/lever/preset.mjs +261 -0
- package/dist/physics/lorentz/index.d.mts +1 -0
- package/dist/physics/lorentz/preset.d.mts +29 -0
- package/dist/physics/lorentz/preset.mjs +367 -0
- package/dist/physics/magnetism/index.d.mts +1 -0
- package/dist/physics/magnetism/preset.d.mts +15 -0
- package/dist/physics/magnetism/preset.mjs +334 -0
- package/dist/physics/optics/asset.d.mts +6 -0
- package/dist/physics/optics/asset.mjs +234 -0
- package/dist/physics/optics/index.d.mts +2 -0
- package/dist/physics/optics/preset.d.mts +14 -0
- package/dist/physics/optics/preset.mjs +202 -0
- package/dist/physics/orbit-lab.d.mts +6 -0
- package/dist/physics/orbit-lab.mjs +222 -0
- package/dist/physics/projectile-lab.d.mts +10 -0
- package/dist/physics/projectile-lab.mjs +354 -0
- package/dist/physics/rain-relative/index.d.mts +1 -0
- package/dist/physics/rain-relative/preset.d.mts +19 -0
- package/dist/physics/rain-relative/preset.mjs +358 -0
- package/dist/physics/ramp-forces/index.d.mts +1 -0
- package/dist/physics/ramp-forces/preset.d.mts +36 -0
- package/dist/physics/ramp-forces/preset.mjs +550 -0
- package/dist/physics/river-boat.d.mts +22 -0
- package/dist/physics/river-boat.mjs +498 -0
- package/dist/physics/shm/index.d.mts +1 -0
- package/dist/physics/shm/preset.d.mts +33 -0
- package/dist/physics/shm/preset.mjs +554 -0
- package/dist/physics/stopping-distance/index.d.mts +1 -0
- package/dist/physics/stopping-distance/preset.d.mts +29 -0
- package/dist/physics/stopping-distance/preset.mjs +662 -0
- package/dist/physics/temperature-scales/index.d.mts +1 -0
- package/dist/physics/temperature-scales/preset.d.mts +15 -0
- package/dist/physics/temperature-scales/preset.mjs +353 -0
- package/dist/physics/terminal-velocity/index.d.mts +1 -0
- package/dist/physics/terminal-velocity/preset.d.mts +26 -0
- package/dist/physics/terminal-velocity/preset.mjs +404 -0
- package/dist/physics/thermal/index.d.mts +1 -0
- package/dist/physics/thermal/preset.d.mts +44 -0
- package/dist/physics/thermal/preset.mjs +373 -0
- package/dist/physics/vector-board/index.d.mts +1 -0
- package/dist/physics/vector-board/preset.d.mts +65 -0
- package/dist/physics/vector-board/preset.mjs +273 -0
- package/dist/physics/vector-board/view.d.mts +49 -0
- package/dist/physics/vector-board/view.mjs +58 -0
- package/dist/physics/vector-scene.d.mts +41 -0
- package/dist/physics/vector-scene.mjs +211 -0
- package/dist/physics/vector-types/index.d.mts +1 -0
- package/dist/physics/vector-types/preset.d.mts +27 -0
- package/dist/physics/vector-types/preset.mjs +192 -0
- package/dist/physics/water-density/index.d.mts +1 -0
- package/dist/physics/water-density/preset.d.mts +18 -0
- package/dist/physics/water-density/preset.mjs +439 -0
- package/dist/physics/waves/core.mjs +33 -0
- package/dist/physics/waves/doppler.d.mts +23 -0
- package/dist/physics/waves/doppler.mjs +260 -0
- package/dist/physics/waves/index.d.mts +4 -0
- package/dist/physics/waves/preset.d.mts +30 -0
- package/dist/physics/waves/preset.mjs +488 -0
- package/dist/physics/waves/ripple.d.mts +26 -0
- package/dist/physics/waves/ripple.mjs +234 -0
- package/dist/physics/waves/string.d.mts +29 -0
- package/dist/physics/waves/string.mjs +289 -0
- package/dist/physics/work-energy/index.d.mts +1 -0
- package/dist/physics/work-energy/preset.d.mts +17 -0
- package/dist/physics/work-energy/preset.mjs +341 -0
- package/dist/schemas/index.d.mts +235 -0
- package/dist/schemas/index.mjs +145 -0
- package/dist/statistics/center-spread/preset.d.mts +34 -0
- package/dist/statistics/center-spread/preset.mjs +323 -0
- package/dist/statistics/core/descriptive.d.mts +35 -0
- package/dist/statistics/core/descriptive.mjs +64 -0
- package/dist/statistics/core/normal.d.mts +21 -0
- package/dist/statistics/core/normal.mjs +37 -0
- package/dist/statistics/core/sequences.d.mts +27 -0
- package/dist/statistics/core/sequences.mjs +35 -0
- package/dist/statistics/galton/preset.d.mts +27 -0
- package/dist/statistics/galton/preset.mjs +331 -0
- package/dist/statistics/histogram/preset.d.mts +27 -0
- package/dist/statistics/histogram/preset.mjs +385 -0
- package/dist/statistics/index.d.mts +11 -0
- package/dist/statistics/index.mjs +12 -0
- package/dist/statistics/normal/preset.d.mts +30 -0
- package/dist/statistics/normal/preset.mjs +400 -0
- package/dist/statistics/sampling/preset.d.mts +32 -0
- package/dist/statistics/sampling/preset.mjs +406 -0
- package/dist/statistics/sequence/preset.d.mts +28 -0
- package/dist/statistics/sequence/preset.mjs +302 -0
- package/dist/statistics/z-table/preset.d.mts +28 -0
- package/dist/statistics/z-table/preset.mjs +348 -0
- package/package.json +266 -0
- package/styles.css +267 -0
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { clamp, num } from "../core/util.mjs";
|
|
4
|
+
import { Tex as Tex$1 } from "../core/tex.mjs";
|
|
5
|
+
import { Chip, Slider } from "../kit/controls.mjs";
|
|
6
|
+
import { Callout, ControlBar, Field, LabFrame } from "../kit/frame.mjs";
|
|
7
|
+
import { ResistorBox } from "../kit/diagram.mjs";
|
|
8
|
+
import { useEffect, useState } from "react";
|
|
9
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { Label, Segment, Stage } from "@classytic/stage";
|
|
11
|
+
|
|
12
|
+
//#region src/circuits/circuit-lab.tsx
|
|
13
|
+
/**
|
|
14
|
+
* CircuitLab — two resistors driven by a battery, in series or parallel, with the
|
|
15
|
+
* voltage- and current-divider rules made visible. Drag V, R₁, R₂; flip series
|
|
16
|
+
* ↔ parallel; step through: total resistance → total current → how it divides.
|
|
17
|
+
*
|
|
18
|
+
* Series: same current, voltage splits (VDR Vᵢ = V·Rᵢ/ΣR).
|
|
19
|
+
* Parallel: same voltage, current splits (CDR Iᵢ = I·R_other/ΣR).
|
|
20
|
+
*
|
|
21
|
+
* Now on the @classytic/stage engine: the schematic is SVG wires + `ResistorBox`
|
|
22
|
+
* glyphs + labels (accessible, themed) instead of a canvas blit.
|
|
23
|
+
*/
|
|
24
|
+
const STEPS_SERIES = [
|
|
25
|
+
"Two resistors in series carry the SAME current.",
|
|
26
|
+
"Add them up: the total resistance is R₁ + R₂.",
|
|
27
|
+
"Total current I = V / (R₁ + R₂) flows through both.",
|
|
28
|
+
"The voltage splits in proportion (VDR): Vᵢ = V · Rᵢ / (R₁ + R₂)."
|
|
29
|
+
];
|
|
30
|
+
const STEPS_PARALLEL = [
|
|
31
|
+
"Two resistors in parallel share the SAME voltage.",
|
|
32
|
+
"Combine reciprocals: 1/R = 1/R₁ + 1/R₂.",
|
|
33
|
+
"Total current I = V / R splits between the branches.",
|
|
34
|
+
"The current splits inversely (CDR): Iᵢ = I · R_other / (R₁ + R₂)."
|
|
35
|
+
];
|
|
36
|
+
const VIEW = {
|
|
37
|
+
xMin: 0,
|
|
38
|
+
xMax: 100,
|
|
39
|
+
yMin: 0,
|
|
40
|
+
yMax: 60
|
|
41
|
+
};
|
|
42
|
+
const TOP = 46, BOT = 12, BX = 9, RIGHT = 93;
|
|
43
|
+
function CircuitLab({ voltage, r1, r2, mode: modeInit = "series", height = 320 } = {}) {
|
|
44
|
+
const [V, setV] = useState(clamp(num(voltage, 12), 1, 24));
|
|
45
|
+
const [R1, setR1] = useState(clamp(num(r1, 100), 10, 1e3));
|
|
46
|
+
const [R2, setR2] = useState(clamp(num(r2, 200), 10, 1e3));
|
|
47
|
+
const [parallel, setParallel] = useState(modeInit === "parallel");
|
|
48
|
+
const [step, setStep] = useState(0);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
setV(clamp(num(voltage, 12), 1, 24));
|
|
51
|
+
}, [voltage]);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
setR1(clamp(num(r1, 100), 10, 1e3));
|
|
54
|
+
}, [r1]);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
setR2(clamp(num(r2, 200), 10, 1e3));
|
|
57
|
+
}, [r2]);
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
setParallel(modeInit === "parallel");
|
|
60
|
+
}, [modeInit]);
|
|
61
|
+
const Rtot = parallel ? R1 * R2 / (R1 + R2) : R1 + R2;
|
|
62
|
+
const Itot = V / Rtot;
|
|
63
|
+
const v1 = parallel ? V : V * R1 / (R1 + R2);
|
|
64
|
+
const v2 = parallel ? V : V * R2 / (R1 + R2);
|
|
65
|
+
const i1 = parallel ? V / R1 : Itot;
|
|
66
|
+
const i2 = parallel ? V / R2 : Itot;
|
|
67
|
+
const steps = parallel ? STEPS_PARALLEL : STEPS_SERIES;
|
|
68
|
+
const clampedStep = Math.min(step, steps.length - 1);
|
|
69
|
+
const W = (a, b, key) => /* @__PURE__ */ jsx(Segment, {
|
|
70
|
+
from: a,
|
|
71
|
+
to: b,
|
|
72
|
+
color: "var(--stage-fg)",
|
|
73
|
+
opacity: .5,
|
|
74
|
+
weight: 2
|
|
75
|
+
}, key);
|
|
76
|
+
const cyMid = 58 / 2;
|
|
77
|
+
const figure = /* @__PURE__ */ jsxs(Stage, {
|
|
78
|
+
view: VIEW,
|
|
79
|
+
height,
|
|
80
|
+
preserveAspect: false,
|
|
81
|
+
ariaLabel: `${parallel ? "Parallel" : "Series"} circuit: ${V}V battery with R1 ${R1.toFixed(0)} and R2 ${R2.toFixed(0)} ohms`,
|
|
82
|
+
children: [
|
|
83
|
+
W({
|
|
84
|
+
x: BX,
|
|
85
|
+
y: 35
|
|
86
|
+
}, {
|
|
87
|
+
x: BX,
|
|
88
|
+
y: TOP
|
|
89
|
+
}, "b-up"),
|
|
90
|
+
W({
|
|
91
|
+
x: BX,
|
|
92
|
+
y: cyMid - 6
|
|
93
|
+
}, {
|
|
94
|
+
x: BX,
|
|
95
|
+
y: BOT
|
|
96
|
+
}, "b-dn"),
|
|
97
|
+
/* @__PURE__ */ jsx(Segment, {
|
|
98
|
+
from: {
|
|
99
|
+
x: BX - 5,
|
|
100
|
+
y: 35
|
|
101
|
+
},
|
|
102
|
+
to: {
|
|
103
|
+
x: 14,
|
|
104
|
+
y: 35
|
|
105
|
+
},
|
|
106
|
+
color: "var(--stage-accent-2)",
|
|
107
|
+
weight: 2.5
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ jsx(Segment, {
|
|
110
|
+
from: {
|
|
111
|
+
x: BX - 3,
|
|
112
|
+
y: cyMid - 6
|
|
113
|
+
},
|
|
114
|
+
to: {
|
|
115
|
+
x: 12,
|
|
116
|
+
y: cyMid - 6
|
|
117
|
+
},
|
|
118
|
+
color: "var(--stage-accent-2)",
|
|
119
|
+
weight: 2.5
|
|
120
|
+
}),
|
|
121
|
+
/* @__PURE__ */ jsx(Label, {
|
|
122
|
+
x: 17,
|
|
123
|
+
y: cyMid,
|
|
124
|
+
text: `${V.toFixed(0)} V`,
|
|
125
|
+
color: "var(--stage-accent-2)",
|
|
126
|
+
anchor: "start",
|
|
127
|
+
size: 12
|
|
128
|
+
}),
|
|
129
|
+
!parallel ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
130
|
+
W({
|
|
131
|
+
x: BX,
|
|
132
|
+
y: TOP
|
|
133
|
+
}, {
|
|
134
|
+
x: 26,
|
|
135
|
+
y: TOP
|
|
136
|
+
}, "s1"),
|
|
137
|
+
/* @__PURE__ */ jsx(ResistorBox, {
|
|
138
|
+
center: {
|
|
139
|
+
x: 34,
|
|
140
|
+
y: TOP
|
|
141
|
+
},
|
|
142
|
+
w: 16,
|
|
143
|
+
h: 7,
|
|
144
|
+
color: "var(--stage-accent)",
|
|
145
|
+
label: `R₁ ${R1.toFixed(0)}Ω`,
|
|
146
|
+
reading: step >= 3 ? `${v1.toFixed(2)} V` : void 0
|
|
147
|
+
}),
|
|
148
|
+
W({
|
|
149
|
+
x: 42,
|
|
150
|
+
y: TOP
|
|
151
|
+
}, {
|
|
152
|
+
x: 58,
|
|
153
|
+
y: TOP
|
|
154
|
+
}, "s2"),
|
|
155
|
+
/* @__PURE__ */ jsx(ResistorBox, {
|
|
156
|
+
center: {
|
|
157
|
+
x: 66,
|
|
158
|
+
y: TOP
|
|
159
|
+
},
|
|
160
|
+
w: 16,
|
|
161
|
+
h: 7,
|
|
162
|
+
color: "var(--stage-good)",
|
|
163
|
+
label: `R₂ ${R2.toFixed(0)}Ω`,
|
|
164
|
+
reading: step >= 3 ? `${v2.toFixed(2)} V` : void 0
|
|
165
|
+
}),
|
|
166
|
+
W({
|
|
167
|
+
x: 74,
|
|
168
|
+
y: TOP
|
|
169
|
+
}, {
|
|
170
|
+
x: RIGHT,
|
|
171
|
+
y: TOP
|
|
172
|
+
}, "s3"),
|
|
173
|
+
W({
|
|
174
|
+
x: RIGHT,
|
|
175
|
+
y: TOP
|
|
176
|
+
}, {
|
|
177
|
+
x: RIGHT,
|
|
178
|
+
y: BOT
|
|
179
|
+
}, "s4"),
|
|
180
|
+
W({
|
|
181
|
+
x: RIGHT,
|
|
182
|
+
y: BOT
|
|
183
|
+
}, {
|
|
184
|
+
x: BX,
|
|
185
|
+
y: BOT
|
|
186
|
+
}, "s5")
|
|
187
|
+
] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
188
|
+
W({
|
|
189
|
+
x: BX,
|
|
190
|
+
y: TOP
|
|
191
|
+
}, {
|
|
192
|
+
x: 30,
|
|
193
|
+
y: TOP
|
|
194
|
+
}, "p1"),
|
|
195
|
+
W({
|
|
196
|
+
x: 30,
|
|
197
|
+
y: TOP
|
|
198
|
+
}, {
|
|
199
|
+
x: 30,
|
|
200
|
+
y: BOT
|
|
201
|
+
}, "pl"),
|
|
202
|
+
W({
|
|
203
|
+
x: BX,
|
|
204
|
+
y: BOT
|
|
205
|
+
}, {
|
|
206
|
+
x: 30,
|
|
207
|
+
y: BOT
|
|
208
|
+
}, "p2"),
|
|
209
|
+
W({
|
|
210
|
+
x: 72,
|
|
211
|
+
y: TOP
|
|
212
|
+
}, {
|
|
213
|
+
x: RIGHT,
|
|
214
|
+
y: TOP
|
|
215
|
+
}, "p3"),
|
|
216
|
+
W({
|
|
217
|
+
x: RIGHT,
|
|
218
|
+
y: TOP
|
|
219
|
+
}, {
|
|
220
|
+
x: RIGHT,
|
|
221
|
+
y: BOT
|
|
222
|
+
}, "pr-out"),
|
|
223
|
+
W({
|
|
224
|
+
x: 72,
|
|
225
|
+
y: BOT
|
|
226
|
+
}, {
|
|
227
|
+
x: RIGHT,
|
|
228
|
+
y: BOT
|
|
229
|
+
}, "p4"),
|
|
230
|
+
W({
|
|
231
|
+
x: 72,
|
|
232
|
+
y: TOP
|
|
233
|
+
}, {
|
|
234
|
+
x: 72,
|
|
235
|
+
y: BOT
|
|
236
|
+
}, "pr"),
|
|
237
|
+
W({
|
|
238
|
+
x: 30,
|
|
239
|
+
y: TOP
|
|
240
|
+
}, {
|
|
241
|
+
x: 43,
|
|
242
|
+
y: TOP
|
|
243
|
+
}, "b1a"),
|
|
244
|
+
/* @__PURE__ */ jsx(ResistorBox, {
|
|
245
|
+
center: {
|
|
246
|
+
x: 51,
|
|
247
|
+
y: TOP
|
|
248
|
+
},
|
|
249
|
+
w: 16,
|
|
250
|
+
h: 7,
|
|
251
|
+
color: "var(--stage-accent)",
|
|
252
|
+
label: `R₁ ${R1.toFixed(0)}Ω`,
|
|
253
|
+
reading: step >= 3 ? `${(i1 * 1e3).toFixed(1)} mA` : void 0
|
|
254
|
+
}),
|
|
255
|
+
W({
|
|
256
|
+
x: 59,
|
|
257
|
+
y: TOP
|
|
258
|
+
}, {
|
|
259
|
+
x: 72,
|
|
260
|
+
y: TOP
|
|
261
|
+
}, "b1b"),
|
|
262
|
+
W({
|
|
263
|
+
x: 30,
|
|
264
|
+
y: BOT
|
|
265
|
+
}, {
|
|
266
|
+
x: 43,
|
|
267
|
+
y: BOT
|
|
268
|
+
}, "b2a"),
|
|
269
|
+
/* @__PURE__ */ jsx(ResistorBox, {
|
|
270
|
+
center: {
|
|
271
|
+
x: 51,
|
|
272
|
+
y: BOT
|
|
273
|
+
},
|
|
274
|
+
w: 16,
|
|
275
|
+
h: 7,
|
|
276
|
+
color: "var(--stage-good)",
|
|
277
|
+
label: `R₂ ${R2.toFixed(0)}Ω`,
|
|
278
|
+
reading: step >= 3 ? `${(i2 * 1e3).toFixed(1)} mA` : void 0
|
|
279
|
+
}),
|
|
280
|
+
W({
|
|
281
|
+
x: 59,
|
|
282
|
+
y: BOT
|
|
283
|
+
}, {
|
|
284
|
+
x: 72,
|
|
285
|
+
y: BOT
|
|
286
|
+
}, "b2b")
|
|
287
|
+
] })
|
|
288
|
+
]
|
|
289
|
+
});
|
|
290
|
+
const controls = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(ControlBar, { children: [
|
|
291
|
+
/* @__PURE__ */ jsx("button", {
|
|
292
|
+
type: "button",
|
|
293
|
+
className: "lab-chip",
|
|
294
|
+
onClick: () => setStep((s) => Math.max(0, s - 1)),
|
|
295
|
+
disabled: clampedStep === 0,
|
|
296
|
+
children: "← Back"
|
|
297
|
+
}),
|
|
298
|
+
/* @__PURE__ */ jsxs("span", {
|
|
299
|
+
style: {
|
|
300
|
+
fontVariantNumeric: "tabular-nums",
|
|
301
|
+
opacity: .75
|
|
302
|
+
},
|
|
303
|
+
children: [
|
|
304
|
+
"step ",
|
|
305
|
+
clampedStep + 1,
|
|
306
|
+
" / ",
|
|
307
|
+
steps.length
|
|
308
|
+
]
|
|
309
|
+
}),
|
|
310
|
+
/* @__PURE__ */ jsx("button", {
|
|
311
|
+
type: "button",
|
|
312
|
+
className: "lab-chip",
|
|
313
|
+
onClick: () => setStep((s) => Math.min(steps.length - 1, s + 1)),
|
|
314
|
+
disabled: clampedStep >= steps.length - 1,
|
|
315
|
+
children: "Next →"
|
|
316
|
+
}),
|
|
317
|
+
/* @__PURE__ */ jsx(Chip, {
|
|
318
|
+
selected: parallel,
|
|
319
|
+
onClick: () => {
|
|
320
|
+
setParallel((p) => !p);
|
|
321
|
+
setStep(0);
|
|
322
|
+
},
|
|
323
|
+
children: parallel ? "parallel" : "series"
|
|
324
|
+
})
|
|
325
|
+
] }), /* @__PURE__ */ jsxs(ControlBar, { children: [
|
|
326
|
+
/* @__PURE__ */ jsx(Field, {
|
|
327
|
+
label: "V",
|
|
328
|
+
children: /* @__PURE__ */ jsx(Slider, {
|
|
329
|
+
value: V,
|
|
330
|
+
min: 1,
|
|
331
|
+
max: 24,
|
|
332
|
+
step: 1,
|
|
333
|
+
onChange: setV,
|
|
334
|
+
ariaLabel: "battery voltage",
|
|
335
|
+
style: { width: 90 }
|
|
336
|
+
})
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ jsx(Field, {
|
|
339
|
+
label: "R₁",
|
|
340
|
+
children: /* @__PURE__ */ jsx(Slider, {
|
|
341
|
+
value: R1,
|
|
342
|
+
min: 10,
|
|
343
|
+
max: 1e3,
|
|
344
|
+
step: 10,
|
|
345
|
+
onChange: setR1,
|
|
346
|
+
ariaLabel: "resistor 1",
|
|
347
|
+
style: { width: 90 }
|
|
348
|
+
})
|
|
349
|
+
}),
|
|
350
|
+
/* @__PURE__ */ jsx(Field, {
|
|
351
|
+
label: "R₂",
|
|
352
|
+
children: /* @__PURE__ */ jsx(Slider, {
|
|
353
|
+
value: R2,
|
|
354
|
+
min: 10,
|
|
355
|
+
max: 1e3,
|
|
356
|
+
step: 10,
|
|
357
|
+
onChange: setR2,
|
|
358
|
+
ariaLabel: "resistor 2",
|
|
359
|
+
style: { width: 90 }
|
|
360
|
+
})
|
|
361
|
+
})
|
|
362
|
+
] })] });
|
|
363
|
+
const aside = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Callout, {
|
|
364
|
+
tone: "result",
|
|
365
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
366
|
+
style: {
|
|
367
|
+
display: "grid",
|
|
368
|
+
gap: 4,
|
|
369
|
+
fontVariantNumeric: "tabular-nums"
|
|
370
|
+
},
|
|
371
|
+
children: [/* @__PURE__ */ jsxs("span", { children: [
|
|
372
|
+
"R ",
|
|
373
|
+
Rtot.toFixed(0),
|
|
374
|
+
" Ω"
|
|
375
|
+
] }), /* @__PURE__ */ jsxs("span", { children: [
|
|
376
|
+
"I ",
|
|
377
|
+
(Itot * 1e3).toFixed(1),
|
|
378
|
+
" mA"
|
|
379
|
+
] })]
|
|
380
|
+
})
|
|
381
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
382
|
+
style: {
|
|
383
|
+
display: "grid",
|
|
384
|
+
gap: 6,
|
|
385
|
+
padding: "8px 2px 0",
|
|
386
|
+
fontSize: 14
|
|
387
|
+
},
|
|
388
|
+
children: parallel ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Tex$1, { tex: `\\frac{1}{R}=\\frac{1}{R_1}+\\frac{1}{R_2}\\Rightarrow R=${Rtot.toFixed(1)}\\,\\Omega` }), /* @__PURE__ */ jsx(Tex$1, { tex: `I_1=I\\cdot\\frac{R_2}{R_1+R_2}=${(i1 * 1e3).toFixed(1)}\\,\\text{mA}` })] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Tex$1, { tex: `R=R_1+R_2=${Rtot.toFixed(0)}\\,\\Omega,\\quad I=\\frac{V}{R}=${(Itot * 1e3).toFixed(1)}\\,\\text{mA}` }), /* @__PURE__ */ jsx(Tex$1, { tex: `V_1=V\\cdot\\frac{R_1}{R_1+R_2}=${v1.toFixed(2)}\\,\\text{V}` })] })
|
|
389
|
+
})] });
|
|
390
|
+
return /* @__PURE__ */ jsx(LabFrame, {
|
|
391
|
+
title: parallel ? "Parallel — current divides" : "Series — voltage divides",
|
|
392
|
+
prompt: steps[clampedStep],
|
|
393
|
+
aside,
|
|
394
|
+
controls,
|
|
395
|
+
children: figure
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
//#endregion
|
|
400
|
+
export { CircuitLab };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CIRCUIT_NETWORK_ASSET } from "./circuit/asset.mjs";
|
|
2
|
+
import { CircuitComponentSpec, CircuitGoal, CircuitNetworkLab, CircuitNetworkProps, circuitDoc } from "./circuit/preset.mjs";
|
|
3
|
+
import { CircuitLab, CircuitLabProps } from "./circuit-lab.mjs";
|
|
4
|
+
import { CircuitBuilder, CircuitBuilderProps, CircuitComponent } from "./circuit-builder.mjs";
|
|
5
|
+
import { CapacitorLeakLab, CapacitorLeakProps } from "./capacitor-leak/preset.mjs";
|
|
6
|
+
import { AcDcLab, AcDcProps } from "./ac-dc/preset.mjs";
|
|
7
|
+
export { AcDcLab, type AcDcProps, CIRCUIT_NETWORK_ASSET, CapacitorLeakLab, type CapacitorLeakProps, CircuitBuilder, type CircuitBuilderProps, type CircuitComponent, type CircuitComponentSpec, type CircuitGoal, CircuitLab, type CircuitLabProps, CircuitNetworkLab, type CircuitNetworkProps, circuitDoc };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CIRCUIT_NETWORK_ASSET } from "./circuit/asset.mjs";
|
|
2
|
+
import { CircuitNetworkLab, circuitDoc } from "./circuit/preset.mjs";
|
|
3
|
+
import { CircuitLab } from "./circuit-lab.mjs";
|
|
4
|
+
import { CircuitBuilder } from "./circuit-builder.mjs";
|
|
5
|
+
import { CapacitorLeakLab } from "./capacitor-leak/preset.mjs";
|
|
6
|
+
import { AcDcLab } from "./ac-dc/preset.mjs";
|
|
7
|
+
|
|
8
|
+
export { AcDcLab, CIRCUIT_NETWORK_ASSET, CapacitorLeakLab, CircuitBuilder, CircuitLab, CircuitNetworkLab, circuitDoc };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//#region src/commerce/accounting/core.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The SIMPLE, CORRECT double-entry core — the single source of truth every
|
|
4
|
+
* accounting lab shares. Deliberately NOT the industry @classytic/ledger engine
|
|
5
|
+
* (events/repositories/FX/fiscal-close): a teaching lab needs only the rules,
|
|
6
|
+
* which are these (verified against that production ledger):
|
|
7
|
+
*
|
|
8
|
+
* • 5 categories: Asset, Liability, Equity, Income, Expense.
|
|
9
|
+
* • Normal balance: Assets & Expenses are DEBIT-normal; Liabilities, Equity,
|
|
10
|
+
* Income are CREDIT-normal.
|
|
11
|
+
* • Every journal entry: total debits = total credits.
|
|
12
|
+
* • Accounting equation: Assets = Liabilities + Equity, where Equity absorbs
|
|
13
|
+
* profit (Income − Expense).
|
|
14
|
+
*/
|
|
15
|
+
type AccountCategory = 'Asset' | 'Liability' | 'Equity' | 'Income' | 'Expense';
|
|
16
|
+
type Side = 'debit' | 'credit';
|
|
17
|
+
interface Account {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
category: AccountCategory;
|
|
21
|
+
}
|
|
22
|
+
/** Assets & Expenses grow on the LEFT (debit); the rest grow on the RIGHT (credit). */
|
|
23
|
+
declare function normalBalance(category: AccountCategory): Side;
|
|
24
|
+
/** Which financial statement an account lands on. */
|
|
25
|
+
declare function statementOf(category: AccountCategory): 'Balance Sheet' | 'Income Statement';
|
|
26
|
+
/** A balanced entry has equal total debits and credits (within a cent). */
|
|
27
|
+
declare function debitsEqualCredits(lines: ReadonlyArray<{
|
|
28
|
+
debit?: number;
|
|
29
|
+
credit?: number;
|
|
30
|
+
}>): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Sum signed account balances (natural terms: + = increase on the normal side)
|
|
33
|
+
* into the accounting-equation parts. Equity absorbs profit = Income − Expense,
|
|
34
|
+
* so `assets` should equal `liabilities + equity` whenever every posted entry
|
|
35
|
+
* was balanced.
|
|
36
|
+
*/
|
|
37
|
+
declare function equationParts(accounts: ReadonlyArray<Account>, balanceOf: (id: string) => number): {
|
|
38
|
+
assets: number;
|
|
39
|
+
liabilities: number;
|
|
40
|
+
equity: number;
|
|
41
|
+
profit: number;
|
|
42
|
+
};
|
|
43
|
+
/** Category → CSS token colour, consistent across every accounting lab. */
|
|
44
|
+
declare const CATEGORY_COLOR: Record<AccountCategory, string>;
|
|
45
|
+
/** Compact money label (e.g. 10000 → "10,000"). */
|
|
46
|
+
declare function money(n: number): string;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { Account, AccountCategory, CATEGORY_COLOR, Side, debitsEqualCredits, equationParts, money, normalBalance, statementOf };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//#region src/commerce/accounting/core.ts
|
|
2
|
+
/** Assets & Expenses grow on the LEFT (debit); the rest grow on the RIGHT (credit). */
|
|
3
|
+
function normalBalance(category) {
|
|
4
|
+
return category === "Asset" || category === "Expense" ? "debit" : "credit";
|
|
5
|
+
}
|
|
6
|
+
/** Which financial statement an account lands on. */
|
|
7
|
+
function statementOf(category) {
|
|
8
|
+
return category === "Income" || category === "Expense" ? "Income Statement" : "Balance Sheet";
|
|
9
|
+
}
|
|
10
|
+
/** A balanced entry has equal total debits and credits (within a cent). */
|
|
11
|
+
function debitsEqualCredits(lines) {
|
|
12
|
+
let d = 0, c = 0;
|
|
13
|
+
for (const l of lines) {
|
|
14
|
+
d += l.debit ?? 0;
|
|
15
|
+
c += l.credit ?? 0;
|
|
16
|
+
}
|
|
17
|
+
return Math.abs(d - c) < .005;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Sum signed account balances (natural terms: + = increase on the normal side)
|
|
21
|
+
* into the accounting-equation parts. Equity absorbs profit = Income − Expense,
|
|
22
|
+
* so `assets` should equal `liabilities + equity` whenever every posted entry
|
|
23
|
+
* was balanced.
|
|
24
|
+
*/
|
|
25
|
+
function equationParts(accounts, balanceOf) {
|
|
26
|
+
let assets = 0, liabilities = 0, equityBase = 0, income = 0, expense = 0;
|
|
27
|
+
for (const a of accounts) {
|
|
28
|
+
const v = balanceOf(a.id);
|
|
29
|
+
if (a.category === "Asset") assets += v;
|
|
30
|
+
else if (a.category === "Liability") liabilities += v;
|
|
31
|
+
else if (a.category === "Equity") equityBase += v;
|
|
32
|
+
else if (a.category === "Income") income += v;
|
|
33
|
+
else expense += v;
|
|
34
|
+
}
|
|
35
|
+
const profit = income - expense;
|
|
36
|
+
return {
|
|
37
|
+
assets,
|
|
38
|
+
liabilities,
|
|
39
|
+
equity: equityBase + profit,
|
|
40
|
+
profit
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/** Category → CSS token colour, consistent across every accounting lab. */
|
|
44
|
+
const CATEGORY_COLOR = {
|
|
45
|
+
Asset: "var(--stage-good)",
|
|
46
|
+
Liability: "var(--stage-danger)",
|
|
47
|
+
Equity: "var(--stage-accent)",
|
|
48
|
+
Income: "var(--stage-accent-2)",
|
|
49
|
+
Expense: "var(--stage-warn)"
|
|
50
|
+
};
|
|
51
|
+
/** Compact money label (e.g. 10000 → "10,000"). */
|
|
52
|
+
function money(n) {
|
|
53
|
+
return Math.round(n).toLocaleString("en-US");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { CATEGORY_COLOR, debitsEqualCredits, equationParts, money, normalBalance, statementOf };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Account } from "./core.mjs";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/commerce/accounting/equation-balance.d.ts
|
|
5
|
+
interface TxnEffect {
|
|
6
|
+
account: string;
|
|
7
|
+
delta: number;
|
|
8
|
+
}
|
|
9
|
+
interface Transaction {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
effects: TxnEffect[];
|
|
13
|
+
}
|
|
14
|
+
interface EquationBalanceProps {
|
|
15
|
+
accounts?: Account[];
|
|
16
|
+
transactions?: Transaction[];
|
|
17
|
+
freePost?: boolean;
|
|
18
|
+
start?: number;
|
|
19
|
+
title?: string;
|
|
20
|
+
prompt?: string;
|
|
21
|
+
height?: number;
|
|
22
|
+
objectives?: string[];
|
|
23
|
+
}
|
|
24
|
+
declare function EquationBalanceLab({
|
|
25
|
+
accounts,
|
|
26
|
+
transactions,
|
|
27
|
+
freePost,
|
|
28
|
+
start,
|
|
29
|
+
title,
|
|
30
|
+
prompt,
|
|
31
|
+
height,
|
|
32
|
+
objectives
|
|
33
|
+
}: EquationBalanceProps): ReactNode;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { EquationBalanceLab, EquationBalanceProps, Transaction, TxnEffect };
|