@almadar/std 16.173.0 → 16.174.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/behaviors/lolo/infra/atoms/std-cross-reference.lolo +2 -4
  2. package/behaviors/lolo/ui/core/atoms/std-board.lolo +5 -9
  3. package/behaviors/lolo/ui/core/atoms/std-browse.lolo +8 -1
  4. package/behaviors/lolo/ui/core/atoms/std-esign-flow.lolo +2 -2
  5. package/behaviors/lolo/ui/core/atoms/std-event-log.lolo +3 -7
  6. package/behaviors/lolo/ui/core/atoms/std-form-advanced.lolo +1 -1
  7. package/behaviors/lolo/ui/core/atoms/std-image-upload-multi.lolo +1 -1
  8. package/behaviors/lolo/ui/core/atoms/std-list.lolo +3 -3
  9. package/behaviors/lolo/ui/core/atoms/std-modal.lolo +2 -2
  10. package/behaviors/lolo/ui/core/atoms/std-multi-party-flow.lolo +2 -4
  11. package/behaviors/lolo/ui/core/atoms/std-rating-review.lolo +5 -13
  12. package/behaviors/lolo/ui/core/atoms/std-recurrence.lolo +3 -7
  13. package/behaviors/lolo/ui/core/atoms/std-saved-search.lolo +1 -1
  14. package/behaviors/lolo/ui/core/atoms/std-signature-capture.lolo +2 -2
  15. package/behaviors/lolo/ui/core/atoms/std-step-flow.lolo +2 -4
  16. package/behaviors/lolo/ui/core/atoms/std-tag-taxonomy.lolo +1 -1
  17. package/behaviors/lolo/ui/core/atoms/std-thread.lolo +2 -2
  18. package/behaviors/lolo/ui/core/atoms/std-vote.lolo +2 -2
  19. package/behaviors/lolo/ui/core/atoms/std-wizard.lolo +3 -7
  20. package/behaviors/lolo/ui/core/atoms/ui-atlas-image.lolo +1 -1
  21. package/behaviors/lolo/ui/core/atoms/ui-atlas-panel.lolo +1 -1
  22. package/behaviors/lolo/ui/core/atoms/ui-center.lolo +1 -1
  23. package/behaviors/lolo/ui/core/atoms/ui-hstack.lolo +1 -1
  24. package/behaviors/lolo/ui/core/atoms/ui-icon.lolo +1 -1
  25. package/behaviors/lolo/ui/core/atoms/ui-stack.lolo +1 -1
  26. package/behaviors/lolo/ui/core/atoms/ui-typography.lolo +1 -1
  27. package/behaviors/lolo/ui/core/atoms/ui-vstack.lolo +1 -1
  28. package/behaviors/lolo/ui/core/molecules/ui-content-renderer.lolo +1 -1
  29. package/behaviors/lolo/ui/core/molecules/ui-form-layout.lolo +1 -1
  30. package/behaviors/lolo/ui/core/molecules/ui-grid.lolo +1 -1
  31. package/behaviors/lolo/ui/core/organisms/ui-chat-bar.lolo +1 -1
  32. package/behaviors/lolo/ui/core/organisms/ui-dashboard-grid.lolo +1 -1
  33. package/behaviors/lolo/ui/core/organisms/ui-detail-panel.lolo +1 -1
  34. package/behaviors/lolo/ui/core/organisms/ui-entity-cards.lolo +1 -1
  35. package/behaviors/lolo/ui/core/organisms/ui-entity-list.lolo +1 -1
  36. package/behaviors/lolo/ui/core/organisms/ui-entity-table.lolo +1 -1
  37. package/behaviors/lolo/ui/core/organisms/ui-form-section.lolo +9 -3
  38. package/behaviors/lolo/ui/core/organisms/ui-form.lolo +9 -3
  39. package/behaviors/lolo/ui/core/organisms/ui-master-detail.lolo +1 -1
  40. package/behaviors/lolo/ui/core/organisms/ui-media-gallery.lolo +1 -1
  41. package/behaviors/lolo/ui/core/organisms/ui-segment-renderer.lolo +7 -1
  42. package/behaviors/lolo/ui/core/organisms/ui-stat-card.lolo +1 -1
  43. package/behaviors/lolo/ui/core/organisms/ui-subagent-trace-panel.lolo +1 -1
  44. package/behaviors/lolo/ui/game/atoms/ui-action-tile.lolo +1 -1
  45. package/behaviors/lolo/ui/game/atoms/ui-draw-shape-layer.lolo +41 -9
  46. package/behaviors/lolo/ui/game/atoms/ui-draw-shape.lolo +40 -8
  47. package/behaviors/lolo/ui/game/atoms/ui-draw-sprite-layer.lolo +13 -3
  48. package/behaviors/lolo/ui/game/atoms/ui-draw-sprite.lolo +12 -2
  49. package/behaviors/lolo/ui/game/atoms/ui-draw-text-layer.lolo +3 -3
  50. package/behaviors/lolo/ui/game/atoms/ui-draw-text.lolo +2 -2
  51. package/behaviors/lolo/ui/game/organisms/std-tactics-board-3d.lolo +32 -2
  52. package/behaviors/lolo/ui/learning/atoms/std-learn-classify.lolo +1 -1
  53. package/behaviors/lolo/ui/learning/atoms/std-learn-compare.lolo +397 -0
  54. package/behaviors/lolo/ui/learning/atoms/std-learn-coupled-sim.lolo +537 -0
  55. package/behaviors/lolo/ui/learning/atoms/std-learn-estimate.lolo +419 -0
  56. package/behaviors/lolo/ui/learning/atoms/std-learn-goal-seek.lolo +591 -0
  57. package/behaviors/lolo/ui/learning/atoms/std-learn-grid-sim.lolo +425 -0
  58. package/behaviors/lolo/ui/learning/atoms/std-learn-hotspot.lolo +398 -0
  59. package/behaviors/lolo/ui/learning/atoms/std-learn-measure.lolo +325 -0
  60. package/behaviors/lolo/ui/learning/atoms/std-learn-perturb.lolo +494 -0
  61. package/behaviors/lolo/ui/learning/atoms/std-learn-predict.lolo +408 -0
  62. package/behaviors/lolo/ui/learning/atoms/std-learn-scenario.lolo +307 -0
  63. package/behaviors/lolo/ui/learning/atoms/std-learn-sim-3d.lolo +318 -0
  64. package/behaviors/lolo/ui/learning/atoms/std-learn-speed-drill.lolo +336 -0
  65. package/behaviors/lolo/ui/learning/atoms/std-learn-tour-3d.lolo +380 -0
  66. package/behaviors/lolo/ui/learning/atoms/ui-biology-canvas.lolo +43 -4
  67. package/behaviors/lolo/ui/learning/atoms/ui-chemistry-canvas.lolo +41 -4
  68. package/behaviors/lolo/ui/learning/atoms/ui-physics-canvas.lolo +43 -4
  69. package/behaviors/lolo/ui/marketing/organisms/ui-book-viewer.lolo +1 -1
  70. package/behaviors/lolo/ui/marketing/organisms/ui-case-study-organism.lolo +1 -1
  71. package/behaviors/lolo/ui/marketing/organisms/ui-feature-grid-organism.lolo +1 -1
  72. package/behaviors/lolo/ui/marketing/organisms/ui-hero-organism.lolo +1 -1
  73. package/behaviors/lolo/ui/marketing/organisms/ui-pricing-organism.lolo +1 -1
  74. package/behaviors/lolo/ui/marketing/organisms/ui-showcase-organism.lolo +1 -1
  75. package/behaviors/lolo/ui/marketing/organisms/ui-stats-organism.lolo +1 -1
  76. package/behaviors/lolo/ui/marketing/organisms/ui-step-flow-organism.lolo +1 -1
  77. package/behaviors/lolo/ui/marketing/organisms/ui-team-organism.lolo +1 -1
  78. package/behaviors/registry/agent/atoms/std-agent-session.orb +22 -1
  79. package/behaviors/registry/agent/atoms/std-agent-tool-call.orb +38 -2
  80. package/behaviors/registry/agent/atoms/std-agent-tool-loop.orb +38 -2
  81. package/behaviors/registry/agent/organisms/std-agent-rabit.orb +23 -1
  82. package/behaviors/registry/infra/atoms/std-approval-gate.orb +8 -16
  83. package/behaviors/registry/infra/atoms/std-cache-aside.orb +31 -62
  84. package/behaviors/registry/infra/atoms/std-circuit-breaker.orb +16 -32
  85. package/behaviors/registry/infra/atoms/std-cross-reference.orb +32 -4
  86. package/behaviors/registry/infra/atoms/std-data-erasure.orb +8 -16
  87. package/behaviors/registry/infra/atoms/std-mod-queue.orb +8 -16
  88. package/behaviors/registry/infra/atoms/std-rate-limiter.orb +14 -28
  89. package/behaviors/registry/infra/atoms/std-row-access-control.orb +30 -2
  90. package/behaviors/registry/ui/core/atoms/std-billable-hour.orb +1 -2
  91. package/behaviors/registry/ui/core/atoms/std-board.orb +19 -5
  92. package/behaviors/registry/ui/core/atoms/std-browse.orb +29 -7
  93. package/behaviors/registry/ui/core/atoms/std-dashboard-grid-embedded.orb +1 -2
  94. package/behaviors/registry/ui/core/atoms/std-esign-flow.orb +3 -5
  95. package/behaviors/registry/ui/core/atoms/std-esign-request.orb +3 -6
  96. package/behaviors/registry/ui/core/atoms/std-event-log.orb +17 -3
  97. package/behaviors/registry/ui/core/atoms/std-export.orb +2 -4
  98. package/behaviors/registry/ui/core/atoms/std-form-advanced.orb +1 -1
  99. package/behaviors/registry/ui/core/atoms/std-gallery.orb +9 -18
  100. package/behaviors/registry/ui/core/atoms/std-graphs.orb +15 -1
  101. package/behaviors/registry/ui/core/atoms/std-import.orb +2 -4
  102. package/behaviors/registry/ui/core/atoms/std-list.orb +4 -6
  103. package/behaviors/registry/ui/core/atoms/std-modal.orb +2 -2
  104. package/behaviors/registry/ui/core/atoms/std-multi-party-flow.orb +16 -2
  105. package/behaviors/registry/ui/core/atoms/std-pagination.orb +15 -1
  106. package/behaviors/registry/ui/core/atoms/std-rating-review.orb +19 -5
  107. package/behaviors/registry/ui/core/atoms/std-recurrence.orb +17 -3
  108. package/behaviors/registry/ui/core/atoms/std-rich-editor.orb +15 -1
  109. package/behaviors/registry/ui/core/atoms/std-scatter.orb +15 -1
  110. package/behaviors/registry/ui/core/atoms/std-signature-capture.orb +2 -2
  111. package/behaviors/registry/ui/core/atoms/std-stats.orb +15 -1
  112. package/behaviors/registry/ui/core/atoms/std-step-flow.orb +16 -2
  113. package/behaviors/registry/ui/core/atoms/std-thread.orb +2 -2
  114. package/behaviors/registry/ui/core/atoms/std-vote.orb +2 -2
  115. package/behaviors/registry/ui/core/atoms/std-wizard.orb +17 -3
  116. package/behaviors/registry/ui/core/atoms/ui-atlas-image.orb +4 -1
  117. package/behaviors/registry/ui/core/atoms/ui-atlas-panel.orb +4 -1
  118. package/behaviors/registry/ui/core/atoms/ui-center.orb +4 -1
  119. package/behaviors/registry/ui/core/atoms/ui-hstack.orb +4 -1
  120. package/behaviors/registry/ui/core/atoms/ui-icon.orb +4 -1
  121. package/behaviors/registry/ui/core/atoms/ui-stack.orb +4 -1
  122. package/behaviors/registry/ui/core/atoms/ui-typography.orb +4 -1
  123. package/behaviors/registry/ui/core/atoms/ui-vstack.orb +4 -1
  124. package/behaviors/registry/ui/core/molecules/ui-accordion.orb +3 -3
  125. package/behaviors/registry/ui/core/molecules/ui-content-renderer.orb +4 -1
  126. package/behaviors/registry/ui/core/molecules/ui-form-layout.orb +4 -1
  127. package/behaviors/registry/ui/core/molecules/ui-grid.orb +4 -1
  128. package/behaviors/registry/ui/core/molecules/ui-tabs.orb +2 -2
  129. package/behaviors/registry/ui/core/molecules/ui-wizard-container.orb +1 -1
  130. package/behaviors/registry/ui/core/organisms/ui-chat-bar.orb +4 -1
  131. package/behaviors/registry/ui/core/organisms/ui-dashboard-grid.orb +5 -2
  132. package/behaviors/registry/ui/core/organisms/ui-detail-panel.orb +5 -2
  133. package/behaviors/registry/ui/core/organisms/ui-entity-cards.orb +4 -1
  134. package/behaviors/registry/ui/core/organisms/ui-entity-list.orb +4 -1
  135. package/behaviors/registry/ui/core/organisms/ui-entity-table.orb +4 -1
  136. package/behaviors/registry/ui/core/organisms/ui-form-section.orb +34 -2
  137. package/behaviors/registry/ui/core/organisms/ui-form.orb +34 -2
  138. package/behaviors/registry/ui/core/organisms/ui-master-detail.orb +4 -1
  139. package/behaviors/registry/ui/core/organisms/ui-media-gallery.orb +4 -1
  140. package/behaviors/registry/ui/core/organisms/ui-segment-renderer.orb +24 -2
  141. package/behaviors/registry/ui/core/organisms/ui-stat-card.orb +4 -1
  142. package/behaviors/registry/ui/core/organisms/ui-subagent-trace-panel.orb +4 -1
  143. package/behaviors/registry/ui/core/organisms/ui-tabbed-container.orb +1 -1
  144. package/behaviors/registry/ui/core/organisms/ui-ui-slot-renderer.orb +1 -1
  145. package/behaviors/registry/ui/game/atoms/std-fx-particles.orb +35 -1
  146. package/behaviors/registry/ui/game/atoms/ui-action-tile.orb +4 -1
  147. package/behaviors/registry/ui/game/atoms/ui-draw-shape-layer.orb +183 -13
  148. package/behaviors/registry/ui/game/atoms/ui-draw-shape.orb +104 -9
  149. package/behaviors/registry/ui/game/atoms/ui-draw-sprite-layer.orb +56 -2
  150. package/behaviors/registry/ui/game/atoms/ui-draw-sprite.orb +36 -4
  151. package/behaviors/registry/ui/game/atoms/ui-draw-text-layer.orb +21 -2
  152. package/behaviors/registry/ui/game/atoms/ui-draw-text.orb +19 -4
  153. package/behaviors/registry/ui/game/organisms/std-tactics-board-3d.orb +173 -2
  154. package/behaviors/registry/ui/learning/atoms/std-learn-classify.orb +1 -1
  155. package/behaviors/registry/ui/learning/atoms/std-learn-compare.orb +2814 -0
  156. package/behaviors/registry/ui/learning/atoms/std-learn-coupled-sim.orb +3183 -0
  157. package/behaviors/registry/ui/learning/atoms/std-learn-estimate.orb +2394 -0
  158. package/behaviors/registry/ui/learning/atoms/std-learn-goal-seek.orb +3951 -0
  159. package/behaviors/registry/ui/learning/atoms/std-learn-grid-sim.orb +3458 -0
  160. package/behaviors/registry/ui/learning/atoms/std-learn-hotspot.orb +2646 -0
  161. package/behaviors/registry/ui/learning/atoms/std-learn-measure.orb +1979 -0
  162. package/behaviors/registry/ui/learning/atoms/std-learn-perturb.orb +2994 -0
  163. package/behaviors/registry/ui/learning/atoms/std-learn-predict.orb +2682 -0
  164. package/behaviors/registry/ui/learning/atoms/std-learn-scenario.orb +1842 -0
  165. package/behaviors/registry/ui/learning/atoms/std-learn-sim-3d.orb +1648 -0
  166. package/behaviors/registry/ui/learning/atoms/std-learn-speed-drill.orb +2307 -0
  167. package/behaviors/registry/ui/learning/atoms/std-learn-tour-3d.orb +2947 -0
  168. package/behaviors/registry/ui/learning/atoms/ui-algorithm-canvas.orb +173 -4
  169. package/behaviors/registry/ui/learning/atoms/ui-biology-canvas.orb +267 -7
  170. package/behaviors/registry/ui/learning/atoms/ui-chemistry-canvas.orb +263 -8
  171. package/behaviors/registry/ui/learning/atoms/ui-learning-canvas.orb +116 -1
  172. package/behaviors/registry/ui/learning/atoms/ui-math-canvas.orb +200 -4
  173. package/behaviors/registry/ui/learning/atoms/ui-physics-canvas.orb +264 -7
  174. package/behaviors/registry/ui/marketing/atoms/std-marketing-article.orb +1 -2
  175. package/behaviors/registry/ui/marketing/atoms/std-marketing-footer.orb +1 -2
  176. package/behaviors/registry/ui/marketing/atoms/std-marketing-split.orb +1 -2
  177. package/behaviors/registry/ui/marketing/atoms/std-marketing-stats.orb +1 -2
  178. package/behaviors/registry/ui/marketing/atoms/std-marketing-steps.orb +1 -2
  179. package/behaviors/registry/ui/marketing/atoms/std-marketing-team.orb +1 -2
  180. package/behaviors/registry/ui/marketing/organisms/ui-book-viewer.orb +4 -1
  181. package/behaviors/registry/ui/marketing/organisms/ui-case-study-organism.orb +4 -1
  182. package/behaviors/registry/ui/marketing/organisms/ui-feature-grid-organism.orb +4 -1
  183. package/behaviors/registry/ui/marketing/organisms/ui-hero-organism.orb +4 -1
  184. package/behaviors/registry/ui/marketing/organisms/ui-pricing-organism.orb +4 -1
  185. package/behaviors/registry/ui/marketing/organisms/ui-showcase-organism.orb +4 -1
  186. package/behaviors/registry/ui/marketing/organisms/ui-stats-organism.orb +4 -1
  187. package/behaviors/registry/ui/marketing/organisms/ui-step-flow-organism.orb +4 -1
  188. package/behaviors/registry/ui/marketing/organisms/ui-team-organism.orb +4 -1
  189. package/dist/behaviors/exports-reader.js +3440 -2189
  190. package/dist/behaviors/functions/index.d.ts +1751 -154
  191. package/dist/behaviors/functions/index.js +3402 -2190
  192. package/dist/behaviors/index.d.ts +1 -1
  193. package/dist/behaviors/index.js +3441 -2190
  194. package/dist/behaviors/query.js +3440 -2189
  195. package/dist/behaviors-embeddings.hash.json +3 -3
  196. package/dist/behaviors-embeddings.json +230 -178
  197. package/dist/behaviors-registry.json +4397 -171
  198. package/dist/index.d.ts +1 -1
  199. package/dist/index.js +3441 -2190
  200. package/dist/knob-embeddings.hash.json +3 -3
  201. package/dist/knob-embeddings.json +1 -1
  202. package/dist/registry/factory-signatures.json +1 -1
  203. package/package.json +2 -2
