@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,324 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { clamp } from "../../core/util.mjs";
|
|
4
|
+
import { Chip, StatusPill } from "../../kit/controls.mjs";
|
|
5
|
+
import { ControlBar, Field, LabFrame, LiveRegion } from "../../kit/frame.mjs";
|
|
6
|
+
import { useCheckpoint } from "../../kit/pedagogy.mjs";
|
|
7
|
+
import { demandQ, equilibrium } from "./core.mjs";
|
|
8
|
+
import { useState } from "react";
|
|
9
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { Axes, Dot, Label, MovableDot, Segment, Stage } from "@classytic/stage";
|
|
11
|
+
|
|
12
|
+
//#region src/commerce/economics/demand-shift-vs-move.tsx
|
|
13
|
+
/**
|
|
14
|
+
* DemandShiftVsMoveLab — shift the curve vs move along it.
|
|
15
|
+
*
|
|
16
|
+
* The #1 micro misconception. Dragging the PRICE slider slides a dot ALONG a
|
|
17
|
+
* fixed demand curve — a change in QUANTITY demanded (the curve never moves).
|
|
18
|
+
* Clicking a non-price TRIBE factor (Tastes, Related-good prices, Income, Buyers,
|
|
19
|
+
* Expectations) translates the WHOLE curve — a change in DEMAND — and the
|
|
20
|
+
* equilibrium moves along supply to a new P* and Q*. A predict-then-check asks
|
|
21
|
+
* for the P/Q direction before the reveal. The decision rule: only the good's OWN
|
|
22
|
+
* price (the axis variable) moves you along; anything else shifts the curve.
|
|
23
|
+
*
|
|
24
|
+
* Reuses the shared econ core (equilibrium / demandQ). Tokenized; reduced-motion safe.
|
|
25
|
+
*/
|
|
26
|
+
const DEMAND0 = {
|
|
27
|
+
intercept: 9,
|
|
28
|
+
slope: .8
|
|
29
|
+
};
|
|
30
|
+
const SUPPLY0 = {
|
|
31
|
+
intercept: 1,
|
|
32
|
+
slope: .7
|
|
33
|
+
};
|
|
34
|
+
const SHIFTERS = [
|
|
35
|
+
{
|
|
36
|
+
label: "Incomes rise",
|
|
37
|
+
target: "demand",
|
|
38
|
+
delta: 2
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: "Substitute gets cheaper",
|
|
42
|
+
target: "demand",
|
|
43
|
+
delta: -2
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: "Tastes favour it",
|
|
47
|
+
target: "demand",
|
|
48
|
+
delta: 1.5
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: "More buyers",
|
|
52
|
+
target: "demand",
|
|
53
|
+
delta: 1
|
|
54
|
+
}
|
|
55
|
+
];
|
|
56
|
+
function DemandShiftVsMoveLab({ demand = DEMAND0, supply = SUPPLY0, shifters = SHIFTERS, askPrediction = true, priceMax = 11, qtyMax = 13, title = "Shift the curve, or move along it?", prompt = "Drag PRICE → move along (Δ quantity demanded). Click a TRIBE factor → the whole curve SHIFTS (Δ demand).", height = 320, objectives }) {
|
|
57
|
+
const [dShift, setDShift] = useState(0);
|
|
58
|
+
const [sShift, setSShift] = useState(0);
|
|
59
|
+
const [movePrice, setMovePrice] = useState(6);
|
|
60
|
+
const [last, setLast] = useState(null);
|
|
61
|
+
const [ghost, setGhost] = useState(null);
|
|
62
|
+
const [pending, setPending] = useState(null);
|
|
63
|
+
const [verdict, setVerdict] = useState(null);
|
|
64
|
+
const [solved, setSolved] = useState(false);
|
|
65
|
+
useCheckpoint({
|
|
66
|
+
solved,
|
|
67
|
+
activity: "demand-shift-vs-move"
|
|
68
|
+
});
|
|
69
|
+
const d = {
|
|
70
|
+
intercept: demand.intercept + dShift,
|
|
71
|
+
slope: demand.slope
|
|
72
|
+
};
|
|
73
|
+
const s = {
|
|
74
|
+
intercept: supply.intercept + sShift,
|
|
75
|
+
slope: supply.slope
|
|
76
|
+
};
|
|
77
|
+
const eq = equilibrium(d, s);
|
|
78
|
+
const moveQ = clamp(demandQ(d, movePrice), 0, qtyMax);
|
|
79
|
+
const apply = (sh) => {
|
|
80
|
+
const prevD = { ...d };
|
|
81
|
+
if (sh.target === "demand") setDShift((v) => v + sh.delta);
|
|
82
|
+
else setSShift((v) => v + sh.delta);
|
|
83
|
+
setGhost(sh.target === "demand" ? prevD : null);
|
|
84
|
+
setLast("shift");
|
|
85
|
+
};
|
|
86
|
+
const dirOf = (sh) => {
|
|
87
|
+
if (sh.target === "demand") return sh.delta > 0 ? "up" : "down";
|
|
88
|
+
return "indeterminate";
|
|
89
|
+
};
|
|
90
|
+
const clickShifter = (sh) => {
|
|
91
|
+
setVerdict(null);
|
|
92
|
+
if (askPrediction) setPending(sh);
|
|
93
|
+
else apply(sh);
|
|
94
|
+
};
|
|
95
|
+
const predict = (guess) => {
|
|
96
|
+
if (!pending) return;
|
|
97
|
+
const truth = dirOf(pending);
|
|
98
|
+
const ok = guess === truth;
|
|
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
|
+
apply(pending);
|
|
101
|
+
setPending(null);
|
|
102
|
+
if (ok) setSolved(true);
|
|
103
|
+
};
|
|
104
|
+
const view = {
|
|
105
|
+
xMin: -.9,
|
|
106
|
+
xMax: qtyMax + .4,
|
|
107
|
+
yMin: -.9,
|
|
108
|
+
yMax: priceMax + .4
|
|
109
|
+
};
|
|
110
|
+
const lineEnds = (c, down) => down ? [{
|
|
111
|
+
x: 0,
|
|
112
|
+
y: c.intercept
|
|
113
|
+
}, {
|
|
114
|
+
x: c.intercept / c.slope,
|
|
115
|
+
y: 0
|
|
116
|
+
}] : [{
|
|
117
|
+
x: 0,
|
|
118
|
+
y: c.intercept
|
|
119
|
+
}, {
|
|
120
|
+
x: qtyMax,
|
|
121
|
+
y: c.intercept + c.slope * qtyMax
|
|
122
|
+
}];
|
|
123
|
+
const [d0, d1] = lineEnds(d, true);
|
|
124
|
+
const [s0, s1] = lineEnds(s, false);
|
|
125
|
+
const figure = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
126
|
+
style: {
|
|
127
|
+
borderRadius: 14,
|
|
128
|
+
overflow: "hidden",
|
|
129
|
+
background: "var(--stage-bg)",
|
|
130
|
+
border: "1px solid var(--stage-grid)"
|
|
131
|
+
},
|
|
132
|
+
children: /* @__PURE__ */ jsxs(Stage, {
|
|
133
|
+
view,
|
|
134
|
+
height,
|
|
135
|
+
preserveAspect: false,
|
|
136
|
+
ariaLabel: `Supply and demand; equilibrium price ${eq.p.toFixed(1)}, quantity ${eq.q.toFixed(1)}`,
|
|
137
|
+
children: [
|
|
138
|
+
/* @__PURE__ */ jsx(Axes, { ticks: false }),
|
|
139
|
+
/* @__PURE__ */ jsx(Label, {
|
|
140
|
+
x: qtyMax / 2,
|
|
141
|
+
y: -.6,
|
|
142
|
+
text: "Quantity →",
|
|
143
|
+
color: "var(--stage-muted)",
|
|
144
|
+
size: 11
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ jsx(Label, {
|
|
147
|
+
x: -.6,
|
|
148
|
+
y: priceMax / 2,
|
|
149
|
+
text: "Price",
|
|
150
|
+
color: "var(--stage-muted)",
|
|
151
|
+
size: 11
|
|
152
|
+
}),
|
|
153
|
+
ghost && /* @__PURE__ */ jsx(Segment, {
|
|
154
|
+
from: lineEnds(ghost, true)[0],
|
|
155
|
+
to: lineEnds(ghost, true)[1],
|
|
156
|
+
color: "var(--stage-accent)",
|
|
157
|
+
weight: 1.5,
|
|
158
|
+
dashed: true,
|
|
159
|
+
opacity: .4
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ jsx(Segment, {
|
|
162
|
+
from: d0,
|
|
163
|
+
to: d1,
|
|
164
|
+
color: "var(--stage-accent)",
|
|
165
|
+
weight: 2.5
|
|
166
|
+
}),
|
|
167
|
+
/* @__PURE__ */ jsx(Label, {
|
|
168
|
+
x: d1.x * .5,
|
|
169
|
+
y: d0.y * .5,
|
|
170
|
+
text: "Demand",
|
|
171
|
+
color: "var(--stage-accent)",
|
|
172
|
+
size: 11,
|
|
173
|
+
dx: 14
|
|
174
|
+
}),
|
|
175
|
+
/* @__PURE__ */ jsx(Segment, {
|
|
176
|
+
from: s0,
|
|
177
|
+
to: s1,
|
|
178
|
+
color: "var(--stage-accent-2)",
|
|
179
|
+
weight: 2.5
|
|
180
|
+
}),
|
|
181
|
+
/* @__PURE__ */ jsx(Label, {
|
|
182
|
+
x: qtyMax * .7,
|
|
183
|
+
y: s.intercept + s.slope * qtyMax * .7,
|
|
184
|
+
text: "Supply",
|
|
185
|
+
color: "var(--stage-accent-2)",
|
|
186
|
+
size: 11,
|
|
187
|
+
dy: -12
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ jsx(Dot, {
|
|
190
|
+
x: eq.q,
|
|
191
|
+
y: eq.p,
|
|
192
|
+
r: 6,
|
|
193
|
+
color: "var(--stage-good)"
|
|
194
|
+
}),
|
|
195
|
+
/* @__PURE__ */ jsx(Label, {
|
|
196
|
+
x: eq.q,
|
|
197
|
+
y: eq.p,
|
|
198
|
+
text: `P* ${eq.p.toFixed(1)}, Q* ${eq.q.toFixed(1)}`,
|
|
199
|
+
color: "var(--stage-good)",
|
|
200
|
+
size: 11,
|
|
201
|
+
dx: 10,
|
|
202
|
+
dy: -10
|
|
203
|
+
}),
|
|
204
|
+
/* @__PURE__ */ jsx(Segment, {
|
|
205
|
+
from: {
|
|
206
|
+
x: 0,
|
|
207
|
+
y: movePrice
|
|
208
|
+
},
|
|
209
|
+
to: {
|
|
210
|
+
x: moveQ,
|
|
211
|
+
y: movePrice
|
|
212
|
+
},
|
|
213
|
+
color: "var(--stage-fg)",
|
|
214
|
+
weight: 1,
|
|
215
|
+
dashed: true,
|
|
216
|
+
opacity: .4
|
|
217
|
+
}),
|
|
218
|
+
/* @__PURE__ */ jsx(MovableDot, {
|
|
219
|
+
value: {
|
|
220
|
+
x: .35,
|
|
221
|
+
y: movePrice
|
|
222
|
+
},
|
|
223
|
+
onMove: (p) => {
|
|
224
|
+
setMovePrice(clamp(p.y, .4, priceMax - .4));
|
|
225
|
+
setLast("move");
|
|
226
|
+
},
|
|
227
|
+
constrain: "vertical",
|
|
228
|
+
range: {
|
|
229
|
+
min: .4,
|
|
230
|
+
max: priceMax - .4
|
|
231
|
+
},
|
|
232
|
+
color: "var(--stage-fg)",
|
|
233
|
+
ariaLabel: "own price (moves along the demand curve)"
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ jsx(Dot, {
|
|
236
|
+
x: moveQ,
|
|
237
|
+
y: movePrice,
|
|
238
|
+
r: 5,
|
|
239
|
+
color: "var(--stage-fg)"
|
|
240
|
+
})
|
|
241
|
+
]
|
|
242
|
+
})
|
|
243
|
+
}), /* @__PURE__ */ jsx(LiveRegion, { children: verdict ?? (last === "move" ? "Movement along the demand curve: a change in quantity demanded." : last === "shift" ? `Demand shifted; new equilibrium price ${eq.p.toFixed(1)}, quantity ${eq.q.toFixed(1)}.` : "Drag the price or pick a factor.") })] });
|
|
244
|
+
return /* @__PURE__ */ jsx(LabFrame, {
|
|
245
|
+
title,
|
|
246
|
+
prompt,
|
|
247
|
+
objectives,
|
|
248
|
+
controls: /* @__PURE__ */ jsx(ControlBar, { children: pending ? /* @__PURE__ */ jsx(Field, {
|
|
249
|
+
label: `“${pending.label}” → P* and Q* will go`,
|
|
250
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
251
|
+
style: {
|
|
252
|
+
display: "flex",
|
|
253
|
+
flexWrap: "wrap",
|
|
254
|
+
gap: 8
|
|
255
|
+
},
|
|
256
|
+
children: [
|
|
257
|
+
/* @__PURE__ */ jsx(Chip, {
|
|
258
|
+
selected: false,
|
|
259
|
+
onClick: () => predict("up"),
|
|
260
|
+
children: "both UP"
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ jsx(Chip, {
|
|
263
|
+
selected: false,
|
|
264
|
+
onClick: () => predict("down"),
|
|
265
|
+
children: "both DOWN"
|
|
266
|
+
}),
|
|
267
|
+
/* @__PURE__ */ jsx(Chip, {
|
|
268
|
+
selected: false,
|
|
269
|
+
onClick: () => predict("indeterminate"),
|
|
270
|
+
children: "indeterminate"
|
|
271
|
+
})
|
|
272
|
+
]
|
|
273
|
+
})
|
|
274
|
+
}) : /* @__PURE__ */ jsx(Field, {
|
|
275
|
+
label: "TRIBE factor",
|
|
276
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
277
|
+
style: {
|
|
278
|
+
display: "flex",
|
|
279
|
+
flexWrap: "wrap",
|
|
280
|
+
gap: 8
|
|
281
|
+
},
|
|
282
|
+
children: [shifters.map((sh) => /* @__PURE__ */ jsx(Chip, {
|
|
283
|
+
selected: false,
|
|
284
|
+
onClick: () => clickShifter(sh),
|
|
285
|
+
children: sh.label
|
|
286
|
+
}, sh.label)), /* @__PURE__ */ jsx("button", {
|
|
287
|
+
type: "button",
|
|
288
|
+
className: "lab-chip",
|
|
289
|
+
onClick: () => {
|
|
290
|
+
setDShift(0);
|
|
291
|
+
setSShift(0);
|
|
292
|
+
setGhost(null);
|
|
293
|
+
setLast(null);
|
|
294
|
+
setVerdict(null);
|
|
295
|
+
setSolved(false);
|
|
296
|
+
},
|
|
297
|
+
children: "reset"
|
|
298
|
+
})]
|
|
299
|
+
})
|
|
300
|
+
}) }),
|
|
301
|
+
footer: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
302
|
+
last === "move" && /* @__PURE__ */ jsx(StatusPill, {
|
|
303
|
+
ok: false,
|
|
304
|
+
children: "MOVEMENT along the curve — Δ quantity demanded (own price changed)"
|
|
305
|
+
}),
|
|
306
|
+
last === "shift" && /* @__PURE__ */ jsx(StatusPill, {
|
|
307
|
+
ok: true,
|
|
308
|
+
children: "SHIFT of the whole curve — Δ demand (a TRIBE factor)"
|
|
309
|
+
}),
|
|
310
|
+
!last && /* @__PURE__ */ jsx("p", {
|
|
311
|
+
className: "lab-prompt",
|
|
312
|
+
children: "Drag the price, or click a factor."
|
|
313
|
+
}),
|
|
314
|
+
verdict && /* @__PURE__ */ jsx(StatusPill, {
|
|
315
|
+
ok: verdict.startsWith("✓"),
|
|
316
|
+
children: verdict
|
|
317
|
+
})
|
|
318
|
+
] }),
|
|
319
|
+
children: figure
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
//#endregion
|
|
324
|
+
export { DemandShiftVsMoveLab };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/commerce/economics/elasticity-revenue.d.ts
|
|
4
|
+
interface ElasticityRevenueProps {
|
|
5
|
+
pivot?: {
|
|
6
|
+
p: number;
|
|
7
|
+
q: number;
|
|
8
|
+
};
|
|
9
|
+
priceMax?: number;
|
|
10
|
+
qtyMax?: number;
|
|
11
|
+
anchorPresets?: Array<{
|
|
12
|
+
label: string;
|
|
13
|
+
slope: number;
|
|
14
|
+
}>;
|
|
15
|
+
title?: string;
|
|
16
|
+
prompt?: string;
|
|
17
|
+
height?: number;
|
|
18
|
+
objectives?: string[];
|
|
19
|
+
}
|
|
20
|
+
declare function ElasticityRevenueLab({
|
|
21
|
+
pivot,
|
|
22
|
+
priceMax,
|
|
23
|
+
qtyMax,
|
|
24
|
+
anchorPresets,
|
|
25
|
+
title,
|
|
26
|
+
prompt,
|
|
27
|
+
height,
|
|
28
|
+
objectives
|
|
29
|
+
}: ElasticityRevenueProps): ReactNode;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { ElasticityRevenueLab, ElasticityRevenueProps };
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { clamp } from "../../core/util.mjs";
|
|
4
|
+
import { Chip, Slider, StatusPill } from "../../kit/controls.mjs";
|
|
5
|
+
import { ControlBar, Field, LabFrame, LiveRegion } from "../../kit/frame.mjs";
|
|
6
|
+
import { demandQ, pointElasticity } from "./core.mjs";
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Axes, Dot, Label, MovableDot, Polygon, Segment, Stage } from "@classytic/stage";
|
|
10
|
+
|
|
11
|
+
//#region src/commerce/economics/elasticity-revenue.tsx
|
|
12
|
+
/**
|
|
13
|
+
* ElasticityRevenueLab — the stretch test: elasticity is NOT slope.
|
|
14
|
+
*
|
|
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
|
+
* 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 — the revenue
|
|
19
|
+
* see-saw. The point-elasticity pill flips ELASTIC → UNIT → INELASTIC down a
|
|
20
|
+
* SINGLE straight line, killing the "slope = elasticity" error.
|
|
21
|
+
*
|
|
22
|
+
* Reuses the shared econ core (pointElasticity / demandQ). Tokenized; reduced-motion safe.
|
|
23
|
+
*/
|
|
24
|
+
const PRESETS = [
|
|
25
|
+
{
|
|
26
|
+
label: "💉 insulin (few substitutes)",
|
|
27
|
+
slope: 2.2
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: "🛒 typical good",
|
|
31
|
+
slope: .8
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: "💧 one water brand (many substitutes)",
|
|
35
|
+
slope: .28
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
function ElasticityRevenueLab({ pivot = {
|
|
39
|
+
p: 5,
|
|
40
|
+
q: 5
|
|
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
|
+
const [b, setB] = useState(.8);
|
|
43
|
+
const curve = {
|
|
44
|
+
intercept: pivot.p + b * pivot.q,
|
|
45
|
+
slope: b
|
|
46
|
+
};
|
|
47
|
+
const [price, setPrice] = useState(pivot.p + 1.5);
|
|
48
|
+
const q = clamp(demandQ(curve, price), 0, qtyMax);
|
|
49
|
+
const revenue = price * q;
|
|
50
|
+
const E = pointElasticity(curve, price);
|
|
51
|
+
const kind = Math.abs(E - 1) < .06 ? "unit" : E > 1 ? "elastic" : "inelastic";
|
|
52
|
+
const kindColor = kind === "elastic" ? "var(--stage-good)" : kind === "unit" ? "var(--stage-warn)" : "var(--stage-danger)";
|
|
53
|
+
const view = {
|
|
54
|
+
xMin: -.9,
|
|
55
|
+
xMax: qtyMax + .4,
|
|
56
|
+
yMin: -.9,
|
|
57
|
+
yMax: priceMax + .4
|
|
58
|
+
};
|
|
59
|
+
const qAtP0 = clamp(curve.intercept / b, 0, qtyMax * 1.3);
|
|
60
|
+
const pAtQ0 = clamp(curve.intercept, 0, priceMax * 1.3);
|
|
61
|
+
const figure = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
62
|
+
style: {
|
|
63
|
+
borderRadius: 14,
|
|
64
|
+
overflow: "hidden",
|
|
65
|
+
background: "var(--stage-bg)",
|
|
66
|
+
border: "1px solid var(--stage-grid)"
|
|
67
|
+
},
|
|
68
|
+
children: /* @__PURE__ */ jsxs(Stage, {
|
|
69
|
+
view,
|
|
70
|
+
height,
|
|
71
|
+
preserveAspect: false,
|
|
72
|
+
ariaLabel: `Demand elasticity ${E.toFixed(2)} (${kind}); revenue ${revenue.toFixed(1)}`,
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ jsx(Axes, { ticks: false }),
|
|
75
|
+
/* @__PURE__ */ jsx(Label, {
|
|
76
|
+
x: qtyMax / 2,
|
|
77
|
+
y: -.6,
|
|
78
|
+
text: "Quantity →",
|
|
79
|
+
color: "var(--stage-muted)",
|
|
80
|
+
size: 11
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ jsx(Label, {
|
|
83
|
+
x: -.6,
|
|
84
|
+
y: priceMax / 2,
|
|
85
|
+
text: "Price",
|
|
86
|
+
color: "var(--stage-muted)",
|
|
87
|
+
size: 11
|
|
88
|
+
}),
|
|
89
|
+
/* @__PURE__ */ jsx(Polygon, {
|
|
90
|
+
points: [
|
|
91
|
+
{
|
|
92
|
+
x: 0,
|
|
93
|
+
y: 0
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
x: q,
|
|
97
|
+
y: 0
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
x: q,
|
|
101
|
+
y: price
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
x: 0,
|
|
105
|
+
y: price
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
color: kindColor,
|
|
109
|
+
fill: kindColor,
|
|
110
|
+
fillOpacity: .16,
|
|
111
|
+
weight: 0
|
|
112
|
+
}),
|
|
113
|
+
/* @__PURE__ */ jsx(Label, {
|
|
114
|
+
x: q / 2,
|
|
115
|
+
y: price / 2,
|
|
116
|
+
text: `revenue ${revenue.toFixed(1)}`,
|
|
117
|
+
color: kindColor,
|
|
118
|
+
size: 11
|
|
119
|
+
}),
|
|
120
|
+
/* @__PURE__ */ jsx(Segment, {
|
|
121
|
+
from: {
|
|
122
|
+
x: 0,
|
|
123
|
+
y: pAtQ0
|
|
124
|
+
},
|
|
125
|
+
to: {
|
|
126
|
+
x: qAtP0,
|
|
127
|
+
y: pAtQ0 > 0 ? 0 : pAtQ0
|
|
128
|
+
},
|
|
129
|
+
color: "var(--stage-accent)",
|
|
130
|
+
weight: 2.5
|
|
131
|
+
}),
|
|
132
|
+
/* @__PURE__ */ jsx(Dot, {
|
|
133
|
+
x: pivot.q,
|
|
134
|
+
y: pivot.p,
|
|
135
|
+
r: 4,
|
|
136
|
+
color: "var(--stage-muted)"
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ jsx(Segment, {
|
|
139
|
+
from: {
|
|
140
|
+
x: 0,
|
|
141
|
+
y: price
|
|
142
|
+
},
|
|
143
|
+
to: {
|
|
144
|
+
x: q,
|
|
145
|
+
y: price
|
|
146
|
+
},
|
|
147
|
+
color: "var(--stage-fg)",
|
|
148
|
+
weight: 1,
|
|
149
|
+
dashed: true,
|
|
150
|
+
opacity: .45
|
|
151
|
+
}),
|
|
152
|
+
/* @__PURE__ */ jsx(Segment, {
|
|
153
|
+
from: {
|
|
154
|
+
x: q,
|
|
155
|
+
y: 0
|
|
156
|
+
},
|
|
157
|
+
to: {
|
|
158
|
+
x: q,
|
|
159
|
+
y: price
|
|
160
|
+
},
|
|
161
|
+
color: "var(--stage-fg)",
|
|
162
|
+
weight: 1,
|
|
163
|
+
dashed: true,
|
|
164
|
+
opacity: .45
|
|
165
|
+
}),
|
|
166
|
+
/* @__PURE__ */ jsx(MovableDot, {
|
|
167
|
+
value: {
|
|
168
|
+
x: .35,
|
|
169
|
+
y: price
|
|
170
|
+
},
|
|
171
|
+
onMove: (pt) => setPrice(clamp(pt.y, .4, priceMax - .4)),
|
|
172
|
+
constrain: "vertical",
|
|
173
|
+
range: {
|
|
174
|
+
min: .4,
|
|
175
|
+
max: priceMax - .4
|
|
176
|
+
},
|
|
177
|
+
color: "var(--stage-fg)",
|
|
178
|
+
ariaLabel: "price"
|
|
179
|
+
}),
|
|
180
|
+
/* @__PURE__ */ jsx(Dot, {
|
|
181
|
+
x: q,
|
|
182
|
+
y: price,
|
|
183
|
+
r: 5,
|
|
184
|
+
color: "var(--stage-accent)"
|
|
185
|
+
})
|
|
186
|
+
]
|
|
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)} — ${kind}.` })] });
|
|
189
|
+
return /* @__PURE__ */ jsx(LabFrame, {
|
|
190
|
+
title,
|
|
191
|
+
prompt,
|
|
192
|
+
objectives,
|
|
193
|
+
controls: /* @__PURE__ */ jsxs(ControlBar, { children: [
|
|
194
|
+
/* @__PURE__ */ jsx(Field, {
|
|
195
|
+
label: "steep ↔ flat",
|
|
196
|
+
children: /* @__PURE__ */ jsx(Slider, {
|
|
197
|
+
value: b,
|
|
198
|
+
min: .2,
|
|
199
|
+
max: 2.4,
|
|
200
|
+
step: .05,
|
|
201
|
+
onChange: setB,
|
|
202
|
+
ariaLabel: "rotate the demand curve (substitutes)"
|
|
203
|
+
})
|
|
204
|
+
}),
|
|
205
|
+
/* @__PURE__ */ jsx(Field, {
|
|
206
|
+
label: "substitutes",
|
|
207
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
208
|
+
style: {
|
|
209
|
+
display: "flex",
|
|
210
|
+
flexWrap: "wrap",
|
|
211
|
+
gap: 8
|
|
212
|
+
},
|
|
213
|
+
children: anchorPresets.map((a) => /* @__PURE__ */ jsx(Chip, {
|
|
214
|
+
selected: Math.abs(b - a.slope) < .03,
|
|
215
|
+
onClick: () => setB(a.slope),
|
|
216
|
+
children: a.label
|
|
217
|
+
}, a.label))
|
|
218
|
+
})
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ jsx(Field, {
|
|
221
|
+
label: "price",
|
|
222
|
+
value: price.toFixed(1),
|
|
223
|
+
children: /* @__PURE__ */ jsx("span", {})
|
|
224
|
+
}),
|
|
225
|
+
/* @__PURE__ */ jsx(Field, {
|
|
226
|
+
label: "Q",
|
|
227
|
+
value: /* @__PURE__ */ jsx("span", {
|
|
228
|
+
style: { color: "var(--stage-accent)" },
|
|
229
|
+
children: q.toFixed(1)
|
|
230
|
+
}),
|
|
231
|
+
children: /* @__PURE__ */ jsx("span", {})
|
|
232
|
+
}),
|
|
233
|
+
/* @__PURE__ */ jsx(Field, {
|
|
234
|
+
label: "revenue",
|
|
235
|
+
value: revenue.toFixed(1),
|
|
236
|
+
children: /* @__PURE__ */ jsx("span", {})
|
|
237
|
+
})
|
|
238
|
+
] }),
|
|
239
|
+
footer: /* @__PURE__ */ jsxs(StatusPill, {
|
|
240
|
+
ok: kind === "elastic",
|
|
241
|
+
children: [
|
|
242
|
+
"|E| ",
|
|
243
|
+
E === Infinity ? "∞" : E.toFixed(2),
|
|
244
|
+
" · ",
|
|
245
|
+
kind.toUpperCase()
|
|
246
|
+
]
|
|
247
|
+
}),
|
|
248
|
+
children: figure
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
//#endregion
|
|
253
|
+
export { ElasticityRevenueLab };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Curve, demandP, demandQ, equilibrium, pointElasticity, supplyP, supplyQ } from "./core.mjs";
|
|
2
|
+
import { MarketEquilibriumLab, MarketEquilibriumProps } from "./market-equilibrium.mjs";
|
|
3
|
+
import { ElasticityRevenueLab, ElasticityRevenueProps } from "./elasticity-revenue.mjs";
|
|
4
|
+
import { DemandShiftVsMoveLab, DemandShiftVsMoveProps, Shifter } from "./demand-shift-vs-move.mjs";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Curve } from "./core.mjs";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/commerce/economics/market-equilibrium.d.ts
|
|
5
|
+
interface MarketEquilibriumProps {
|
|
6
|
+
demand?: Curve;
|
|
7
|
+
supply?: Curve;
|
|
8
|
+
shiftControls?: {
|
|
9
|
+
demand?: boolean;
|
|
10
|
+
supply?: boolean;
|
|
11
|
+
};
|
|
12
|
+
priceMax?: number;
|
|
13
|
+
qtyMax?: number;
|
|
14
|
+
goodLabel?: string;
|
|
15
|
+
title?: string;
|
|
16
|
+
prompt?: string;
|
|
17
|
+
height?: number;
|
|
18
|
+
objectives?: string[];
|
|
19
|
+
}
|
|
20
|
+
declare function MarketEquilibriumLab({
|
|
21
|
+
demand,
|
|
22
|
+
supply,
|
|
23
|
+
shiftControls,
|
|
24
|
+
priceMax,
|
|
25
|
+
qtyMax,
|
|
26
|
+
goodLabel,
|
|
27
|
+
title,
|
|
28
|
+
prompt,
|
|
29
|
+
height,
|
|
30
|
+
objectives
|
|
31
|
+
}: MarketEquilibriumProps): ReactNode;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { MarketEquilibriumLab, MarketEquilibriumProps };
|