@@ -0,0 +1,3951 @@
1
+ {
2
+ "description": "Generic goal-seek (inverse-problem) instrument — a config-declared target curve is drawn from a hidden parameter pair, and the learner tunes their own two parameters with sliders until their curve matches it, then presses Check to be graded against an RMS-distance tolerance. The curve family (power y = A·xᴮ, linear y = A + B·x, or sine y = A·sin(B·x)), the hidden target parameters, the tolerance, and every label are config-declared, so the same mechanism serves any inverse problem: fit a demand curve, match a projectile arc, tune a growth rate, recover a wave's amplitude and frequency. A live distance readout (optionally hidden for a harder variant) plays warmer/colder. Standalone by default; behind a lab router set matchMode and it renders only when MODE_SELECTED matches.",
3
+ "ledger": {
4
+ "entries": {
5
+ "ent_01M07580VZRK1EW04A9KGH67S1": {
6
+ "bakedName": "GoalSeekScene",
7
+ "curName": "GoalSeekScene",
8
+ "id": "ent_01M07580VZRK1EW04A9KGH67S1",
9
+ "kind": "entity",
10
+ "owner": "workspace",
11
+ "renames": []
12
+ },
13
+ "evt_01M07580VZ8RDZMA3WMX2DKFAR": {
14
+ "bakedName": "INIT",
15
+ "curName": "INIT",
16
+ "id": "evt_01M07580VZ8RDZMA3WMX2DKFAR",
17
+ "kind": "event",
18
+ "owner": "workspace",
19
+ "parent": "trt_01M07580VZCAQ803GS0E38Q1J0",
20
+ "renames": []
21
+ },
22
+ "evt_01M07580W5F7ACE7Z9TSS3G2W0": {
23
+ "bakedName": "SET_PARAM_A",
24
+ "curName": "SET_PARAM_A",
25
+ "id": "evt_01M07580W5F7ACE7Z9TSS3G2W0",
26
+ "kind": "event",
27
+ "owner": "workspace",
28
+ "parent": "trt_01M07580VZCAQ803GS0E38Q1J0",
29
+ "renames": []
30
+ },
31
+ "evt_01M07580W5FS31BTS7N6M1RTVX": {
32
+ "bakedName": "GOAL_RESET",
33
+ "curName": "GOAL_RESET",
34
+ "id": "evt_01M07580W5FS31BTS7N6M1RTVX",
35
+ "kind": "event",
36
+ "owner": "workspace",
37
+ "parent": "trt_01M07580VZCAQ803GS0E38Q1J0",
38
+ "renames": []
39
+ },
40
+ "evt_01M07580W5H3YN7CS9N5TXXD56": {
41
+ "bakedName": "CHECK",
42
+ "curName": "CHECK",
43
+ "id": "evt_01M07580W5H3YN7CS9N5TXXD56",
44
+ "kind": "event",
45
+ "owner": "workspace",
46
+ "parent": "trt_01M07580VZCAQ803GS0E38Q1J0",
47
+ "renames": []
48
+ },
49
+ "evt_01M07580W5HCGHVRXPXBBHT7JH": {
50
+ "bakedName": "SET_PARAM_B",
51
+ "curName": "SET_PARAM_B",
52
+ "id": "evt_01M07580W5HCGHVRXPXBBHT7JH",
53
+ "kind": "event",
54
+ "owner": "workspace",
55
+ "parent": "trt_01M07580VZCAQ803GS0E38Q1J0",
56
+ "renames": []
57
+ },
58
+ "evt_01M07580W5HD3M1WG88XEPW7CQ": {
59
+ "bakedName": "MODE_SELECTED",
60
+ "curName": "MODE_SELECTED",
61
+ "id": "evt_01M07580W5HD3M1WG88XEPW7CQ",
62
+ "kind": "event",
63
+ "owner": "workspace",
64
+ "parent": "trt_01M07580VZCAQ803GS0E38Q1J0",
65
+ "renames": []
66
+ },
67
+ "evt_01M07580W5K1HRKR1F1XZEQJ66": {
68
+ "bakedName": "PARAMS_CHANGED",
69
+ "curName": "PARAMS_CHANGED",
70
+ "id": "evt_01M07580W5K1HRKR1F1XZEQJ66",
71
+ "kind": "event",
72
+ "owner": "workspace",
73
+ "parent": "trt_01M07580VZCAQ803GS0E38Q1J0",
74
+ "renames": []
75
+ },
76
+ "evt_01M07580W5RZZ2ESNWVK97SCNC": {
77
+ "bakedName": "GOAL_CHECKED",
78
+ "curName": "GOAL_CHECKED",
79
+ "id": "evt_01M07580W5RZZ2ESNWVK97SCNC",
80
+ "kind": "event",
81
+ "owner": "workspace",
82
+ "parent": "trt_01M07580VZCAQ803GS0E38Q1J0",
83
+ "renames": []
84
+ },
85
+ "evt_01M07580W5WJ19JYKHB3WR59WH": {
86
+ "bakedName": "RESET",
87
+ "curName": "RESET",
88
+ "id": "evt_01M07580W5WJ19JYKHB3WR59WH",
89
+ "kind": "event",
90
+ "owner": "workspace",
91
+ "parent": "trt_01M07580VZCAQ803GS0E38Q1J0",
92
+ "renames": []
93
+ },
94
+ "orb_01M07580VZ7B4B990TA9QZ36GF": {
95
+ "bakedName": "GoalSeekOrbital",
96
+ "curName": "GoalSeekOrbital",
97
+ "id": "orb_01M07580VZ7B4B990TA9QZ36GF",
98
+ "kind": "orbital",
99
+ "owner": "workspace",
100
+ "renames": []
101
+ },
102
+ "pag_01M07580W8THD6N1X4CY2FQTVH": {
103
+ "bakedName": "GoalSeekPage",
104
+ "curName": "GoalSeekPage",
105
+ "id": "pag_01M07580W8THD6N1X4CY2FQTVH",
106
+ "kind": "page",
107
+ "owner": "workspace",
108
+ "renames": []
109
+ },
110
+ "trt_01M07580VZCAQ803GS0E38Q1J0": {
111
+ "bakedName": "GoalSeekSim",
112
+ "curName": "GoalSeekSim",
113
+ "id": "trt_01M07580VZCAQ803GS0E38Q1J0",
114
+ "kind": "trait",
115
+ "owner": "workspace",
116
+ "renames": []
117
+ }
118
+ },
119
+ "schemaVersion": 1
120
+ },
121
+ "name": "std-learn-goal-seek",
122
+ "orbitals": [
123
+ {
124
+ "entity": {
125
+ "fields": [
126
+ {
127
+ "name": "id",
128
+ "required": true,
129
+ "type": "string"
130
+ },
131
+ {
132
+ "default": false,
133
+ "name": "active",
134
+ "type": "boolean"
135
+ },
136
+ {
137
+ "name": "title",
138
+ "type": "string"
139
+ },
140
+ {
141
+ "name": "curveKind",
142
+ "type": "string"
143
+ },
144
+ {
145
+ "name": "paramA",
146
+ "type": "number"
147
+ },
148
+ {
149
+ "name": "paramB",
150
+ "type": "number"
151
+ },
152
+ {
153
+ "name": "paramALabel",
154
+ "type": "string"
155
+ },
156
+ {
157
+ "name": "paramBLabel",
158
+ "type": "string"
159
+ },
160
+ {
161
+ "items": {
162
+ "properties": {
163
+ "x": {
164
+ "name": "x",
165
+ "required": true,
166
+ "type": "number"
167
+ },
168
+ "y": {
169
+ "name": "y",
170
+ "required": true,
171
+ "type": "number"
172
+ }
173
+ },
174
+ "type": "object"
175
+ },
176
+ "name": "targetSamples",
177
+ "type": "array"
178
+ },
179
+ {
180
+ "items": {
181
+ "properties": {
182
+ "color": {
183
+ "name": "color",
184
+ "required": false,
185
+ "type": "string"
186
+ },
187
+ "label": {
188
+ "name": "label",
189
+ "required": false,
190
+ "type": "string"
191
+ },
192
+ "samples": {
193
+ "items": {
194
+ "properties": {
195
+ "x": {
196
+ "name": "x",
197
+ "required": true,
198
+ "type": "number"
199
+ },
200
+ "y": {
201
+ "name": "y",
202
+ "required": true,
203
+ "type": "number"
204
+ }
205
+ },
206
+ "type": "object"
207
+ },
208
+ "name": "samples",
209
+ "required": true,
210
+ "type": "array"
211
+ }
212
+ },
213
+ "type": "object"
214
+ },
215
+ "name": "curves",
216
+ "type": "array"
217
+ },
218
+ {
219
+ "default": 0.0,
220
+ "name": "distance",
221
+ "type": "number"
222
+ },
223
+ {
224
+ "default": 0.0,
225
+ "name": "attempts",
226
+ "type": "number"
227
+ },
228
+ {
229
+ "default": false,
230
+ "name": "solved",
231
+ "type": "boolean"
232
+ },
233
+ {
234
+ "name": "feedback",
235
+ "type": "string"
236
+ },
237
+ {
238
+ "items": {
239
+ "type": "node"
240
+ },
241
+ "name": "resultRow",
242
+ "type": "array"
243
+ },
244
+ {
245
+ "name": "yMin",
246
+ "type": "number"
247
+ },
248
+ {
249
+ "name": "yMax",
250
+ "type": "number"
251
+ }
252
+ ],
253
+ "id": "ent_01M07580VZRK1EW04A9KGH67S1",
254
+ "name": "GoalSeekScene",
255
+ "persistence": "runtime"
256
+ },
257
+ "id": "orb_01M07580VZ7B4B990TA9QZ36GF",
258
+ "name": "GoalSeekOrbital",
259
+ "pages": [
260
+ {
261
+ "id": "pag_01M07580W8THD6N1X4CY2FQTVH",
262
+ "name": "GoalSeekPage",
263
+ "path": "/learn-goal-seek",
264
+ "traits": [
265
+ {
266
+ "ref": "GoalSeekSim",
267
+ "refId": "trt_01M07580VZCAQ803GS0E38Q1J0"
268
+ }
269
+ ]
270
+ }
271
+ ],
272
+ "traits": [
273
+ {
274
+ "category": "interaction",
275
+ "config": {
276
+ "checkLabel": {
277
+ "default": "Check",
278
+ "label": "Check Label",
279
+ "tier": "presentation",
280
+ "type": "string"
281
+ },
282
+ "curveKind": {
283
+ "default": "sine",
284
+ "description": "Curve family both curves are drawn from: power (y = A·xᴮ), linear (y = A + B·x), or sine (y = A·sin(B·x)).",
285
+ "label": "Curve Kind",
286
+ "synonyms": "curve family, power law, linear function, sine wave, function type",
287
+ "tier": "domain",
288
+ "type": "string"
289
+ },
290
+ "goalText": {
291
+ "default": "Tune the two sliders until your curve matches the target curve, then press Check.",
292
+ "description": "One-sentence statement of the inverse problem the learner must solve.",
293
+ "label": "Goal Text",
294
+ "tier": "domain",
295
+ "type": "string"
296
+ },
297
+ "gridStep": {
298
+ "default": 1.0,
299
+ "label": "Grid Step",
300
+ "tier": "presentation",
301
+ "type": "number"
302
+ },
303
+ "height": {
304
+ "default": 400.0,
305
+ "label": "Height",
306
+ "tier": "presentation",
307
+ "type": "number"
308
+ },
309
+ "learnerColor": {
310
+ "default": "#3b82f6",
311
+ "label": "Learner Color",
312
+ "tier": "presentation",
313
+ "type": "string"
314
+ },
315
+ "learnerLabel": {
316
+ "default": "Yours",
317
+ "label": "Learner Label",
318
+ "tier": "presentation",
319
+ "type": "string"
320
+ },
321
+ "matchMode": {
322
+ "default": "",
323
+ "description": "When composed behind a lab router, the MODE_SELECTED mode value this instrument responds to. Empty string means standalone — render immediately on INIT.",
324
+ "label": "Match Mode",
325
+ "tier": "presentation",
326
+ "type": "string"
327
+ },
328
+ "paramADefault": {
329
+ "default": 1.0,
330
+ "description": "Starting value of the learner's first parameter.",
331
+ "label": "Parameter A Default",
332
+ "tier": "domain",
333
+ "type": "number"
334
+ },
335
+ "paramALabel": {
336
+ "default": "A",
337
+ "description": "Display label for the first parameter.",
338
+ "label": "Parameter A Label",
339
+ "tier": "presentation",
340
+ "type": "string"
341
+ },
342
+ "paramAMax": {
343
+ "default": 5.0,
344
+ "label": "Parameter A Max",
345
+ "tier": "domain",
346
+ "type": "number"
347
+ },
348
+ "paramAMin": {
349
+ "default": -5.0,
350
+ "label": "Parameter A Min",
351
+ "tier": "domain",
352
+ "type": "number"
353
+ },
354
+ "paramAStep": {
355
+ "default": 0.1,
356
+ "label": "Parameter A Step",
357
+ "tier": "presentation",
358
+ "type": "number"
359
+ },
360
+ "paramBDefault": {
361
+ "default": 1.0,
362
+ "description": "Starting value of the learner's second parameter.",
363
+ "label": "Parameter B Default",
364
+ "tier": "domain",
365
+ "type": "number"
366
+ },
367
+ "paramBLabel": {
368
+ "default": "B",
369
+ "description": "Display label for the second parameter.",
370
+ "label": "Parameter B Label",
371
+ "tier": "presentation",
372
+ "type": "string"
373
+ },
374
+ "paramBMax": {
375
+ "default": 5.0,
376
+ "label": "Parameter B Max",
377
+ "tier": "domain",
378
+ "type": "number"
379
+ },
380
+ "paramBMin": {
381
+ "default": -5.0,
382
+ "label": "Parameter B Min",
383
+ "tier": "domain",
384
+ "type": "number"
385
+ },
386
+ "paramBStep": {
387
+ "default": 0.1,
388
+ "label": "Parameter B Step",
389
+ "tier": "presentation",
390
+ "type": "number"
391
+ },
392
+ "showAxes": {
393
+ "default": true,
394
+ "label": "Show Axes",
395
+ "tier": "presentation",
396
+ "type": "boolean"
397
+ },
398
+ "showGrid": {
399
+ "default": true,
400
+ "label": "Show Grid",
401
+ "tier": "presentation",
402
+ "type": "boolean"
403
+ },
404
+ "showLiveDistance": {
405
+ "default": true,
406
+ "description": "When true the RMS distance updates live as the learner tunes (warmer/colder); when false only attempts are shown, for a harder variant.",
407
+ "label": "Show Live Distance",
408
+ "tier": "domain",
409
+ "type": "boolean"
410
+ },
411
+ "targetA": {
412
+ "default": 2.5,
413
+ "description": "Hidden first parameter of the target curve the learner must recover.",
414
+ "label": "Target A",
415
+ "tier": "domain",
416
+ "type": "number"
417
+ },
418
+ "targetB": {
419
+ "default": 1.5,
420
+ "description": "Hidden second parameter of the target curve the learner must recover.",
421
+ "label": "Target B",
422
+ "tier": "domain",
423
+ "type": "number"
424
+ },
425
+ "targetColor": {
426
+ "default": "#94a3b8",
427
+ "label": "Target Color",
428
+ "tier": "presentation",
429
+ "type": "string"
430
+ },
431
+ "targetLabel": {
432
+ "default": "Target",
433
+ "label": "Target Label",
434
+ "tier": "presentation",
435
+ "type": "string"
436
+ },
437
+ "title": {
438
+ "default": "Goal Seek",
439
+ "description": "Title shown above the canvas.",
440
+ "label": "Title",
441
+ "tier": "presentation",
442
+ "type": "string"
443
+ },
444
+ "tolerance": {
445
+ "default": 0.35,
446
+ "description": "Maximum RMS distance between learner and target curves that still counts as a match.",
447
+ "label": "Tolerance",
448
+ "tier": "domain",
449
+ "type": "number"
450
+ },
451
+ "width": {
452
+ "default": 600.0,
453
+ "label": "Width",
454
+ "tier": "presentation",
455
+ "type": "number"
456
+ },
457
+ "xMax": {
458
+ "default": 10.0,
459
+ "label": "X Max",
460
+ "tier": "presentation",
461
+ "type": "number"
462
+ },
463
+ "xMin": {
464
+ "default": 0.0,
465
+ "label": "X Min",
466
+ "tier": "presentation",
467
+ "type": "number"
468
+ }
469
+ },
470
+ "emits": [
471
+ {
472
+ "description": "The learner's parameter values and current distance after a slider change — a composed listener (readout, coach) can subscribe; a harmless no-op when the atom runs standalone.",
473
+ "event": "PARAMS_CHANGED",
474
+ "eventId": "evt_01M07580W5K1HRKR1F1XZEQJ66",
475
+ "payloadSchema": [
476
+ {
477
+ "name": "paramA",
478
+ "type": "number"
479
+ },
480
+ {
481
+ "name": "paramB",
482
+ "type": "number"
483
+ },
484
+ {
485
+ "name": "distance",
486
+ "type": "number"
487
+ }
488
+ ],
489
+ "scope": "external",
490
+ "tier": "domain"
491
+ },
492
+ {
493
+ "description": "The verdict of a Check press: whether the learner's curve is within tolerance of the target, the RMS distance, and how many attempts it took.",
494
+ "event": "GOAL_CHECKED",
495
+ "eventId": "evt_01M07580W5RZZ2ESNWVK97SCNC",
496
+ "payloadSchema": [
497
+ {
498
+ "name": "matched",
499
+ "type": "boolean"
500
+ },
501
+ {
502
+ "name": "distance",
503
+ "type": "number"
504
+ },
505
+ {
506
+ "name": "attempts",
507
+ "type": "number"
508
+ }
509
+ ],
510
+ "scope": "external",
511
+ "synonyms": "goal seek, inverse problem, curve fitting, match the target, tune to fit",
512
+ "tier": "domain"
513
+ },
514
+ {
515
+ "description": "The learner reset the instrument back to the default parameters.",
516
+ "event": "GOAL_RESET",
517
+ "eventId": "evt_01M07580W5FS31BTS7N6M1RTVX",
518
+ "payloadSchema": [
519
+ {
520
+ "name": "attempts",
521
+ "type": "number"
522
+ }
523
+ ],
524
+ "scope": "external",
525
+ "tier": "domain"
526
+ }
527
+ ],
528
+ "entityContract": {
529
+ "provides": [
530
+ "active",
531
+ "attempts",
532
+ "curveKind",
533
+ "curves",
534
+ "distance",
535
+ "feedback",
536
+ "paramA",
537
+ "paramALabel",
538
+ "paramB",
539
+ "paramBLabel",
540
+ "resultRow",
541
+ "solved",
542
+ "targetSamples",
543
+ "title",
544
+ "yMax",
545
+ "yMin"
546
+ ],
547
+ "requires": []
548
+ },
549
+ "entityRebindable": true,
550
+ "entityRefIds": {
551
+ "GoalSeekScene": "ent_01M07580VZRK1EW04A9KGH67S1"
552
+ },
553
+ "id": "trt_01M07580VZCAQ803GS0E38Q1J0",
554
+ "linkedEntity": "GoalSeekScene",
555
+ "linkedEntityId": "ent_01M07580VZRK1EW04A9KGH67S1",
556
+ "name": "GoalSeekSim",
557
+ "scope": "instance",
558
+ "stateMachine": {
559
+ "events": [
560
+ {
561
+ "id": "evt_01M07580VZ8RDZMA3WMX2DKFAR",
562
+ "key": "INIT",
563
+ "name": "Initialize"
564
+ },
565
+ {
566
+ "description": "Lab router broadcast naming the active mode; this instrument renders when the mode equals matchMode, otherwise renders null.",
567
+ "id": "evt_01M07580W5HD3M1WG88XEPW7CQ",
568
+ "key": "MODE_SELECTED",
569
+ "name": "Mode Selected",
570
+ "payloadSchema": [
571
+ {
572
+ "name": "mode",
573
+ "type": "string"
574
+ }
575
+ ],
576
+ "tier": "domain"
577
+ },
578
+ {
579
+ "description": "Learner dragged the first parameter's slider — value is the new A; the learner curve and its distance to the target recompute immediately.",
580
+ "id": "evt_01M07580W5F7ACE7Z9TSS3G2W0",
581
+ "key": "SET_PARAM_A",
582
+ "name": "Set Param A",
583
+ "payloadSchema": [
584
+ {
585
+ "name": "value",
586
+ "type": "number"
587
+ }
588
+ ],
589
+ "tier": "domain"
590
+ },
591
+ {
592
+ "description": "Learner dragged the second parameter's slider — value is the new B; the learner curve and its distance to the target recompute immediately.",
593
+ "id": "evt_01M07580W5HCGHVRXPXBBHT7JH",
594
+ "key": "SET_PARAM_B",
595
+ "name": "Set Param B",
596
+ "payloadSchema": [
597
+ {
598
+ "name": "value",
599
+ "type": "number"
600
+ }
601
+ ],
602
+ "tier": "domain"
603
+ },
604
+ {
605
+ "description": "Learner asked to be graded — the current RMS distance is compared against the tolerance and the attempt is counted.",
606
+ "id": "evt_01M07580W5H3YN7CS9N5TXXD56",
607
+ "key": "CHECK",
608
+ "name": "Check",
609
+ "tier": "domain"
610
+ },
611
+ {
612
+ "description": "Learner reset the parameters to their defaults and cleared the attempt count; the target stays the same.",
613
+ "id": "evt_01M07580W5WJ19JYKHB3WR59WH",
614
+ "key": "RESET",
615
+ "name": "Reset",
616
+ "tier": "domain"
617
+ },
618
+ {
619
+ "description": "The learner's parameter values and current distance after a slider change — a composed listener (readout, coach) can subscribe; a harmless no-op when the atom runs standalone.",
620
+ "id": "evt_01M07580W5K1HRKR1F1XZEQJ66",
621
+ "key": "PARAMS_CHANGED",
622
+ "name": "Params Changed",
623
+ "payloadSchema": [
624
+ {
625
+ "name": "paramA",
626
+ "type": "number"
627
+ },
628
+ {
629
+ "name": "paramB",
630
+ "type": "number"
631
+ },
632
+ {
633
+ "name": "distance",
634
+ "type": "number"
635
+ }
636
+ ],
637
+ "tier": "domain"
638
+ },
639
+ {
640
+ "description": "The verdict of a Check press: whether the learner's curve is within tolerance of the target, the RMS distance, and how many attempts it took.",
641
+ "id": "evt_01M07580W5RZZ2ESNWVK97SCNC",
642
+ "key": "GOAL_CHECKED",
643
+ "name": "Goal Checked",
644
+ "payloadSchema": [
645
+ {
646
+ "name": "matched",
647
+ "type": "boolean"
648
+ },
649
+ {
650
+ "name": "distance",
651
+ "type": "number"
652
+ },
653
+ {
654
+ "name": "attempts",
655
+ "type": "number"
656
+ }
657
+ ],
658
+ "synonyms": "goal seek, inverse problem, curve fitting, match the target, tune to fit",
659
+ "tier": "domain"
660
+ },
661
+ {
662
+ "description": "The learner reset the instrument back to the default parameters.",
663
+ "id": "evt_01M07580W5FS31BTS7N6M1RTVX",
664
+ "key": "GOAL_RESET",
665
+ "name": "Goal Reset",
666
+ "payloadSchema": [
667
+ {
668
+ "name": "attempts",
669
+ "type": "number"
670
+ }
671
+ ],
672
+ "tier": "domain"
673
+ }
674
+ ],
675
+ "states": [
676
+ {
677
+ "isInitial": true,
678
+ "name": "idle"
679
+ }
680
+ ],
681
+ "transitions": [
682
+ {
683
+ "effects": [
684
+ [
685
+ "let",
686
+ [
687
+ [
688
+ "kind",
689
+ "@config.curveKind"
690
+ ],
691
+ [
692
+ "span",
693
+ [
694
+ "-",
695
+ "@config.xMax",
696
+ "@config.xMin"
697
+ ]
698
+ ],
699
+ [
700
+ "tA",
701
+ "@config.targetA"
702
+ ],
703
+ [
704
+ "tB",
705
+ "@config.targetB"
706
+ ],
707
+ [
708
+ "A",
709
+ "@config.paramADefault"
710
+ ],
711
+ [
712
+ "B",
713
+ "@config.paramBDefault"
714
+ ],
715
+ [
716
+ "targetSamples",
717
+ [
718
+ "array/map",
719
+ [
720
+ "array/range",
721
+ 0.0,
722
+ 81.0
723
+ ],
724
+ [
725
+ "fn",
726
+ [
727
+ "i"
728
+ ],
729
+ [
730
+ "let",
731
+ [
732
+ [
733
+ "x",
734
+ [
735
+ "+",
736
+ "@config.xMin",
737
+ [
738
+ "*",
739
+ "@i",
740
+ [
741
+ "/",
742
+ "@span",
743
+ 80.0
744
+ ]
745
+ ]
746
+ ]
747
+ ],
748
+ [
749
+ "yVal",
750
+ [
751
+ "if",
752
+ [
753
+ "==",
754
+ "@kind",
755
+ "power"
756
+ ],
757
+ [
758
+ "*",
759
+ "@tA",
760
+ [
761
+ "math/pow",
762
+ "@x",
763
+ "@tB"
764
+ ]
765
+ ],
766
+ [
767
+ "if",
768
+ [
769
+ "==",
770
+ "@kind",
771
+ "linear"
772
+ ],
773
+ [
774
+ "+",
775
+ "@tA",
776
+ [
777
+ "*",
778
+ "@tB",
779
+ "@x"
780
+ ]
781
+ ],
782
+ [
783
+ "*",
784
+ "@tA",
785
+ [
786
+ "math/sin",
787
+ [
788
+ "*",
789
+ "@tB",
790
+ "@x"
791
+ ]
792
+ ]
793
+ ]
794
+ ]
795
+ ]
796
+ ]
797
+ ],
798
+ {
799
+ "x": "@x",
800
+ "y": "@yVal"
801
+ }
802
+ ]
803
+ ]
804
+ ]
805
+ ],
806
+ [
807
+ "samples",
808
+ [
809
+ "array/map",
810
+ [
811
+ "array/range",
812
+ 0.0,
813
+ 81.0
814
+ ],
815
+ [
816
+ "fn",
817
+ [
818
+ "i"
819
+ ],
820
+ [
821
+ "let",
822
+ [
823
+ [
824
+ "x",
825
+ [
826
+ "+",
827
+ "@config.xMin",
828
+ [
829
+ "*",
830
+ "@i",
831
+ [
832
+ "/",
833
+ "@span",
834
+ 80.0
835
+ ]
836
+ ]
837
+ ]
838
+ ],
839
+ [
840
+ "yVal",
841
+ [
842
+ "if",
843
+ [
844
+ "==",
845
+ "@kind",
846
+ "power"
847
+ ],
848
+ [
849
+ "*",
850
+ "@A",
851
+ [
852
+ "math/pow",
853
+ "@x",
854
+ "@B"
855
+ ]
856
+ ],
857
+ [
858
+ "if",
859
+ [
860
+ "==",
861
+ "@kind",
862
+ "linear"
863
+ ],
864
+ [
865
+ "+",
866
+ "@A",
867
+ [
868
+ "*",
869
+ "@B",
870
+ "@x"
871
+ ]
872
+ ],
873
+ [
874
+ "*",
875
+ "@A",
876
+ [
877
+ "math/sin",
878
+ [
879
+ "*",
880
+ "@B",
881
+ "@x"
882
+ ]
883
+ ]
884
+ ]
885
+ ]
886
+ ]
887
+ ]
888
+ ],
889
+ {
890
+ "x": "@x",
891
+ "y": "@yVal"
892
+ }
893
+ ]
894
+ ]
895
+ ]
896
+ ],
897
+ [
898
+ "dist",
899
+ [
900
+ "math/sqrt",
901
+ [
902
+ "/",
903
+ [
904
+ "array/sum",
905
+ [
906
+ "array/map",
907
+ [
908
+ "array/range",
909
+ 0.0,
910
+ 81.0
911
+ ],
912
+ [
913
+ "fn",
914
+ [
915
+ "i"
916
+ ],
917
+ [
918
+ "let",
919
+ [
920
+ [
921
+ "dY",
922
+ [
923
+ "-",
924
+ [
925
+ "object/get",
926
+ [
927
+ "array/nth",
928
+ "@samples",
929
+ "@i"
930
+ ],
931
+ "y"
932
+ ],
933
+ [
934
+ "object/get",
935
+ [
936
+ "array/nth",
937
+ "@targetSamples",
938
+ "@i"
939
+ ],
940
+ "y"
941
+ ]
942
+ ]
943
+ ]
944
+ ],
945
+ [
946
+ "*",
947
+ "@dY",
948
+ "@dY"
949
+ ]
950
+ ]
951
+ ]
952
+ ]
953
+ ],
954
+ 81.0
955
+ ]
956
+ ]
957
+ ],
958
+ [
959
+ "allSamples",
960
+ [
961
+ "array/concat",
962
+ "@samples",
963
+ "@targetSamples"
964
+ ]
965
+ ],
966
+ [
967
+ "yMinRaw",
968
+ [
969
+ "array/reduce",
970
+ "@allSamples",
971
+ [
972
+ "object/get",
973
+ [
974
+ "array/nth",
975
+ "@allSamples",
976
+ 0.0
977
+ ],
978
+ "y"
979
+ ],
980
+ [
981
+ "fn",
982
+ [
983
+ "acc",
984
+ "s"
985
+ ],
986
+ [
987
+ "math/min",
988
+ "@acc",
989
+ [
990
+ "object/get",
991
+ "@s",
992
+ "y"
993
+ ]
994
+ ]
995
+ ]
996
+ ]
997
+ ],
998
+ [
999
+ "yMaxRaw",
1000
+ [
1001
+ "array/reduce",
1002
+ "@allSamples",
1003
+ [
1004
+ "object/get",
1005
+ [
1006
+ "array/nth",
1007
+ "@allSamples",
1008
+ 0.0
1009
+ ],
1010
+ "y"
1011
+ ],
1012
+ [
1013
+ "fn",
1014
+ [
1015
+ "acc",
1016
+ "s"
1017
+ ],
1018
+ [
1019
+ "math/max",
1020
+ "@acc",
1021
+ [
1022
+ "object/get",
1023
+ "@s",
1024
+ "y"
1025
+ ]
1026
+ ]
1027
+ ]
1028
+ ]
1029
+ ],
1030
+ [
1031
+ "yPad",
1032
+ [
1033
+ "*",
1034
+ 0.1,
1035
+ [
1036
+ "math/max",
1037
+ 0.001,
1038
+ [
1039
+ "-",
1040
+ "@yMaxRaw",
1041
+ "@yMinRaw"
1042
+ ]
1043
+ ]
1044
+ ]
1045
+ ]
1046
+ ],
1047
+ [
1048
+ "do",
1049
+ [
1050
+ "set",
1051
+ "@entity.active",
1052
+ true
1053
+ ],
1054
+ [
1055
+ "set",
1056
+ "@entity.title",
1057
+ "@config.title"
1058
+ ],
1059
+ [
1060
+ "set",
1061
+ "@entity.curveKind",
1062
+ "@kind"
1063
+ ],
1064
+ [
1065
+ "set",
1066
+ "@entity.paramA",
1067
+ "@A"
1068
+ ],
1069
+ [
1070
+ "set",
1071
+ "@entity.paramB",
1072
+ "@B"
1073
+ ],
1074
+ [
1075
+ "set",
1076
+ "@entity.paramALabel",
1077
+ "@config.paramALabel"
1078
+ ],
1079
+ [
1080
+ "set",
1081
+ "@entity.paramBLabel",
1082
+ "@config.paramBLabel"
1083
+ ],
1084
+ [
1085
+ "set",
1086
+ "@entity.targetSamples",
1087
+ "@targetSamples"
1088
+ ],
1089
+ [
1090
+ "set",
1091
+ "@entity.distance",
1092
+ "@dist"
1093
+ ],
1094
+ [
1095
+ "set",
1096
+ "@entity.attempts",
1097
+ 0.0
1098
+ ],
1099
+ [
1100
+ "set",
1101
+ "@entity.solved",
1102
+ false
1103
+ ],
1104
+ [
1105
+ "set",
1106
+ "@entity.feedback",
1107
+ ""
1108
+ ],
1109
+ [
1110
+ "set",
1111
+ "@entity.yMin",
1112
+ [
1113
+ "-",
1114
+ "@yMinRaw",
1115
+ "@yPad"
1116
+ ]
1117
+ ],
1118
+ [
1119
+ "set",
1120
+ "@entity.yMax",
1121
+ [
1122
+ "+",
1123
+ "@yMaxRaw",
1124
+ "@yPad"
1125
+ ]
1126
+ ],
1127
+ [
1128
+ "set",
1129
+ "@entity.curves",
1130
+ [
1131
+ {
1132
+ "color": "@config.targetColor",
1133
+ "label": "@config.targetLabel",
1134
+ "samples": "@targetSamples"
1135
+ },
1136
+ {
1137
+ "color": "@config.learnerColor",
1138
+ "label": "@config.learnerLabel",
1139
+ "samples": "@samples"
1140
+ }
1141
+ ]
1142
+ ]
1143
+ ]
1144
+ ],
1145
+ [
1146
+ "set",
1147
+ "@entity.resultRow",
1148
+ [
1149
+ "array/concat",
1150
+ [
1151
+ "if",
1152
+ "@entity.solved",
1153
+ [
1154
+ {
1155
+ "label": "Solved",
1156
+ "type": "badge",
1157
+ "variant": "success"
1158
+ }
1159
+ ],
1160
+ []
1161
+ ],
1162
+ [
1163
+ {
1164
+ "content": "@entity.feedback",
1165
+ "type": "typography",
1166
+ "variant": "caption"
1167
+ }
1168
+ ]
1169
+ ]
1170
+ ],
1171
+ [
1172
+ "render-ui",
1173
+ "main",
1174
+ {
1175
+ "children": [
1176
+ {
1177
+ "children": [
1178
+ {
1179
+ "content": "@entity.title",
1180
+ "type": "typography",
1181
+ "variant": "h4"
1182
+ },
1183
+ {
1184
+ "content": "@config.goalText",
1185
+ "type": "typography",
1186
+ "variant": "body"
1187
+ },
1188
+ {
1189
+ "children": [
1190
+ {
1191
+ "content": [
1192
+ "str/concat",
1193
+ "@entity.paramALabel",
1194
+ ": ",
1195
+ [
1196
+ "math/round",
1197
+ "@entity.paramA",
1198
+ 2.0
1199
+ ]
1200
+ ],
1201
+ "type": "typography",
1202
+ "variant": "caption"
1203
+ },
1204
+ {
1205
+ "action": "SET_PARAM_A",
1206
+ "max": "@config.paramAMax",
1207
+ "min": "@config.paramAMin",
1208
+ "showTooltip": true,
1209
+ "step": "@config.paramAStep",
1210
+ "type": "range-slider",
1211
+ "value": "@entity.paramA"
1212
+ }
1213
+ ],
1214
+ "direction": "vertical",
1215
+ "gap": "xs",
1216
+ "type": "stack"
1217
+ },
1218
+ {
1219
+ "children": [
1220
+ {
1221
+ "content": [
1222
+ "str/concat",
1223
+ "@entity.paramBLabel",
1224
+ ": ",
1225
+ [
1226
+ "math/round",
1227
+ "@entity.paramB",
1228
+ 2.0
1229
+ ]
1230
+ ],
1231
+ "type": "typography",
1232
+ "variant": "caption"
1233
+ },
1234
+ {
1235
+ "action": "SET_PARAM_B",
1236
+ "max": "@config.paramBMax",
1237
+ "min": "@config.paramBMin",
1238
+ "showTooltip": true,
1239
+ "step": "@config.paramBStep",
1240
+ "type": "range-slider",
1241
+ "value": "@entity.paramB"
1242
+ }
1243
+ ],
1244
+ "direction": "vertical",
1245
+ "gap": "xs",
1246
+ "type": "stack"
1247
+ },
1248
+ {
1249
+ "animate": false,
1250
+ "curves": "@entity.curves",
1251
+ "gridStep": "@config.gridStep",
1252
+ "height": "@config.height",
1253
+ "interactive": false,
1254
+ "points": [],
1255
+ "shapes": [],
1256
+ "showAxes": "@config.showAxes",
1257
+ "showGrid": "@config.showGrid",
1258
+ "title": "",
1259
+ "type": "math-canvas",
1260
+ "vectors": [],
1261
+ "width": "@config.width",
1262
+ "xMax": "@config.xMax",
1263
+ "xMin": "@config.xMin",
1264
+ "yMax": "@entity.yMax",
1265
+ "yMin": "@entity.yMin"
1266
+ },
1267
+ {
1268
+ "content": [
1269
+ "if",
1270
+ "@config.showLiveDistance",
1271
+ [
1272
+ "str/concat",
1273
+ "Distance from target: ",
1274
+ [
1275
+ "math/round",
1276
+ "@entity.distance",
1277
+ 3.0
1278
+ ],
1279
+ " · attempts: ",
1280
+ [
1281
+ "str/concat",
1282
+ "",
1283
+ "@entity.attempts"
1284
+ ]
1285
+ ],
1286
+ [
1287
+ "str/concat",
1288
+ "Attempts: ",
1289
+ [
1290
+ "str/concat",
1291
+ "",
1292
+ "@entity.attempts"
1293
+ ]
1294
+ ]
1295
+ ],
1296
+ "type": "typography",
1297
+ "variant": "body"
1298
+ },
1299
+ {
1300
+ "children": [
1301
+ {
1302
+ "action": "CHECK",
1303
+ "disabled": [
1304
+ "if",
1305
+ "@entity.solved",
1306
+ true,
1307
+ false
1308
+ ],
1309
+ "label": "@config.checkLabel",
1310
+ "type": "button",
1311
+ "variant": "primary"
1312
+ },
1313
+ {
1314
+ "action": "RESET",
1315
+ "label": "Reset",
1316
+ "type": "button",
1317
+ "variant": "ghost"
1318
+ }
1319
+ ],
1320
+ "direction": "horizontal",
1321
+ "gap": "sm",
1322
+ "type": "stack"
1323
+ },
1324
+ {
1325
+ "children": "@entity.resultRow",
1326
+ "direction": "horizontal",
1327
+ "gap": "xs",
1328
+ "type": "stack"
1329
+ }
1330
+ ],
1331
+ "direction": "vertical",
1332
+ "gap": "md",
1333
+ "type": "stack"
1334
+ }
1335
+ ],
1336
+ "padding": "md",
1337
+ "type": "box"
1338
+ }
1339
+ ]
1340
+ ],
1341
+ "event": "INIT",
1342
+ "eventId": "evt_01M07580VZ8RDZMA3WMX2DKFAR",
1343
+ "from": "idle",
1344
+ "guard": [
1345
+ "==",
1346
+ "@config.matchMode",
1347
+ ""
1348
+ ],
1349
+ "to": "idle"
1350
+ },
1351
+ {
1352
+ "effects": [
1353
+ [
1354
+ "let",
1355
+ [
1356
+ [
1357
+ "kind",
1358
+ "@config.curveKind"
1359
+ ],
1360
+ [
1361
+ "span",
1362
+ [
1363
+ "-",
1364
+ "@config.xMax",
1365
+ "@config.xMin"
1366
+ ]
1367
+ ],
1368
+ [
1369
+ "tA",
1370
+ "@config.targetA"
1371
+ ],
1372
+ [
1373
+ "tB",
1374
+ "@config.targetB"
1375
+ ],
1376
+ [
1377
+ "A",
1378
+ "@config.paramADefault"
1379
+ ],
1380
+ [
1381
+ "B",
1382
+ "@config.paramBDefault"
1383
+ ],
1384
+ [
1385
+ "targetSamples",
1386
+ [
1387
+ "array/map",
1388
+ [
1389
+ "array/range",
1390
+ 0.0,
1391
+ 81.0
1392
+ ],
1393
+ [
1394
+ "fn",
1395
+ [
1396
+ "i"
1397
+ ],
1398
+ [
1399
+ "let",
1400
+ [
1401
+ [
1402
+ "x",
1403
+ [
1404
+ "+",
1405
+ "@config.xMin",
1406
+ [
1407
+ "*",
1408
+ "@i",
1409
+ [
1410
+ "/",
1411
+ "@span",
1412
+ 80.0
1413
+ ]
1414
+ ]
1415
+ ]
1416
+ ],
1417
+ [
1418
+ "yVal",
1419
+ [
1420
+ "if",
1421
+ [
1422
+ "==",
1423
+ "@kind",
1424
+ "power"
1425
+ ],
1426
+ [
1427
+ "*",
1428
+ "@tA",
1429
+ [
1430
+ "math/pow",
1431
+ "@x",
1432
+ "@tB"
1433
+ ]
1434
+ ],
1435
+ [
1436
+ "if",
1437
+ [
1438
+ "==",
1439
+ "@kind",
1440
+ "linear"
1441
+ ],
1442
+ [
1443
+ "+",
1444
+ "@tA",
1445
+ [
1446
+ "*",
1447
+ "@tB",
1448
+ "@x"
1449
+ ]
1450
+ ],
1451
+ [
1452
+ "*",
1453
+ "@tA",
1454
+ [
1455
+ "math/sin",
1456
+ [
1457
+ "*",
1458
+ "@tB",
1459
+ "@x"
1460
+ ]
1461
+ ]
1462
+ ]
1463
+ ]
1464
+ ]
1465
+ ]
1466
+ ],
1467
+ {
1468
+ "x": "@x",
1469
+ "y": "@yVal"
1470
+ }
1471
+ ]
1472
+ ]
1473
+ ]
1474
+ ],
1475
+ [
1476
+ "samples",
1477
+ [
1478
+ "array/map",
1479
+ [
1480
+ "array/range",
1481
+ 0.0,
1482
+ 81.0
1483
+ ],
1484
+ [
1485
+ "fn",
1486
+ [
1487
+ "i"
1488
+ ],
1489
+ [
1490
+ "let",
1491
+ [
1492
+ [
1493
+ "x",
1494
+ [
1495
+ "+",
1496
+ "@config.xMin",
1497
+ [
1498
+ "*",
1499
+ "@i",
1500
+ [
1501
+ "/",
1502
+ "@span",
1503
+ 80.0
1504
+ ]
1505
+ ]
1506
+ ]
1507
+ ],
1508
+ [
1509
+ "yVal",
1510
+ [
1511
+ "if",
1512
+ [
1513
+ "==",
1514
+ "@kind",
1515
+ "power"
1516
+ ],
1517
+ [
1518
+ "*",
1519
+ "@A",
1520
+ [
1521
+ "math/pow",
1522
+ "@x",
1523
+ "@B"
1524
+ ]
1525
+ ],
1526
+ [
1527
+ "if",
1528
+ [
1529
+ "==",
1530
+ "@kind",
1531
+ "linear"
1532
+ ],
1533
+ [
1534
+ "+",
1535
+ "@A",
1536
+ [
1537
+ "*",
1538
+ "@B",
1539
+ "@x"
1540
+ ]
1541
+ ],
1542
+ [
1543
+ "*",
1544
+ "@A",
1545
+ [
1546
+ "math/sin",
1547
+ [
1548
+ "*",
1549
+ "@B",
1550
+ "@x"
1551
+ ]
1552
+ ]
1553
+ ]
1554
+ ]
1555
+ ]
1556
+ ]
1557
+ ],
1558
+ {
1559
+ "x": "@x",
1560
+ "y": "@yVal"
1561
+ }
1562
+ ]
1563
+ ]
1564
+ ]
1565
+ ],
1566
+ [
1567
+ "dist",
1568
+ [
1569
+ "math/sqrt",
1570
+ [
1571
+ "/",
1572
+ [
1573
+ "array/sum",
1574
+ [
1575
+ "array/map",
1576
+ [
1577
+ "array/range",
1578
+ 0.0,
1579
+ 81.0
1580
+ ],
1581
+ [
1582
+ "fn",
1583
+ [
1584
+ "i"
1585
+ ],
1586
+ [
1587
+ "let",
1588
+ [
1589
+ [
1590
+ "dY",
1591
+ [
1592
+ "-",
1593
+ [
1594
+ "object/get",
1595
+ [
1596
+ "array/nth",
1597
+ "@samples",
1598
+ "@i"
1599
+ ],
1600
+ "y"
1601
+ ],
1602
+ [
1603
+ "object/get",
1604
+ [
1605
+ "array/nth",
1606
+ "@targetSamples",
1607
+ "@i"
1608
+ ],
1609
+ "y"
1610
+ ]
1611
+ ]
1612
+ ]
1613
+ ],
1614
+ [
1615
+ "*",
1616
+ "@dY",
1617
+ "@dY"
1618
+ ]
1619
+ ]
1620
+ ]
1621
+ ]
1622
+ ],
1623
+ 81.0
1624
+ ]
1625
+ ]
1626
+ ],
1627
+ [
1628
+ "allSamples",
1629
+ [
1630
+ "array/concat",
1631
+ "@samples",
1632
+ "@targetSamples"
1633
+ ]
1634
+ ],
1635
+ [
1636
+ "yMinRaw",
1637
+ [
1638
+ "array/reduce",
1639
+ "@allSamples",
1640
+ [
1641
+ "object/get",
1642
+ [
1643
+ "array/nth",
1644
+ "@allSamples",
1645
+ 0.0
1646
+ ],
1647
+ "y"
1648
+ ],
1649
+ [
1650
+ "fn",
1651
+ [
1652
+ "acc",
1653
+ "s"
1654
+ ],
1655
+ [
1656
+ "math/min",
1657
+ "@acc",
1658
+ [
1659
+ "object/get",
1660
+ "@s",
1661
+ "y"
1662
+ ]
1663
+ ]
1664
+ ]
1665
+ ]
1666
+ ],
1667
+ [
1668
+ "yMaxRaw",
1669
+ [
1670
+ "array/reduce",
1671
+ "@allSamples",
1672
+ [
1673
+ "object/get",
1674
+ [
1675
+ "array/nth",
1676
+ "@allSamples",
1677
+ 0.0
1678
+ ],
1679
+ "y"
1680
+ ],
1681
+ [
1682
+ "fn",
1683
+ [
1684
+ "acc",
1685
+ "s"
1686
+ ],
1687
+ [
1688
+ "math/max",
1689
+ "@acc",
1690
+ [
1691
+ "object/get",
1692
+ "@s",
1693
+ "y"
1694
+ ]
1695
+ ]
1696
+ ]
1697
+ ]
1698
+ ],
1699
+ [
1700
+ "yPad",
1701
+ [
1702
+ "*",
1703
+ 0.1,
1704
+ [
1705
+ "math/max",
1706
+ 0.001,
1707
+ [
1708
+ "-",
1709
+ "@yMaxRaw",
1710
+ "@yMinRaw"
1711
+ ]
1712
+ ]
1713
+ ]
1714
+ ]
1715
+ ],
1716
+ [
1717
+ "do",
1718
+ [
1719
+ "set",
1720
+ "@entity.active",
1721
+ true
1722
+ ],
1723
+ [
1724
+ "set",
1725
+ "@entity.title",
1726
+ "@config.title"
1727
+ ],
1728
+ [
1729
+ "set",
1730
+ "@entity.curveKind",
1731
+ "@kind"
1732
+ ],
1733
+ [
1734
+ "set",
1735
+ "@entity.paramA",
1736
+ "@A"
1737
+ ],
1738
+ [
1739
+ "set",
1740
+ "@entity.paramB",
1741
+ "@B"
1742
+ ],
1743
+ [
1744
+ "set",
1745
+ "@entity.paramALabel",
1746
+ "@config.paramALabel"
1747
+ ],
1748
+ [
1749
+ "set",
1750
+ "@entity.paramBLabel",
1751
+ "@config.paramBLabel"
1752
+ ],
1753
+ [
1754
+ "set",
1755
+ "@entity.targetSamples",
1756
+ "@targetSamples"
1757
+ ],
1758
+ [
1759
+ "set",
1760
+ "@entity.distance",
1761
+ "@dist"
1762
+ ],
1763
+ [
1764
+ "set",
1765
+ "@entity.attempts",
1766
+ 0.0
1767
+ ],
1768
+ [
1769
+ "set",
1770
+ "@entity.solved",
1771
+ false
1772
+ ],
1773
+ [
1774
+ "set",
1775
+ "@entity.feedback",
1776
+ ""
1777
+ ],
1778
+ [
1779
+ "set",
1780
+ "@entity.yMin",
1781
+ [
1782
+ "-",
1783
+ "@yMinRaw",
1784
+ "@yPad"
1785
+ ]
1786
+ ],
1787
+ [
1788
+ "set",
1789
+ "@entity.yMax",
1790
+ [
1791
+ "+",
1792
+ "@yMaxRaw",
1793
+ "@yPad"
1794
+ ]
1795
+ ],
1796
+ [
1797
+ "set",
1798
+ "@entity.curves",
1799
+ [
1800
+ {
1801
+ "color": "@config.targetColor",
1802
+ "label": "@config.targetLabel",
1803
+ "samples": "@targetSamples"
1804
+ },
1805
+ {
1806
+ "color": "@config.learnerColor",
1807
+ "label": "@config.learnerLabel",
1808
+ "samples": "@samples"
1809
+ }
1810
+ ]
1811
+ ]
1812
+ ]
1813
+ ],
1814
+ [
1815
+ "set",
1816
+ "@entity.resultRow",
1817
+ [
1818
+ "array/concat",
1819
+ [
1820
+ "if",
1821
+ "@entity.solved",
1822
+ [
1823
+ {
1824
+ "label": "Solved",
1825
+ "type": "badge",
1826
+ "variant": "success"
1827
+ }
1828
+ ],
1829
+ []
1830
+ ],
1831
+ [
1832
+ {
1833
+ "content": "@entity.feedback",
1834
+ "type": "typography",
1835
+ "variant": "caption"
1836
+ }
1837
+ ]
1838
+ ]
1839
+ ],
1840
+ [
1841
+ "render-ui",
1842
+ "main",
1843
+ {
1844
+ "children": [
1845
+ {
1846
+ "children": [
1847
+ {
1848
+ "content": "@entity.title",
1849
+ "type": "typography",
1850
+ "variant": "h4"
1851
+ },
1852
+ {
1853
+ "content": "@config.goalText",
1854
+ "type": "typography",
1855
+ "variant": "body"
1856
+ },
1857
+ {
1858
+ "children": [
1859
+ {
1860
+ "content": [
1861
+ "str/concat",
1862
+ "@entity.paramALabel",
1863
+ ": ",
1864
+ [
1865
+ "math/round",
1866
+ "@entity.paramA",
1867
+ 2.0
1868
+ ]
1869
+ ],
1870
+ "type": "typography",
1871
+ "variant": "caption"
1872
+ },
1873
+ {
1874
+ "action": "SET_PARAM_A",
1875
+ "max": "@config.paramAMax",
1876
+ "min": "@config.paramAMin",
1877
+ "showTooltip": true,
1878
+ "step": "@config.paramAStep",
1879
+ "type": "range-slider",
1880
+ "value": "@entity.paramA"
1881
+ }
1882
+ ],
1883
+ "direction": "vertical",
1884
+ "gap": "xs",
1885
+ "type": "stack"
1886
+ },
1887
+ {
1888
+ "children": [
1889
+ {
1890
+ "content": [
1891
+ "str/concat",
1892
+ "@entity.paramBLabel",
1893
+ ": ",
1894
+ [
1895
+ "math/round",
1896
+ "@entity.paramB",
1897
+ 2.0
1898
+ ]
1899
+ ],
1900
+ "type": "typography",
1901
+ "variant": "caption"
1902
+ },
1903
+ {
1904
+ "action": "SET_PARAM_B",
1905
+ "max": "@config.paramBMax",
1906
+ "min": "@config.paramBMin",
1907
+ "showTooltip": true,
1908
+ "step": "@config.paramBStep",
1909
+ "type": "range-slider",
1910
+ "value": "@entity.paramB"
1911
+ }
1912
+ ],
1913
+ "direction": "vertical",
1914
+ "gap": "xs",
1915
+ "type": "stack"
1916
+ },
1917
+ {
1918
+ "animate": false,
1919
+ "curves": "@entity.curves",
1920
+ "gridStep": "@config.gridStep",
1921
+ "height": "@config.height",
1922
+ "interactive": false,
1923
+ "points": [],
1924
+ "shapes": [],
1925
+ "showAxes": "@config.showAxes",
1926
+ "showGrid": "@config.showGrid",
1927
+ "title": "",
1928
+ "type": "math-canvas",
1929
+ "vectors": [],
1930
+ "width": "@config.width",
1931
+ "xMax": "@config.xMax",
1932
+ "xMin": "@config.xMin",
1933
+ "yMax": "@entity.yMax",
1934
+ "yMin": "@entity.yMin"
1935
+ },
1936
+ {
1937
+ "content": [
1938
+ "if",
1939
+ "@config.showLiveDistance",
1940
+ [
1941
+ "str/concat",
1942
+ "Distance from target: ",
1943
+ [
1944
+ "math/round",
1945
+ "@entity.distance",
1946
+ 3.0
1947
+ ],
1948
+ " · attempts: ",
1949
+ [
1950
+ "str/concat",
1951
+ "",
1952
+ "@entity.attempts"
1953
+ ]
1954
+ ],
1955
+ [
1956
+ "str/concat",
1957
+ "Attempts: ",
1958
+ [
1959
+ "str/concat",
1960
+ "",
1961
+ "@entity.attempts"
1962
+ ]
1963
+ ]
1964
+ ],
1965
+ "type": "typography",
1966
+ "variant": "body"
1967
+ },
1968
+ {
1969
+ "children": [
1970
+ {
1971
+ "action": "CHECK",
1972
+ "disabled": [
1973
+ "if",
1974
+ "@entity.solved",
1975
+ true,
1976
+ false
1977
+ ],
1978
+ "label": "@config.checkLabel",
1979
+ "type": "button",
1980
+ "variant": "primary"
1981
+ },
1982
+ {
1983
+ "action": "RESET",
1984
+ "label": "Reset",
1985
+ "type": "button",
1986
+ "variant": "ghost"
1987
+ }
1988
+ ],
1989
+ "direction": "horizontal",
1990
+ "gap": "sm",
1991
+ "type": "stack"
1992
+ },
1993
+ {
1994
+ "children": "@entity.resultRow",
1995
+ "direction": "horizontal",
1996
+ "gap": "xs",
1997
+ "type": "stack"
1998
+ }
1999
+ ],
2000
+ "direction": "vertical",
2001
+ "gap": "md",
2002
+ "type": "stack"
2003
+ }
2004
+ ],
2005
+ "padding": "md",
2006
+ "type": "box"
2007
+ }
2008
+ ]
2009
+ ],
2010
+ "event": "MODE_SELECTED",
2011
+ "eventId": "evt_01M07580W5HD3M1WG88XEPW7CQ",
2012
+ "from": "idle",
2013
+ "guard": [
2014
+ "==",
2015
+ "@payload.mode",
2016
+ "@config.matchMode"
2017
+ ],
2018
+ "to": "idle"
2019
+ },
2020
+ {
2021
+ "effects": [
2022
+ [
2023
+ "let",
2024
+ [
2025
+ [
2026
+ "A",
2027
+ [
2028
+ "math/clamp",
2029
+ "@payload.value",
2030
+ "@config.paramAMin",
2031
+ "@config.paramAMax"
2032
+ ]
2033
+ ],
2034
+ [
2035
+ "B",
2036
+ "@entity.paramB"
2037
+ ],
2038
+ [
2039
+ "kind",
2040
+ "@entity.curveKind"
2041
+ ],
2042
+ [
2043
+ "span",
2044
+ [
2045
+ "-",
2046
+ "@config.xMax",
2047
+ "@config.xMin"
2048
+ ]
2049
+ ],
2050
+ [
2051
+ "samples",
2052
+ [
2053
+ "array/map",
2054
+ [
2055
+ "array/range",
2056
+ 0.0,
2057
+ 81.0
2058
+ ],
2059
+ [
2060
+ "fn",
2061
+ [
2062
+ "i"
2063
+ ],
2064
+ [
2065
+ "let",
2066
+ [
2067
+ [
2068
+ "x",
2069
+ [
2070
+ "+",
2071
+ "@config.xMin",
2072
+ [
2073
+ "*",
2074
+ "@i",
2075
+ [
2076
+ "/",
2077
+ "@span",
2078
+ 80.0
2079
+ ]
2080
+ ]
2081
+ ]
2082
+ ],
2083
+ [
2084
+ "yVal",
2085
+ [
2086
+ "if",
2087
+ [
2088
+ "==",
2089
+ "@kind",
2090
+ "power"
2091
+ ],
2092
+ [
2093
+ "*",
2094
+ "@A",
2095
+ [
2096
+ "math/pow",
2097
+ "@x",
2098
+ "@B"
2099
+ ]
2100
+ ],
2101
+ [
2102
+ "if",
2103
+ [
2104
+ "==",
2105
+ "@kind",
2106
+ "linear"
2107
+ ],
2108
+ [
2109
+ "+",
2110
+ "@A",
2111
+ [
2112
+ "*",
2113
+ "@B",
2114
+ "@x"
2115
+ ]
2116
+ ],
2117
+ [
2118
+ "*",
2119
+ "@A",
2120
+ [
2121
+ "math/sin",
2122
+ [
2123
+ "*",
2124
+ "@B",
2125
+ "@x"
2126
+ ]
2127
+ ]
2128
+ ]
2129
+ ]
2130
+ ]
2131
+ ]
2132
+ ],
2133
+ {
2134
+ "x": "@x",
2135
+ "y": "@yVal"
2136
+ }
2137
+ ]
2138
+ ]
2139
+ ]
2140
+ ],
2141
+ [
2142
+ "dist",
2143
+ [
2144
+ "math/sqrt",
2145
+ [
2146
+ "/",
2147
+ [
2148
+ "array/sum",
2149
+ [
2150
+ "array/map",
2151
+ [
2152
+ "array/range",
2153
+ 0.0,
2154
+ 81.0
2155
+ ],
2156
+ [
2157
+ "fn",
2158
+ [
2159
+ "i"
2160
+ ],
2161
+ [
2162
+ "let",
2163
+ [
2164
+ [
2165
+ "dY",
2166
+ [
2167
+ "-",
2168
+ [
2169
+ "object/get",
2170
+ [
2171
+ "array/nth",
2172
+ "@samples",
2173
+ "@i"
2174
+ ],
2175
+ "y"
2176
+ ],
2177
+ [
2178
+ "object/get",
2179
+ [
2180
+ "array/nth",
2181
+ "@entity.targetSamples",
2182
+ "@i"
2183
+ ],
2184
+ "y"
2185
+ ]
2186
+ ]
2187
+ ]
2188
+ ],
2189
+ [
2190
+ "*",
2191
+ "@dY",
2192
+ "@dY"
2193
+ ]
2194
+ ]
2195
+ ]
2196
+ ]
2197
+ ],
2198
+ 81.0
2199
+ ]
2200
+ ]
2201
+ ],
2202
+ [
2203
+ "allSamples",
2204
+ [
2205
+ "array/concat",
2206
+ "@samples",
2207
+ "@entity.targetSamples"
2208
+ ]
2209
+ ],
2210
+ [
2211
+ "yMinRaw",
2212
+ [
2213
+ "array/reduce",
2214
+ "@allSamples",
2215
+ [
2216
+ "object/get",
2217
+ [
2218
+ "array/nth",
2219
+ "@allSamples",
2220
+ 0.0
2221
+ ],
2222
+ "y"
2223
+ ],
2224
+ [
2225
+ "fn",
2226
+ [
2227
+ "acc",
2228
+ "s"
2229
+ ],
2230
+ [
2231
+ "math/min",
2232
+ "@acc",
2233
+ [
2234
+ "object/get",
2235
+ "@s",
2236
+ "y"
2237
+ ]
2238
+ ]
2239
+ ]
2240
+ ]
2241
+ ],
2242
+ [
2243
+ "yMaxRaw",
2244
+ [
2245
+ "array/reduce",
2246
+ "@allSamples",
2247
+ [
2248
+ "object/get",
2249
+ [
2250
+ "array/nth",
2251
+ "@allSamples",
2252
+ 0.0
2253
+ ],
2254
+ "y"
2255
+ ],
2256
+ [
2257
+ "fn",
2258
+ [
2259
+ "acc",
2260
+ "s"
2261
+ ],
2262
+ [
2263
+ "math/max",
2264
+ "@acc",
2265
+ [
2266
+ "object/get",
2267
+ "@s",
2268
+ "y"
2269
+ ]
2270
+ ]
2271
+ ]
2272
+ ]
2273
+ ],
2274
+ [
2275
+ "yPad",
2276
+ [
2277
+ "*",
2278
+ 0.1,
2279
+ [
2280
+ "math/max",
2281
+ 0.001,
2282
+ [
2283
+ "-",
2284
+ "@yMaxRaw",
2285
+ "@yMinRaw"
2286
+ ]
2287
+ ]
2288
+ ]
2289
+ ]
2290
+ ],
2291
+ [
2292
+ "do",
2293
+ [
2294
+ "set",
2295
+ "@entity.paramA",
2296
+ "@A"
2297
+ ],
2298
+ [
2299
+ "set",
2300
+ "@entity.distance",
2301
+ "@dist"
2302
+ ],
2303
+ [
2304
+ "set",
2305
+ "@entity.yMin",
2306
+ [
2307
+ "-",
2308
+ "@yMinRaw",
2309
+ "@yPad"
2310
+ ]
2311
+ ],
2312
+ [
2313
+ "set",
2314
+ "@entity.yMax",
2315
+ [
2316
+ "+",
2317
+ "@yMaxRaw",
2318
+ "@yPad"
2319
+ ]
2320
+ ],
2321
+ [
2322
+ "set",
2323
+ "@entity.curves",
2324
+ [
2325
+ {
2326
+ "color": "@config.targetColor",
2327
+ "label": "@config.targetLabel",
2328
+ "samples": "@entity.targetSamples"
2329
+ },
2330
+ {
2331
+ "color": "@config.learnerColor",
2332
+ "label": "@config.learnerLabel",
2333
+ "samples": "@samples"
2334
+ }
2335
+ ]
2336
+ ]
2337
+ ]
2338
+ ],
2339
+ [
2340
+ "set",
2341
+ "@entity.resultRow",
2342
+ [
2343
+ "array/concat",
2344
+ [
2345
+ "if",
2346
+ "@entity.solved",
2347
+ [
2348
+ {
2349
+ "label": "Solved",
2350
+ "type": "badge",
2351
+ "variant": "success"
2352
+ }
2353
+ ],
2354
+ []
2355
+ ],
2356
+ [
2357
+ {
2358
+ "content": "@entity.feedback",
2359
+ "type": "typography",
2360
+ "variant": "caption"
2361
+ }
2362
+ ]
2363
+ ]
2364
+ ],
2365
+ [
2366
+ "render-ui",
2367
+ "main",
2368
+ {
2369
+ "children": [
2370
+ {
2371
+ "children": [
2372
+ {
2373
+ "content": "@entity.title",
2374
+ "type": "typography",
2375
+ "variant": "h4"
2376
+ },
2377
+ {
2378
+ "content": "@config.goalText",
2379
+ "type": "typography",
2380
+ "variant": "body"
2381
+ },
2382
+ {
2383
+ "children": [
2384
+ {
2385
+ "content": [
2386
+ "str/concat",
2387
+ "@entity.paramALabel",
2388
+ ": ",
2389
+ [
2390
+ "math/round",
2391
+ "@entity.paramA",
2392
+ 2.0
2393
+ ]
2394
+ ],
2395
+ "type": "typography",
2396
+ "variant": "caption"
2397
+ },
2398
+ {
2399
+ "action": "SET_PARAM_A",
2400
+ "max": "@config.paramAMax",
2401
+ "min": "@config.paramAMin",
2402
+ "showTooltip": true,
2403
+ "step": "@config.paramAStep",
2404
+ "type": "range-slider",
2405
+ "value": "@entity.paramA"
2406
+ }
2407
+ ],
2408
+ "direction": "vertical",
2409
+ "gap": "xs",
2410
+ "type": "stack"
2411
+ },
2412
+ {
2413
+ "children": [
2414
+ {
2415
+ "content": [
2416
+ "str/concat",
2417
+ "@entity.paramBLabel",
2418
+ ": ",
2419
+ [
2420
+ "math/round",
2421
+ "@entity.paramB",
2422
+ 2.0
2423
+ ]
2424
+ ],
2425
+ "type": "typography",
2426
+ "variant": "caption"
2427
+ },
2428
+ {
2429
+ "action": "SET_PARAM_B",
2430
+ "max": "@config.paramBMax",
2431
+ "min": "@config.paramBMin",
2432
+ "showTooltip": true,
2433
+ "step": "@config.paramBStep",
2434
+ "type": "range-slider",
2435
+ "value": "@entity.paramB"
2436
+ }
2437
+ ],
2438
+ "direction": "vertical",
2439
+ "gap": "xs",
2440
+ "type": "stack"
2441
+ },
2442
+ {
2443
+ "animate": false,
2444
+ "curves": "@entity.curves",
2445
+ "gridStep": "@config.gridStep",
2446
+ "height": "@config.height",
2447
+ "interactive": false,
2448
+ "points": [],
2449
+ "shapes": [],
2450
+ "showAxes": "@config.showAxes",
2451
+ "showGrid": "@config.showGrid",
2452
+ "title": "",
2453
+ "type": "math-canvas",
2454
+ "vectors": [],
2455
+ "width": "@config.width",
2456
+ "xMax": "@config.xMax",
2457
+ "xMin": "@config.xMin",
2458
+ "yMax": "@entity.yMax",
2459
+ "yMin": "@entity.yMin"
2460
+ },
2461
+ {
2462
+ "content": [
2463
+ "if",
2464
+ "@config.showLiveDistance",
2465
+ [
2466
+ "str/concat",
2467
+ "Distance from target: ",
2468
+ [
2469
+ "math/round",
2470
+ "@entity.distance",
2471
+ 3.0
2472
+ ],
2473
+ " · attempts: ",
2474
+ [
2475
+ "str/concat",
2476
+ "",
2477
+ "@entity.attempts"
2478
+ ]
2479
+ ],
2480
+ [
2481
+ "str/concat",
2482
+ "Attempts: ",
2483
+ [
2484
+ "str/concat",
2485
+ "",
2486
+ "@entity.attempts"
2487
+ ]
2488
+ ]
2489
+ ],
2490
+ "type": "typography",
2491
+ "variant": "body"
2492
+ },
2493
+ {
2494
+ "children": [
2495
+ {
2496
+ "action": "CHECK",
2497
+ "disabled": [
2498
+ "if",
2499
+ "@entity.solved",
2500
+ true,
2501
+ false
2502
+ ],
2503
+ "label": "@config.checkLabel",
2504
+ "type": "button",
2505
+ "variant": "primary"
2506
+ },
2507
+ {
2508
+ "action": "RESET",
2509
+ "label": "Reset",
2510
+ "type": "button",
2511
+ "variant": "ghost"
2512
+ }
2513
+ ],
2514
+ "direction": "horizontal",
2515
+ "gap": "sm",
2516
+ "type": "stack"
2517
+ },
2518
+ {
2519
+ "children": "@entity.resultRow",
2520
+ "direction": "horizontal",
2521
+ "gap": "xs",
2522
+ "type": "stack"
2523
+ }
2524
+ ],
2525
+ "direction": "vertical",
2526
+ "gap": "md",
2527
+ "type": "stack"
2528
+ }
2529
+ ],
2530
+ "padding": "md",
2531
+ "type": "box"
2532
+ }
2533
+ ],
2534
+ [
2535
+ "emit",
2536
+ "PARAMS_CHANGED",
2537
+ {
2538
+ "distance": "@entity.distance",
2539
+ "paramA": "@entity.paramA",
2540
+ "paramB": "@entity.paramB"
2541
+ }
2542
+ ]
2543
+ ],
2544
+ "event": "SET_PARAM_A",
2545
+ "eventId": "evt_01M07580W5F7ACE7Z9TSS3G2W0",
2546
+ "from": "idle",
2547
+ "guard": [
2548
+ "and",
2549
+ [
2550
+ "==",
2551
+ "@entity.active",
2552
+ true
2553
+ ],
2554
+ [
2555
+ "==",
2556
+ "@entity.solved",
2557
+ false
2558
+ ]
2559
+ ],
2560
+ "to": "idle"
2561
+ },
2562
+ {
2563
+ "effects": [
2564
+ [
2565
+ "let",
2566
+ [
2567
+ [
2568
+ "A",
2569
+ "@entity.paramA"
2570
+ ],
2571
+ [
2572
+ "B",
2573
+ [
2574
+ "math/clamp",
2575
+ "@payload.value",
2576
+ "@config.paramBMin",
2577
+ "@config.paramBMax"
2578
+ ]
2579
+ ],
2580
+ [
2581
+ "kind",
2582
+ "@entity.curveKind"
2583
+ ],
2584
+ [
2585
+ "span",
2586
+ [
2587
+ "-",
2588
+ "@config.xMax",
2589
+ "@config.xMin"
2590
+ ]
2591
+ ],
2592
+ [
2593
+ "samples",
2594
+ [
2595
+ "array/map",
2596
+ [
2597
+ "array/range",
2598
+ 0.0,
2599
+ 81.0
2600
+ ],
2601
+ [
2602
+ "fn",
2603
+ [
2604
+ "i"
2605
+ ],
2606
+ [
2607
+ "let",
2608
+ [
2609
+ [
2610
+ "x",
2611
+ [
2612
+ "+",
2613
+ "@config.xMin",
2614
+ [
2615
+ "*",
2616
+ "@i",
2617
+ [
2618
+ "/",
2619
+ "@span",
2620
+ 80.0
2621
+ ]
2622
+ ]
2623
+ ]
2624
+ ],
2625
+ [
2626
+ "yVal",
2627
+ [
2628
+ "if",
2629
+ [
2630
+ "==",
2631
+ "@kind",
2632
+ "power"
2633
+ ],
2634
+ [
2635
+ "*",
2636
+ "@A",
2637
+ [
2638
+ "math/pow",
2639
+ "@x",
2640
+ "@B"
2641
+ ]
2642
+ ],
2643
+ [
2644
+ "if",
2645
+ [
2646
+ "==",
2647
+ "@kind",
2648
+ "linear"
2649
+ ],
2650
+ [
2651
+ "+",
2652
+ "@A",
2653
+ [
2654
+ "*",
2655
+ "@B",
2656
+ "@x"
2657
+ ]
2658
+ ],
2659
+ [
2660
+ "*",
2661
+ "@A",
2662
+ [
2663
+ "math/sin",
2664
+ [
2665
+ "*",
2666
+ "@B",
2667
+ "@x"
2668
+ ]
2669
+ ]
2670
+ ]
2671
+ ]
2672
+ ]
2673
+ ]
2674
+ ],
2675
+ {
2676
+ "x": "@x",
2677
+ "y": "@yVal"
2678
+ }
2679
+ ]
2680
+ ]
2681
+ ]
2682
+ ],
2683
+ [
2684
+ "dist",
2685
+ [
2686
+ "math/sqrt",
2687
+ [
2688
+ "/",
2689
+ [
2690
+ "array/sum",
2691
+ [
2692
+ "array/map",
2693
+ [
2694
+ "array/range",
2695
+ 0.0,
2696
+ 81.0
2697
+ ],
2698
+ [
2699
+ "fn",
2700
+ [
2701
+ "i"
2702
+ ],
2703
+ [
2704
+ "let",
2705
+ [
2706
+ [
2707
+ "dY",
2708
+ [
2709
+ "-",
2710
+ [
2711
+ "object/get",
2712
+ [
2713
+ "array/nth",
2714
+ "@samples",
2715
+ "@i"
2716
+ ],
2717
+ "y"
2718
+ ],
2719
+ [
2720
+ "object/get",
2721
+ [
2722
+ "array/nth",
2723
+ "@entity.targetSamples",
2724
+ "@i"
2725
+ ],
2726
+ "y"
2727
+ ]
2728
+ ]
2729
+ ]
2730
+ ],
2731
+ [
2732
+ "*",
2733
+ "@dY",
2734
+ "@dY"
2735
+ ]
2736
+ ]
2737
+ ]
2738
+ ]
2739
+ ],
2740
+ 81.0
2741
+ ]
2742
+ ]
2743
+ ],
2744
+ [
2745
+ "allSamples",
2746
+ [
2747
+ "array/concat",
2748
+ "@samples",
2749
+ "@entity.targetSamples"
2750
+ ]
2751
+ ],
2752
+ [
2753
+ "yMinRaw",
2754
+ [
2755
+ "array/reduce",
2756
+ "@allSamples",
2757
+ [
2758
+ "object/get",
2759
+ [
2760
+ "array/nth",
2761
+ "@allSamples",
2762
+ 0.0
2763
+ ],
2764
+ "y"
2765
+ ],
2766
+ [
2767
+ "fn",
2768
+ [
2769
+ "acc",
2770
+ "s"
2771
+ ],
2772
+ [
2773
+ "math/min",
2774
+ "@acc",
2775
+ [
2776
+ "object/get",
2777
+ "@s",
2778
+ "y"
2779
+ ]
2780
+ ]
2781
+ ]
2782
+ ]
2783
+ ],
2784
+ [
2785
+ "yMaxRaw",
2786
+ [
2787
+ "array/reduce",
2788
+ "@allSamples",
2789
+ [
2790
+ "object/get",
2791
+ [
2792
+ "array/nth",
2793
+ "@allSamples",
2794
+ 0.0
2795
+ ],
2796
+ "y"
2797
+ ],
2798
+ [
2799
+ "fn",
2800
+ [
2801
+ "acc",
2802
+ "s"
2803
+ ],
2804
+ [
2805
+ "math/max",
2806
+ "@acc",
2807
+ [
2808
+ "object/get",
2809
+ "@s",
2810
+ "y"
2811
+ ]
2812
+ ]
2813
+ ]
2814
+ ]
2815
+ ],
2816
+ [
2817
+ "yPad",
2818
+ [
2819
+ "*",
2820
+ 0.1,
2821
+ [
2822
+ "math/max",
2823
+ 0.001,
2824
+ [
2825
+ "-",
2826
+ "@yMaxRaw",
2827
+ "@yMinRaw"
2828
+ ]
2829
+ ]
2830
+ ]
2831
+ ]
2832
+ ],
2833
+ [
2834
+ "do",
2835
+ [
2836
+ "set",
2837
+ "@entity.paramB",
2838
+ "@B"
2839
+ ],
2840
+ [
2841
+ "set",
2842
+ "@entity.distance",
2843
+ "@dist"
2844
+ ],
2845
+ [
2846
+ "set",
2847
+ "@entity.yMin",
2848
+ [
2849
+ "-",
2850
+ "@yMinRaw",
2851
+ "@yPad"
2852
+ ]
2853
+ ],
2854
+ [
2855
+ "set",
2856
+ "@entity.yMax",
2857
+ [
2858
+ "+",
2859
+ "@yMaxRaw",
2860
+ "@yPad"
2861
+ ]
2862
+ ],
2863
+ [
2864
+ "set",
2865
+ "@entity.curves",
2866
+ [
2867
+ {
2868
+ "color": "@config.targetColor",
2869
+ "label": "@config.targetLabel",
2870
+ "samples": "@entity.targetSamples"
2871
+ },
2872
+ {
2873
+ "color": "@config.learnerColor",
2874
+ "label": "@config.learnerLabel",
2875
+ "samples": "@samples"
2876
+ }
2877
+ ]
2878
+ ]
2879
+ ]
2880
+ ],
2881
+ [
2882
+ "set",
2883
+ "@entity.resultRow",
2884
+ [
2885
+ "array/concat",
2886
+ [
2887
+ "if",
2888
+ "@entity.solved",
2889
+ [
2890
+ {
2891
+ "label": "Solved",
2892
+ "type": "badge",
2893
+ "variant": "success"
2894
+ }
2895
+ ],
2896
+ []
2897
+ ],
2898
+ [
2899
+ {
2900
+ "content": "@entity.feedback",
2901
+ "type": "typography",
2902
+ "variant": "caption"
2903
+ }
2904
+ ]
2905
+ ]
2906
+ ],
2907
+ [
2908
+ "render-ui",
2909
+ "main",
2910
+ {
2911
+ "children": [
2912
+ {
2913
+ "children": [
2914
+ {
2915
+ "content": "@entity.title",
2916
+ "type": "typography",
2917
+ "variant": "h4"
2918
+ },
2919
+ {
2920
+ "content": "@config.goalText",
2921
+ "type": "typography",
2922
+ "variant": "body"
2923
+ },
2924
+ {
2925
+ "children": [
2926
+ {
2927
+ "content": [
2928
+ "str/concat",
2929
+ "@entity.paramALabel",
2930
+ ": ",
2931
+ [
2932
+ "math/round",
2933
+ "@entity.paramA",
2934
+ 2.0
2935
+ ]
2936
+ ],
2937
+ "type": "typography",
2938
+ "variant": "caption"
2939
+ },
2940
+ {
2941
+ "action": "SET_PARAM_A",
2942
+ "max": "@config.paramAMax",
2943
+ "min": "@config.paramAMin",
2944
+ "showTooltip": true,
2945
+ "step": "@config.paramAStep",
2946
+ "type": "range-slider",
2947
+ "value": "@entity.paramA"
2948
+ }
2949
+ ],
2950
+ "direction": "vertical",
2951
+ "gap": "xs",
2952
+ "type": "stack"
2953
+ },
2954
+ {
2955
+ "children": [
2956
+ {
2957
+ "content": [
2958
+ "str/concat",
2959
+ "@entity.paramBLabel",
2960
+ ": ",
2961
+ [
2962
+ "math/round",
2963
+ "@entity.paramB",
2964
+ 2.0
2965
+ ]
2966
+ ],
2967
+ "type": "typography",
2968
+ "variant": "caption"
2969
+ },
2970
+ {
2971
+ "action": "SET_PARAM_B",
2972
+ "max": "@config.paramBMax",
2973
+ "min": "@config.paramBMin",
2974
+ "showTooltip": true,
2975
+ "step": "@config.paramBStep",
2976
+ "type": "range-slider",
2977
+ "value": "@entity.paramB"
2978
+ }
2979
+ ],
2980
+ "direction": "vertical",
2981
+ "gap": "xs",
2982
+ "type": "stack"
2983
+ },
2984
+ {
2985
+ "animate": false,
2986
+ "curves": "@entity.curves",
2987
+ "gridStep": "@config.gridStep",
2988
+ "height": "@config.height",
2989
+ "interactive": false,
2990
+ "points": [],
2991
+ "shapes": [],
2992
+ "showAxes": "@config.showAxes",
2993
+ "showGrid": "@config.showGrid",
2994
+ "title": "",
2995
+ "type": "math-canvas",
2996
+ "vectors": [],
2997
+ "width": "@config.width",
2998
+ "xMax": "@config.xMax",
2999
+ "xMin": "@config.xMin",
3000
+ "yMax": "@entity.yMax",
3001
+ "yMin": "@entity.yMin"
3002
+ },
3003
+ {
3004
+ "content": [
3005
+ "if",
3006
+ "@config.showLiveDistance",
3007
+ [
3008
+ "str/concat",
3009
+ "Distance from target: ",
3010
+ [
3011
+ "math/round",
3012
+ "@entity.distance",
3013
+ 3.0
3014
+ ],
3015
+ " · attempts: ",
3016
+ [
3017
+ "str/concat",
3018
+ "",
3019
+ "@entity.attempts"
3020
+ ]
3021
+ ],
3022
+ [
3023
+ "str/concat",
3024
+ "Attempts: ",
3025
+ [
3026
+ "str/concat",
3027
+ "",
3028
+ "@entity.attempts"
3029
+ ]
3030
+ ]
3031
+ ],
3032
+ "type": "typography",
3033
+ "variant": "body"
3034
+ },
3035
+ {
3036
+ "children": [
3037
+ {
3038
+ "action": "CHECK",
3039
+ "disabled": [
3040
+ "if",
3041
+ "@entity.solved",
3042
+ true,
3043
+ false
3044
+ ],
3045
+ "label": "@config.checkLabel",
3046
+ "type": "button",
3047
+ "variant": "primary"
3048
+ },
3049
+ {
3050
+ "action": "RESET",
3051
+ "label": "Reset",
3052
+ "type": "button",
3053
+ "variant": "ghost"
3054
+ }
3055
+ ],
3056
+ "direction": "horizontal",
3057
+ "gap": "sm",
3058
+ "type": "stack"
3059
+ },
3060
+ {
3061
+ "children": "@entity.resultRow",
3062
+ "direction": "horizontal",
3063
+ "gap": "xs",
3064
+ "type": "stack"
3065
+ }
3066
+ ],
3067
+ "direction": "vertical",
3068
+ "gap": "md",
3069
+ "type": "stack"
3070
+ }
3071
+ ],
3072
+ "padding": "md",
3073
+ "type": "box"
3074
+ }
3075
+ ],
3076
+ [
3077
+ "emit",
3078
+ "PARAMS_CHANGED",
3079
+ {
3080
+ "distance": "@entity.distance",
3081
+ "paramA": "@entity.paramA",
3082
+ "paramB": "@entity.paramB"
3083
+ }
3084
+ ]
3085
+ ],
3086
+ "event": "SET_PARAM_B",
3087
+ "eventId": "evt_01M07580W5HCGHVRXPXBBHT7JH",
3088
+ "from": "idle",
3089
+ "guard": [
3090
+ "and",
3091
+ [
3092
+ "==",
3093
+ "@entity.active",
3094
+ true
3095
+ ],
3096
+ [
3097
+ "==",
3098
+ "@entity.solved",
3099
+ false
3100
+ ]
3101
+ ],
3102
+ "to": "idle"
3103
+ },
3104
+ {
3105
+ "effects": [
3106
+ [
3107
+ "set",
3108
+ "@entity.attempts",
3109
+ [
3110
+ "+",
3111
+ "@entity.attempts",
3112
+ 1.0
3113
+ ]
3114
+ ],
3115
+ [
3116
+ "set",
3117
+ "@entity.solved",
3118
+ [
3119
+ "if",
3120
+ [
3121
+ "<=",
3122
+ "@entity.distance",
3123
+ "@config.tolerance"
3124
+ ],
3125
+ true,
3126
+ false
3127
+ ]
3128
+ ],
3129
+ [
3130
+ "set",
3131
+ "@entity.feedback",
3132
+ [
3133
+ "if",
3134
+ [
3135
+ "<=",
3136
+ "@entity.distance",
3137
+ "@config.tolerance"
3138
+ ],
3139
+ [
3140
+ "str/concat",
3141
+ "Matched! Distance ",
3142
+ [
3143
+ "math/round",
3144
+ "@entity.distance",
3145
+ 3.0
3146
+ ],
3147
+ " is within tolerance ",
3148
+ [
3149
+ "math/round",
3150
+ "@config.tolerance",
3151
+ 3.0
3152
+ ],
3153
+ "."
3154
+ ],
3155
+ [
3156
+ "str/concat",
3157
+ "Not yet — distance ",
3158
+ [
3159
+ "math/round",
3160
+ "@entity.distance",
3161
+ 3.0
3162
+ ],
3163
+ " is above tolerance ",
3164
+ [
3165
+ "math/round",
3166
+ "@config.tolerance",
3167
+ 3.0
3168
+ ],
3169
+ ". Keep tuning."
3170
+ ]
3171
+ ]
3172
+ ],
3173
+ [
3174
+ "set",
3175
+ "@entity.resultRow",
3176
+ [
3177
+ "array/concat",
3178
+ [
3179
+ "if",
3180
+ "@entity.solved",
3181
+ [
3182
+ {
3183
+ "label": "Solved",
3184
+ "type": "badge",
3185
+ "variant": "success"
3186
+ }
3187
+ ],
3188
+ []
3189
+ ],
3190
+ [
3191
+ {
3192
+ "content": "@entity.feedback",
3193
+ "type": "typography",
3194
+ "variant": "caption"
3195
+ }
3196
+ ]
3197
+ ]
3198
+ ],
3199
+ [
3200
+ "render-ui",
3201
+ "main",
3202
+ {
3203
+ "children": [
3204
+ {
3205
+ "children": [
3206
+ {
3207
+ "content": "@entity.title",
3208
+ "type": "typography",
3209
+ "variant": "h4"
3210
+ },
3211
+ {
3212
+ "content": "@config.goalText",
3213
+ "type": "typography",
3214
+ "variant": "body"
3215
+ },
3216
+ {
3217
+ "children": [
3218
+ {
3219
+ "content": [
3220
+ "str/concat",
3221
+ "@entity.paramALabel",
3222
+ ": ",
3223
+ [
3224
+ "math/round",
3225
+ "@entity.paramA",
3226
+ 2.0
3227
+ ]
3228
+ ],
3229
+ "type": "typography",
3230
+ "variant": "caption"
3231
+ },
3232
+ {
3233
+ "action": "SET_PARAM_A",
3234
+ "max": "@config.paramAMax",
3235
+ "min": "@config.paramAMin",
3236
+ "showTooltip": true,
3237
+ "step": "@config.paramAStep",
3238
+ "type": "range-slider",
3239
+ "value": "@entity.paramA"
3240
+ }
3241
+ ],
3242
+ "direction": "vertical",
3243
+ "gap": "xs",
3244
+ "type": "stack"
3245
+ },
3246
+ {
3247
+ "children": [
3248
+ {
3249
+ "content": [
3250
+ "str/concat",
3251
+ "@entity.paramBLabel",
3252
+ ": ",
3253
+ [
3254
+ "math/round",
3255
+ "@entity.paramB",
3256
+ 2.0
3257
+ ]
3258
+ ],
3259
+ "type": "typography",
3260
+ "variant": "caption"
3261
+ },
3262
+ {
3263
+ "action": "SET_PARAM_B",
3264
+ "max": "@config.paramBMax",
3265
+ "min": "@config.paramBMin",
3266
+ "showTooltip": true,
3267
+ "step": "@config.paramBStep",
3268
+ "type": "range-slider",
3269
+ "value": "@entity.paramB"
3270
+ }
3271
+ ],
3272
+ "direction": "vertical",
3273
+ "gap": "xs",
3274
+ "type": "stack"
3275
+ },
3276
+ {
3277
+ "animate": false,
3278
+ "curves": "@entity.curves",
3279
+ "gridStep": "@config.gridStep",
3280
+ "height": "@config.height",
3281
+ "interactive": false,
3282
+ "points": [],
3283
+ "shapes": [],
3284
+ "showAxes": "@config.showAxes",
3285
+ "showGrid": "@config.showGrid",
3286
+ "title": "",
3287
+ "type": "math-canvas",
3288
+ "vectors": [],
3289
+ "width": "@config.width",
3290
+ "xMax": "@config.xMax",
3291
+ "xMin": "@config.xMin",
3292
+ "yMax": "@entity.yMax",
3293
+ "yMin": "@entity.yMin"
3294
+ },
3295
+ {
3296
+ "content": [
3297
+ "if",
3298
+ "@config.showLiveDistance",
3299
+ [
3300
+ "str/concat",
3301
+ "Distance from target: ",
3302
+ [
3303
+ "math/round",
3304
+ "@entity.distance",
3305
+ 3.0
3306
+ ],
3307
+ " · attempts: ",
3308
+ [
3309
+ "str/concat",
3310
+ "",
3311
+ "@entity.attempts"
3312
+ ]
3313
+ ],
3314
+ [
3315
+ "str/concat",
3316
+ "Attempts: ",
3317
+ [
3318
+ "str/concat",
3319
+ "",
3320
+ "@entity.attempts"
3321
+ ]
3322
+ ]
3323
+ ],
3324
+ "type": "typography",
3325
+ "variant": "body"
3326
+ },
3327
+ {
3328
+ "children": [
3329
+ {
3330
+ "action": "CHECK",
3331
+ "disabled": [
3332
+ "if",
3333
+ "@entity.solved",
3334
+ true,
3335
+ false
3336
+ ],
3337
+ "label": "@config.checkLabel",
3338
+ "type": "button",
3339
+ "variant": "primary"
3340
+ },
3341
+ {
3342
+ "action": "RESET",
3343
+ "label": "Reset",
3344
+ "type": "button",
3345
+ "variant": "ghost"
3346
+ }
3347
+ ],
3348
+ "direction": "horizontal",
3349
+ "gap": "sm",
3350
+ "type": "stack"
3351
+ },
3352
+ {
3353
+ "children": "@entity.resultRow",
3354
+ "direction": "horizontal",
3355
+ "gap": "xs",
3356
+ "type": "stack"
3357
+ }
3358
+ ],
3359
+ "direction": "vertical",
3360
+ "gap": "md",
3361
+ "type": "stack"
3362
+ }
3363
+ ],
3364
+ "padding": "md",
3365
+ "type": "box"
3366
+ }
3367
+ ],
3368
+ [
3369
+ "emit",
3370
+ "GOAL_CHECKED",
3371
+ {
3372
+ "attempts": "@entity.attempts",
3373
+ "distance": "@entity.distance",
3374
+ "matched": "@entity.solved"
3375
+ }
3376
+ ]
3377
+ ],
3378
+ "event": "CHECK",
3379
+ "eventId": "evt_01M07580W5H3YN7CS9N5TXXD56",
3380
+ "from": "idle",
3381
+ "guard": [
3382
+ "and",
3383
+ [
3384
+ "==",
3385
+ "@entity.active",
3386
+ true
3387
+ ],
3388
+ [
3389
+ "==",
3390
+ "@entity.solved",
3391
+ false
3392
+ ]
3393
+ ],
3394
+ "to": "idle"
3395
+ },
3396
+ {
3397
+ "effects": [
3398
+ [
3399
+ "let",
3400
+ [
3401
+ [
3402
+ "A",
3403
+ "@config.paramADefault"
3404
+ ],
3405
+ [
3406
+ "B",
3407
+ "@config.paramBDefault"
3408
+ ],
3409
+ [
3410
+ "kind",
3411
+ "@entity.curveKind"
3412
+ ],
3413
+ [
3414
+ "span",
3415
+ [
3416
+ "-",
3417
+ "@config.xMax",
3418
+ "@config.xMin"
3419
+ ]
3420
+ ],
3421
+ [
3422
+ "samples",
3423
+ [
3424
+ "array/map",
3425
+ [
3426
+ "array/range",
3427
+ 0.0,
3428
+ 81.0
3429
+ ],
3430
+ [
3431
+ "fn",
3432
+ [
3433
+ "i"
3434
+ ],
3435
+ [
3436
+ "let",
3437
+ [
3438
+ [
3439
+ "x",
3440
+ [
3441
+ "+",
3442
+ "@config.xMin",
3443
+ [
3444
+ "*",
3445
+ "@i",
3446
+ [
3447
+ "/",
3448
+ "@span",
3449
+ 80.0
3450
+ ]
3451
+ ]
3452
+ ]
3453
+ ],
3454
+ [
3455
+ "yVal",
3456
+ [
3457
+ "if",
3458
+ [
3459
+ "==",
3460
+ "@kind",
3461
+ "power"
3462
+ ],
3463
+ [
3464
+ "*",
3465
+ "@A",
3466
+ [
3467
+ "math/pow",
3468
+ "@x",
3469
+ "@B"
3470
+ ]
3471
+ ],
3472
+ [
3473
+ "if",
3474
+ [
3475
+ "==",
3476
+ "@kind",
3477
+ "linear"
3478
+ ],
3479
+ [
3480
+ "+",
3481
+ "@A",
3482
+ [
3483
+ "*",
3484
+ "@B",
3485
+ "@x"
3486
+ ]
3487
+ ],
3488
+ [
3489
+ "*",
3490
+ "@A",
3491
+ [
3492
+ "math/sin",
3493
+ [
3494
+ "*",
3495
+ "@B",
3496
+ "@x"
3497
+ ]
3498
+ ]
3499
+ ]
3500
+ ]
3501
+ ]
3502
+ ]
3503
+ ],
3504
+ {
3505
+ "x": "@x",
3506
+ "y": "@yVal"
3507
+ }
3508
+ ]
3509
+ ]
3510
+ ]
3511
+ ],
3512
+ [
3513
+ "dist",
3514
+ [
3515
+ "math/sqrt",
3516
+ [
3517
+ "/",
3518
+ [
3519
+ "array/sum",
3520
+ [
3521
+ "array/map",
3522
+ [
3523
+ "array/range",
3524
+ 0.0,
3525
+ 81.0
3526
+ ],
3527
+ [
3528
+ "fn",
3529
+ [
3530
+ "i"
3531
+ ],
3532
+ [
3533
+ "let",
3534
+ [
3535
+ [
3536
+ "dY",
3537
+ [
3538
+ "-",
3539
+ [
3540
+ "object/get",
3541
+ [
3542
+ "array/nth",
3543
+ "@samples",
3544
+ "@i"
3545
+ ],
3546
+ "y"
3547
+ ],
3548
+ [
3549
+ "object/get",
3550
+ [
3551
+ "array/nth",
3552
+ "@entity.targetSamples",
3553
+ "@i"
3554
+ ],
3555
+ "y"
3556
+ ]
3557
+ ]
3558
+ ]
3559
+ ],
3560
+ [
3561
+ "*",
3562
+ "@dY",
3563
+ "@dY"
3564
+ ]
3565
+ ]
3566
+ ]
3567
+ ]
3568
+ ],
3569
+ 81.0
3570
+ ]
3571
+ ]
3572
+ ],
3573
+ [
3574
+ "allSamples",
3575
+ [
3576
+ "array/concat",
3577
+ "@samples",
3578
+ "@entity.targetSamples"
3579
+ ]
3580
+ ],
3581
+ [
3582
+ "yMinRaw",
3583
+ [
3584
+ "array/reduce",
3585
+ "@allSamples",
3586
+ [
3587
+ "object/get",
3588
+ [
3589
+ "array/nth",
3590
+ "@allSamples",
3591
+ 0.0
3592
+ ],
3593
+ "y"
3594
+ ],
3595
+ [
3596
+ "fn",
3597
+ [
3598
+ "acc",
3599
+ "s"
3600
+ ],
3601
+ [
3602
+ "math/min",
3603
+ "@acc",
3604
+ [
3605
+ "object/get",
3606
+ "@s",
3607
+ "y"
3608
+ ]
3609
+ ]
3610
+ ]
3611
+ ]
3612
+ ],
3613
+ [
3614
+ "yMaxRaw",
3615
+ [
3616
+ "array/reduce",
3617
+ "@allSamples",
3618
+ [
3619
+ "object/get",
3620
+ [
3621
+ "array/nth",
3622
+ "@allSamples",
3623
+ 0.0
3624
+ ],
3625
+ "y"
3626
+ ],
3627
+ [
3628
+ "fn",
3629
+ [
3630
+ "acc",
3631
+ "s"
3632
+ ],
3633
+ [
3634
+ "math/max",
3635
+ "@acc",
3636
+ [
3637
+ "object/get",
3638
+ "@s",
3639
+ "y"
3640
+ ]
3641
+ ]
3642
+ ]
3643
+ ]
3644
+ ],
3645
+ [
3646
+ "yPad",
3647
+ [
3648
+ "*",
3649
+ 0.1,
3650
+ [
3651
+ "math/max",
3652
+ 0.001,
3653
+ [
3654
+ "-",
3655
+ "@yMaxRaw",
3656
+ "@yMinRaw"
3657
+ ]
3658
+ ]
3659
+ ]
3660
+ ]
3661
+ ],
3662
+ [
3663
+ "do",
3664
+ [
3665
+ "set",
3666
+ "@entity.paramA",
3667
+ "@A"
3668
+ ],
3669
+ [
3670
+ "set",
3671
+ "@entity.paramB",
3672
+ "@B"
3673
+ ],
3674
+ [
3675
+ "set",
3676
+ "@entity.distance",
3677
+ "@dist"
3678
+ ],
3679
+ [
3680
+ "set",
3681
+ "@entity.attempts",
3682
+ 0.0
3683
+ ],
3684
+ [
3685
+ "set",
3686
+ "@entity.solved",
3687
+ false
3688
+ ],
3689
+ [
3690
+ "set",
3691
+ "@entity.feedback",
3692
+ ""
3693
+ ],
3694
+ [
3695
+ "set",
3696
+ "@entity.yMin",
3697
+ [
3698
+ "-",
3699
+ "@yMinRaw",
3700
+ "@yPad"
3701
+ ]
3702
+ ],
3703
+ [
3704
+ "set",
3705
+ "@entity.yMax",
3706
+ [
3707
+ "+",
3708
+ "@yMaxRaw",
3709
+ "@yPad"
3710
+ ]
3711
+ ],
3712
+ [
3713
+ "set",
3714
+ "@entity.curves",
3715
+ [
3716
+ {
3717
+ "color": "@config.targetColor",
3718
+ "label": "@config.targetLabel",
3719
+ "samples": "@entity.targetSamples"
3720
+ },
3721
+ {
3722
+ "color": "@config.learnerColor",
3723
+ "label": "@config.learnerLabel",
3724
+ "samples": "@samples"
3725
+ }
3726
+ ]
3727
+ ]
3728
+ ]
3729
+ ],
3730
+ [
3731
+ "set",
3732
+ "@entity.resultRow",
3733
+ [
3734
+ "array/concat",
3735
+ [
3736
+ "if",
3737
+ "@entity.solved",
3738
+ [
3739
+ {
3740
+ "label": "Solved",
3741
+ "type": "badge",
3742
+ "variant": "success"
3743
+ }
3744
+ ],
3745
+ []
3746
+ ],
3747
+ [
3748
+ {
3749
+ "content": "@entity.feedback",
3750
+ "type": "typography",
3751
+ "variant": "caption"
3752
+ }
3753
+ ]
3754
+ ]
3755
+ ],
3756
+ [
3757
+ "render-ui",
3758
+ "main",
3759
+ {
3760
+ "children": [
3761
+ {
3762
+ "children": [
3763
+ {
3764
+ "content": "@entity.title",
3765
+ "type": "typography",
3766
+ "variant": "h4"
3767
+ },
3768
+ {
3769
+ "content": "@config.goalText",
3770
+ "type": "typography",
3771
+ "variant": "body"
3772
+ },
3773
+ {
3774
+ "children": [
3775
+ {
3776
+ "content": [
3777
+ "str/concat",
3778
+ "@entity.paramALabel",
3779
+ ": ",
3780
+ [
3781
+ "math/round",
3782
+ "@entity.paramA",
3783
+ 2.0
3784
+ ]
3785
+ ],
3786
+ "type": "typography",
3787
+ "variant": "caption"
3788
+ },
3789
+ {
3790
+ "action": "SET_PARAM_A",
3791
+ "max": "@config.paramAMax",
3792
+ "min": "@config.paramAMin",
3793
+ "showTooltip": true,
3794
+ "step": "@config.paramAStep",
3795
+ "type": "range-slider",
3796
+ "value": "@entity.paramA"
3797
+ }
3798
+ ],
3799
+ "direction": "vertical",
3800
+ "gap": "xs",
3801
+ "type": "stack"
3802
+ },
3803
+ {
3804
+ "children": [
3805
+ {
3806
+ "content": [
3807
+ "str/concat",
3808
+ "@entity.paramBLabel",
3809
+ ": ",
3810
+ [
3811
+ "math/round",
3812
+ "@entity.paramB",
3813
+ 2.0
3814
+ ]
3815
+ ],
3816
+ "type": "typography",
3817
+ "variant": "caption"
3818
+ },
3819
+ {
3820
+ "action": "SET_PARAM_B",
3821
+ "max": "@config.paramBMax",
3822
+ "min": "@config.paramBMin",
3823
+ "showTooltip": true,
3824
+ "step": "@config.paramBStep",
3825
+ "type": "range-slider",
3826
+ "value": "@entity.paramB"
3827
+ }
3828
+ ],
3829
+ "direction": "vertical",
3830
+ "gap": "xs",
3831
+ "type": "stack"
3832
+ },
3833
+ {
3834
+ "animate": false,
3835
+ "curves": "@entity.curves",
3836
+ "gridStep": "@config.gridStep",
3837
+ "height": "@config.height",
3838
+ "interactive": false,
3839
+ "points": [],
3840
+ "shapes": [],
3841
+ "showAxes": "@config.showAxes",
3842
+ "showGrid": "@config.showGrid",
3843
+ "title": "",
3844
+ "type": "math-canvas",
3845
+ "vectors": [],
3846
+ "width": "@config.width",
3847
+ "xMax": "@config.xMax",
3848
+ "xMin": "@config.xMin",
3849
+ "yMax": "@entity.yMax",
3850
+ "yMin": "@entity.yMin"
3851
+ },
3852
+ {
3853
+ "content": [
3854
+ "if",
3855
+ "@config.showLiveDistance",
3856
+ [
3857
+ "str/concat",
3858
+ "Distance from target: ",
3859
+ [
3860
+ "math/round",
3861
+ "@entity.distance",
3862
+ 3.0
3863
+ ],
3864
+ " · attempts: ",
3865
+ [
3866
+ "str/concat",
3867
+ "",
3868
+ "@entity.attempts"
3869
+ ]
3870
+ ],
3871
+ [
3872
+ "str/concat",
3873
+ "Attempts: ",
3874
+ [
3875
+ "str/concat",
3876
+ "",
3877
+ "@entity.attempts"
3878
+ ]
3879
+ ]
3880
+ ],
3881
+ "type": "typography",
3882
+ "variant": "body"
3883
+ },
3884
+ {
3885
+ "children": [
3886
+ {
3887
+ "action": "CHECK",
3888
+ "disabled": [
3889
+ "if",
3890
+ "@entity.solved",
3891
+ true,
3892
+ false
3893
+ ],
3894
+ "label": "@config.checkLabel",
3895
+ "type": "button",
3896
+ "variant": "primary"
3897
+ },
3898
+ {
3899
+ "action": "RESET",
3900
+ "label": "Reset",
3901
+ "type": "button",
3902
+ "variant": "ghost"
3903
+ }
3904
+ ],
3905
+ "direction": "horizontal",
3906
+ "gap": "sm",
3907
+ "type": "stack"
3908
+ },
3909
+ {
3910
+ "children": "@entity.resultRow",
3911
+ "direction": "horizontal",
3912
+ "gap": "xs",
3913
+ "type": "stack"
3914
+ }
3915
+ ],
3916
+ "direction": "vertical",
3917
+ "gap": "md",
3918
+ "type": "stack"
3919
+ }
3920
+ ],
3921
+ "padding": "md",
3922
+ "type": "box"
3923
+ }
3924
+ ],
3925
+ [
3926
+ "emit",
3927
+ "GOAL_RESET",
3928
+ {
3929
+ "attempts": 0.0
3930
+ }
3931
+ ]
3932
+ ],
3933
+ "event": "RESET",
3934
+ "eventId": "evt_01M07580W5WJ19JYKHB3WR59WH",
3935
+ "from": "idle",
3936
+ "guard": [
3937
+ "==",
3938
+ "@entity.active",
3939
+ true
3940
+ ],
3941
+ "to": "idle"
3942
+ }
3943
+ ]
3944
+ }
3945
+ }
3946
+ ]
3947
+ }
3948
+ ],
3949
+ "schemaVersion": 1,
3950
+ "version": "1.0.0"
3951
+ }