@teachinglab/omd 0.5.6 → 0.5.8

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 (60) hide show
  1. package/canvas/ui/toolbar.js +6 -9
  2. package/index.js +3 -0
  3. package/npm-docs/DOCUMENTATION_SUMMARY.md +220 -0
  4. package/npm-docs/README.md +251 -0
  5. package/npm-docs/api/api-reference.md +85 -0
  6. package/npm-docs/api/configuration-options.md +198 -0
  7. package/npm-docs/api/eventManager.md +83 -0
  8. package/npm-docs/api/expression-nodes.md +561 -0
  9. package/npm-docs/api/focusFrameManager.md +145 -0
  10. package/npm-docs/api/index.md +106 -0
  11. package/npm-docs/api/main.md +63 -0
  12. package/npm-docs/api/omdBinaryExpressionNode.md +86 -0
  13. package/npm-docs/api/omdCanvas.md +84 -0
  14. package/npm-docs/api/omdConfigManager.md +113 -0
  15. package/npm-docs/api/omdConstantNode.md +53 -0
  16. package/npm-docs/api/omdDisplay.md +87 -0
  17. package/npm-docs/api/omdEquationNode.md +174 -0
  18. package/npm-docs/api/omdEquationSequenceNode.md +259 -0
  19. package/npm-docs/api/omdEquationStack.md +193 -0
  20. package/npm-docs/api/omdFunctionNode.md +83 -0
  21. package/npm-docs/api/omdGroupNode.md +79 -0
  22. package/npm-docs/api/omdHelpers.md +88 -0
  23. package/npm-docs/api/omdLeafNode.md +86 -0
  24. package/npm-docs/api/omdNode.md +202 -0
  25. package/npm-docs/api/omdOperationDisplayNode.md +118 -0
  26. package/npm-docs/api/omdOperatorNode.md +92 -0
  27. package/npm-docs/api/omdParenthesisNode.md +134 -0
  28. package/npm-docs/api/omdPopup.md +192 -0
  29. package/npm-docs/api/omdPowerNode.md +132 -0
  30. package/npm-docs/api/omdRationalNode.md +145 -0
  31. package/npm-docs/api/omdSequenceNode.md +128 -0
  32. package/npm-docs/api/omdSimplification.md +79 -0
  33. package/npm-docs/api/omdSqrtNode.md +144 -0
  34. package/npm-docs/api/omdStepVisualizer.md +147 -0
  35. package/npm-docs/api/omdStepVisualizerHighlighting.md +66 -0
  36. package/npm-docs/api/omdStepVisualizerInteractiveSteps.md +109 -0
  37. package/npm-docs/api/omdStepVisualizerLayout.md +71 -0
  38. package/npm-docs/api/omdStepVisualizerNodeUtils.md +140 -0
  39. package/npm-docs/api/omdStepVisualizerTextBoxes.md +77 -0
  40. package/npm-docs/api/omdToolbar.md +131 -0
  41. package/npm-docs/api/omdTranscriptionService.md +96 -0
  42. package/npm-docs/api/omdTreeDiff.md +170 -0
  43. package/npm-docs/api/omdUnaryExpressionNode.md +137 -0
  44. package/npm-docs/api/omdUtilities.md +83 -0
  45. package/npm-docs/api/omdVariableNode.md +123 -0
  46. package/npm-docs/api/selectTool.md +74 -0
  47. package/npm-docs/api/simplificationEngine.md +98 -0
  48. package/npm-docs/api/simplificationRules.md +77 -0
  49. package/npm-docs/api/simplificationUtils.md +64 -0
  50. package/npm-docs/api/transcribe.md +43 -0
  51. package/npm-docs/guides/equations.md +854 -0
  52. package/npm-docs/guides/factory-functions.md +354 -0
  53. package/npm-docs/guides/getting-started.md +318 -0
  54. package/npm-docs/guides/quick-examples.md +525 -0
  55. package/npm-docs/guides/visualizations.md +682 -0
  56. package/npm-docs/json-schemas.md +826 -0
  57. package/omd/utils/omdTranscriptionService.js +1 -1
  58. package/package.json +2 -1
  59. package/src/index.js +2 -0
  60. package/src/omdFactory.js +150 -0
@@ -0,0 +1,826 @@
1
+ # JSON Schemas for OMD Components
2
+
3
+ This document provides complete JSON schemas and examples for all OMD visual components. Use these with the `loadFromJSON()` method.
4
+
5
+ ## Table of Contents
6
+
7
+ 1. [Global Context & Configuration](#global-context--configuration)
8
+ 2. [Visualizations](#visualizations)
9
+ - [Number & Ratio Visualizations](#number--ratio-visualizations)
10
+ - [Graphing & Geometry](#graphing--geometry)
11
+ - [Data Display](#data-display)
12
+ 3. [Equations & Expressions](#equations--expressions)
13
+ - [Core Components](#core-components)
14
+ - [Advanced Expressions](#advanced-expressions)
15
+
16
+ ---
17
+
18
+ ## Global Context & Configuration
19
+
20
+ ### Common Expression Format
21
+
22
+ Many components accept expressions in multiple formats:
23
+
24
+ **String Format** (simplest):
25
+ ```javascript
26
+ "2x + 3"
27
+ ```
28
+
29
+ **Structured Format** (programmatic):
30
+ ```json
31
+ {
32
+ "termsAndOpers": [
33
+ { "omdType": "term", "coefficient": 2, "variable": "x", "exponent": 1 },
34
+ { "omdType": "operator", "operator": "+" },
35
+ { "omdType": "number", "value": 3 }
36
+ ]
37
+ }
38
+ ```
39
+
40
+ ### Primitive Types
41
+
42
+ #### `omdNumber`
43
+ ```json
44
+ {
45
+ "omdType": "number",
46
+ "value": 42
47
+ }
48
+ ```
49
+
50
+ #### `omdVariable`
51
+ ```json
52
+ {
53
+ "omdType": "variable",
54
+ "name": "x"
55
+ }
56
+ ```
57
+
58
+ #### `omdOperator`
59
+ ```json
60
+ {
61
+ "omdType": "operator",
62
+ "operator": "+"
63
+ }
64
+ ```
65
+ Supported operators: `+`, `-`, `/`, `÷`, `x`, `*`, `•`, `×`, `=`
66
+
67
+ #### `omdTerm`
68
+ ```json
69
+ {
70
+ "omdType": "term",
71
+ "coefficient": 3,
72
+ "variable": "x",
73
+ "exponent": 2
74
+ }
75
+ ```
76
+
77
+ ---
78
+
79
+ ## Visualizations
80
+
81
+ ### Number & Ratio Visualizations
82
+
83
+ #### `omdNumberLine`
84
+
85
+ Interactive number line with labeled ticks and optional dots.
86
+
87
+ **Schema:**
88
+ ```typescript
89
+ {
90
+ min: number,
91
+ max: number,
92
+ dotValues?: number[],
93
+ label?: string
94
+ }
95
+ ```
96
+
97
+ **Example:**
98
+ ```json
99
+ {
100
+ "min": 0,
101
+ "max": 10,
102
+ "dotValues": [2, 5, 8],
103
+ "label": "Number Line Example"
104
+ }
105
+ ```
106
+
107
+ **Usage:**
108
+ ```javascript
109
+ const numberLine = new omdNumberLine();
110
+ numberLine.loadFromJSON({
111
+ min: 0,
112
+ max: 10,
113
+ dotValues: [2, 5, 8],
114
+ label: "Number Line Example"
115
+ });
116
+ ```
117
+
118
+ ---
119
+
120
+ #### `omdNumberTile`
121
+
122
+ Visual tile with dots for counting and grouping activities.
123
+
124
+ **Schema:**
125
+ ```typescript
126
+ {
127
+ value: number,
128
+ size?: "small" | "medium" | "large",
129
+ dotsPerColumn?: number,
130
+ backgroundColor?: string,
131
+ dotColor?: string
132
+ }
133
+ ```
134
+
135
+ **Example:**
136
+ ```json
137
+ {
138
+ "value": 10,
139
+ "size": "medium",
140
+ "dotsPerColumn": 5,
141
+ "backgroundColor": "#FFFFFF",
142
+ "dotColor": "#000000"
143
+ }
144
+ ```
145
+
146
+ ---
147
+
148
+ #### `omdTapeDiagram`
149
+
150
+ Part-whole relationship diagrams with labeled sections.
151
+
152
+ **Schema:**
153
+ ```typescript
154
+ {
155
+ values: number[],
156
+ showValues?: boolean,
157
+ colors?: string[],
158
+ labelSet?: Array<{
159
+ startIndex: number,
160
+ endIndex: number,
161
+ label: string,
162
+ showBelow?: boolean
163
+ }>,
164
+ unitWidth?: number
165
+ }
166
+ ```
167
+
168
+ **Example:**
169
+ ```json
170
+ {
171
+ "values": [1, 2, 3],
172
+ "showValues": true,
173
+ "colors": ["#FF0000", "#00FF00", "#0000FF"],
174
+ "labelSet": [
175
+ {
176
+ "startIndex": 0,
177
+ "endIndex": 2,
178
+ "label": "Total: 6",
179
+ "showBelow": true
180
+ }
181
+ ],
182
+ "unitWidth": 30
183
+ }
184
+ ```
185
+
186
+ ---
187
+
188
+ #### `omdRatioChart`
189
+
190
+ Pie and bar chart ratio visualizations.
191
+
192
+ **Schema:**
193
+ ```typescript
194
+ {
195
+ valueA: number,
196
+ valueB: number,
197
+ renderType?: "pie" | "bar",
198
+ size?: "small" | "medium" | "large"
199
+ }
200
+ ```
201
+
202
+ **Example:**
203
+ ```json
204
+ {
205
+ "valueA": 3,
206
+ "valueB": 2,
207
+ "renderType": "pie",
208
+ "size": "medium"
209
+ }
210
+ ```
211
+
212
+ ---
213
+
214
+ #### `omdBalanceHanger`
215
+
216
+ Balance scale visualizations.
217
+
218
+ **Schema:**
219
+ ```typescript
220
+ {
221
+ leftValues: number[],
222
+ rightValues: number[],
223
+ tilt?: "left" | "right" | "balanced"
224
+ }
225
+ ```
226
+
227
+ **Example:**
228
+ ```json
229
+ {
230
+ "leftValues": [5, 3],
231
+ "rightValues": [4, 4],
232
+ "tilt": "balanced"
233
+ }
234
+ ```
235
+
236
+ ---
237
+
238
+ ### Graphing & Geometry
239
+
240
+ #### `omdCoordinatePlane`
241
+
242
+ 2D coordinate plane with axes, gridlines, functions, shapes, and plots.
243
+
244
+ **Schema:**
245
+ ```typescript
246
+ {
247
+ graphEquations?: Array<{
248
+ equation: string,
249
+ color?: string,
250
+ strokeWidth?: number,
251
+ domain?: { min: number, max: number }
252
+ }>,
253
+ lineSegments?: Array<{
254
+ point1: [number, number],
255
+ point2: [number, number],
256
+ color?: string,
257
+ strokeWidth?: number
258
+ }>,
259
+ dotValues?: Array<[number, number, string?]>,
260
+ shapeSet?: Array<ShapeObject>,
261
+ xMin?: number,
262
+ xMax?: number,
263
+ yMin?: number,
264
+ yMax?: number,
265
+ xLabel?: string,
266
+ yLabel?: string,
267
+ axisLabelOffsetPx?: number,
268
+ size?: "small" | "medium" | "large",
269
+ tickInterval?: number,
270
+ forceAllTickLabels?: boolean,
271
+ tickLabelOffsetPx?: number,
272
+ showTickLabels?: boolean,
273
+ backgroundColor?: string,
274
+ backgroundCornerRadius?: number,
275
+ backgroundOpacity?: number,
276
+ showBackground?: boolean
277
+ }
278
+ ```
279
+
280
+ **Example:**
281
+ ```json
282
+ {
283
+ "graphEquations": [
284
+ {
285
+ "equation": "y = x^2 - 4",
286
+ "color": "#e11d48",
287
+ "strokeWidth": 2,
288
+ "domain": { "min": -5, "max": 5 }
289
+ }
290
+ ],
291
+ "lineSegments": [
292
+ {
293
+ "point1": [0, 0],
294
+ "point2": [1, 1],
295
+ "color": "red",
296
+ "strokeWidth": 2
297
+ }
298
+ ],
299
+ "dotValues": [[0, 0, "green"], [1, 1, "blue"]],
300
+ "xMin": -5,
301
+ "xMax": 5,
302
+ "yMin": -5,
303
+ "yMax": 5,
304
+ "xLabel": "X-Axis",
305
+ "yLabel": "Y-Axis",
306
+ "tickInterval": 1,
307
+ "showTickLabels": true,
308
+ "backgroundColor": "#FFFFFF",
309
+ "showBackground": true
310
+ }
311
+ ```
312
+
313
+ ---
314
+
315
+ #### `omdShapes`
316
+
317
+ Geometric shapes for visualization.
318
+
319
+ **Circle:**
320
+ ```json
321
+ {
322
+ "omdType": "circle",
323
+ "radius": 10,
324
+ "color": "#FF0000"
325
+ }
326
+ ```
327
+
328
+ **Rectangle:**
329
+ ```json
330
+ {
331
+ "omdType": "rectangle",
332
+ "width": 20,
333
+ "height": 10,
334
+ "color": "#00FF00"
335
+ }
336
+ ```
337
+
338
+ **Regular Polygon:**
339
+ ```json
340
+ {
341
+ "omdType": "regularPolygon",
342
+ "sides": 6,
343
+ "radius": 15,
344
+ "color": "#0000FF"
345
+ }
346
+ ```
347
+
348
+ **Ellipse:**
349
+ ```json
350
+ {
351
+ "omdType": "ellipse",
352
+ "radiusX": 20,
353
+ "radiusY": 10,
354
+ "color": "#FFFF00"
355
+ }
356
+ ```
357
+
358
+ **Right Triangle:**
359
+ ```json
360
+ {
361
+ "omdType": "rightTriangle",
362
+ "base": 10,
363
+ "height": 15,
364
+ "color": "#FF00FF"
365
+ }
366
+ ```
367
+
368
+ **Isosceles Triangle:**
369
+ ```json
370
+ {
371
+ "omdType": "isoscelesTriangle",
372
+ "base": 10,
373
+ "height": 15,
374
+ "color": "#00FFFF"
375
+ }
376
+ ```
377
+
378
+ ---
379
+
380
+ #### `omdSpinner`
381
+
382
+ Circular spinner for divisions and selections.
383
+
384
+ **Schema:**
385
+ ```typescript
386
+ {
387
+ divisions: number,
388
+ arrowPosition: number,
389
+ size?: "small" | "medium" | "large"
390
+ }
391
+ ```
392
+
393
+ **Example:**
394
+ ```json
395
+ {
396
+ "divisions": 8,
397
+ "arrowPosition": 3,
398
+ "size": "medium"
399
+ }
400
+ ```
401
+
402
+ ---
403
+
404
+ ### Data Display
405
+
406
+ #### `omdTable`
407
+
408
+ Tabular data display with customizable styling.
409
+
410
+ **Schema:**
411
+ ```typescript
412
+ {
413
+ equation?: string,
414
+ data?: Array<[number, number]>,
415
+ headers?: string[],
416
+ xMin?: number,
417
+ xMax?: number,
418
+ stepSize?: number,
419
+ title?: string,
420
+ fontSize?: number,
421
+ headerFontSize?: number,
422
+ fontFamily?: string,
423
+ headerFontFamily?: string,
424
+ cellHeight?: number,
425
+ headerHeight?: number,
426
+ minCellWidth?: number,
427
+ maxCellWidth?: number,
428
+ padding?: number,
429
+ backgroundColor?: string,
430
+ backgroundCornerRadius?: number,
431
+ backgroundOpacity?: number,
432
+ showBackground?: boolean,
433
+ alternatingRowColors?: string[]
434
+ }
435
+ ```
436
+
437
+ **Example:**
438
+ ```json
439
+ {
440
+ "equation": "y = x^2",
441
+ "headers": ["x", "y"],
442
+ "xMin": -5,
443
+ "xMax": 5,
444
+ "stepSize": 1,
445
+ "title": "Quadratic Table",
446
+ "fontSize": 14,
447
+ "headerFontSize": 16,
448
+ "fontFamily": "Albert Sans",
449
+ "cellHeight": 35,
450
+ "backgroundColor": "#FFFFFF",
451
+ "alternatingRowColors": ["#F0F0F0", "#FFFFFF"]
452
+ }
453
+ ```
454
+
455
+ ---
456
+
457
+ ## Equations & Expressions
458
+
459
+ ### Core Components
460
+
461
+ #### `omdEquation`
462
+
463
+ Complete mathematical equations with left and right sides.
464
+
465
+ **Schema (String Form):**
466
+ ```json
467
+ {
468
+ "equation": "2x + 3 = 11"
469
+ }
470
+ ```
471
+
472
+ **Schema (Structured Form):**
473
+ ```typescript
474
+ {
475
+ leftExpression: Expression | string,
476
+ rightExpression: Expression | string,
477
+ equation?: string
478
+ }
479
+ ```
480
+
481
+ **Examples:**
482
+ ```json
483
+ {
484
+ "equation": "2x + 3 = 11"
485
+ }
486
+ ```
487
+
488
+ ```json
489
+ {
490
+ "leftExpression": {
491
+ "termsAndOpers": [
492
+ { "omdType": "term", "coefficient": 2, "variable": "x" },
493
+ { "omdType": "operator", "operator": "+" },
494
+ { "omdType": "number", "value": 3 }
495
+ ]
496
+ },
497
+ "rightExpression": {
498
+ "omdType": "number",
499
+ "value": 11
500
+ }
501
+ }
502
+ ```
503
+
504
+ **Usage:**
505
+ ```javascript
506
+ // Simple string form
507
+ const eq = new omdEquation();
508
+ eq.loadFromJSON({ equation: '2x + 3 = 11' });
509
+
510
+ // Structured form
511
+ eq.loadFromJSON({
512
+ leftExpression: { omdType: 'term', coefficient: 2, variable: 'x' },
513
+ rightExpression: { omdType: 'number', value: 11 }
514
+ });
515
+ ```
516
+
517
+ ---
518
+
519
+ #### `omdExpression`
520
+
521
+ Mathematical expressions (terms and operators).
522
+
523
+ **Schema (String Form):**
524
+ ```javascript
525
+ "3x^2 + 5x - 2"
526
+ ```
527
+
528
+ **Schema (Structured Form):**
529
+ ```typescript
530
+ {
531
+ termsAndOpers: Array<Term | Number | Variable | Operator>
532
+ }
533
+ ```
534
+
535
+ **Example:**
536
+ ```json
537
+ {
538
+ "termsAndOpers": [
539
+ { "omdType": "term", "coefficient": 3, "variable": "x", "exponent": 2 },
540
+ { "omdType": "operator", "operator": "+" },
541
+ { "omdType": "term", "coefficient": 5, "variable": "x", "exponent": 1 },
542
+ { "omdType": "operator", "operator": "-" },
543
+ { "omdType": "number", "value": 2 }
544
+ ]
545
+ }
546
+ ```
547
+
548
+ ---
549
+
550
+ #### `omdString`
551
+
552
+ Simple string value for labels or annotations.
553
+
554
+ **Schema:**
555
+ ```typescript
556
+ {
557
+ name: string
558
+ }
559
+ ```
560
+
561
+ **Example:**
562
+ ```json
563
+ {
564
+ "name": "Example Label"
565
+ }
566
+ ```
567
+
568
+ ---
569
+
570
+ ### Advanced Expressions
571
+
572
+ #### `omdPowerExpression`
573
+
574
+ Expressions raised to a power (exponentiation).
575
+
576
+ **Schema:**
577
+ ```typescript
578
+ {
579
+ baseExpression: Expression | string,
580
+ exponentExpression: Expression | string
581
+ }
582
+ ```
583
+
584
+ **Example:**
585
+ ```json
586
+ {
587
+ "baseExpression": {
588
+ "termsAndOpers": [
589
+ { "omdType": "variable", "name": "x" },
590
+ { "omdType": "operator", "operator": "+" },
591
+ { "omdType": "number", "value": 1 }
592
+ ]
593
+ },
594
+ "exponentExpression": {
595
+ "omdType": "number",
596
+ "value": 2
597
+ }
598
+ }
599
+ ```
600
+
601
+ **Renders as:** `(x + 1)²`
602
+
603
+ ---
604
+
605
+ #### `omdRationalExpression`
606
+
607
+ Fractions and rational expressions.
608
+
609
+ **Schema:**
610
+ ```typescript
611
+ {
612
+ numeratorExpression: Expression | string,
613
+ denominatorExpression: Expression | string
614
+ }
615
+ ```
616
+
617
+ **Example:**
618
+ ```json
619
+ {
620
+ "numeratorExpression": {
621
+ "termsAndOpers": [
622
+ { "omdType": "variable", "name": "x" },
623
+ { "omdType": "operator", "operator": "+" },
624
+ { "omdType": "number", "value": 1 }
625
+ ]
626
+ },
627
+ "denominatorExpression": {
628
+ "termsAndOpers": [
629
+ { "omdType": "variable", "name": "x" },
630
+ { "omdType": "operator", "operator": "-" },
631
+ { "omdType": "number", "value": 1 }
632
+ ]
633
+ }
634
+ }
635
+ ```
636
+
637
+ **Renders as:** `(x + 1)/(x - 1)`
638
+
639
+ ---
640
+
641
+ #### `omdFunction`
642
+
643
+ Mathematical functions with named inputs.
644
+
645
+ **Schema:**
646
+ ```typescript
647
+ {
648
+ name: string,
649
+ inputVariables: string[],
650
+ expression: Expression | string
651
+ }
652
+ ```
653
+
654
+ **Example:**
655
+ ```json
656
+ {
657
+ "name": "f",
658
+ "inputVariables": ["x"],
659
+ "expression": {
660
+ "termsAndOpers": [
661
+ { "omdType": "term", "coefficient": 2, "variable": "x" },
662
+ { "omdType": "operator", "operator": "+" },
663
+ { "omdType": "number", "value": 1 }
664
+ ]
665
+ }
666
+ }
667
+ ```
668
+
669
+ **Renders as:** `f(x) = 2x + 1`
670
+
671
+ ---
672
+
673
+ #### `omdTileEquation`
674
+
675
+ Visual tile-based equations.
676
+
677
+ **Schema:**
678
+ ```typescript
679
+ {
680
+ left: Array<TileSpec>,
681
+ right: Array<TileSpec>,
682
+ equation?: string,
683
+ tileSize?: number,
684
+ tileGap?: number,
685
+ equalGap?: number,
686
+ tileRadius?: number,
687
+ showLabels?: boolean,
688
+ fontFamily?: string,
689
+ fontSize?: number,
690
+ plusColor?: string,
691
+ equalsColor?: string,
692
+ xPillColor?: string,
693
+ numberTileDefaults?: {
694
+ backgroundColor?: string,
695
+ dotColor?: string
696
+ }
697
+ }
698
+ ```
699
+
700
+ **Example:**
701
+ ```json
702
+ {
703
+ "left": ["x", "x", 3],
704
+ "right": [11],
705
+ "equation": "2x + 3 = 11",
706
+ "tileSize": 28,
707
+ "tileGap": 6,
708
+ "showLabels": true,
709
+ "fontFamily": "Albert Sans",
710
+ "fontSize": 16
711
+ }
712
+ ```
713
+
714
+ ---
715
+
716
+ #### `omdProblem`
717
+
718
+ Problem statement with associated visualization.
719
+
720
+ **Schema:**
721
+ ```typescript
722
+ {
723
+ problemText: string,
724
+ visualization: any
725
+ }
726
+ ```
727
+
728
+ **Example:**
729
+ ```json
730
+ {
731
+ "problemText": "Solve for x:",
732
+ "visualization": {
733
+ "omdType": "equation",
734
+ "equation": "2x + 3 = 11"
735
+ }
736
+ }
737
+ ```
738
+
739
+ ---
740
+
741
+ ## Usage Patterns
742
+
743
+ ### Loading from JSON
744
+
745
+ All components follow the same pattern:
746
+
747
+ ```javascript
748
+ const component = new ComponentClass();
749
+ component.loadFromJSON(jsonData);
750
+ ```
751
+
752
+ ### String vs. Structured
753
+
754
+ Many components accept both:
755
+
756
+ ```javascript
757
+ // String form (simple)
758
+ equation.loadFromJSON({ equation: '2x + 3 = 11' });
759
+
760
+ // Structured form (programmatic)
761
+ equation.loadFromJSON({
762
+ leftExpression: { termsAndOpers: [...] },
763
+ rightExpression: { termsAndOpers: [...] }
764
+ });
765
+ ```
766
+
767
+ ### Nested Components
768
+
769
+ Components can be nested:
770
+
771
+ ```javascript
772
+ const plane = new omdCoordinatePlane();
773
+ plane.loadFromJSON({
774
+ xMin: -10,
775
+ xMax: 10,
776
+ yMin: -10,
777
+ yMax: 10,
778
+ shapeSet: [
779
+ { omdType: 'circle', radius: 5, color: 'blue' },
780
+ { omdType: 'rectangle', width: 10, height: 5, color: 'red' }
781
+ ]
782
+ });
783
+ ```
784
+
785
+ ---
786
+
787
+ ## Type Definitions
788
+
789
+ For TypeScript users, the general pattern is:
790
+
791
+ ```typescript
792
+ type Expression = string | {
793
+ termsAndOpers: Array<Term | Number | Variable | Operator>
794
+ };
795
+
796
+ type Term = {
797
+ omdType: 'term',
798
+ coefficient: number,
799
+ variable?: string,
800
+ exponent?: number
801
+ };
802
+
803
+ type Number = {
804
+ omdType: 'number',
805
+ value: number
806
+ };
807
+
808
+ type Variable = {
809
+ omdType: 'variable',
810
+ name: string
811
+ };
812
+
813
+ type Operator = {
814
+ omdType: 'operator',
815
+ operator: '+' | '-' | '/' | '÷' | 'x' | '*' | '•' | '×' | '='
816
+ };
817
+ ```
818
+
819
+ ---
820
+
821
+ ## See Also
822
+
823
+ - **[API Reference](./api/api-reference.md)** - Detailed API documentation
824
+ - **[Getting Started](./guides/getting-started.md)** - Installation and basic usage
825
+ - **[Visualizations Guide](./guides/visualizations.md)** - Visual component examples
826
+ - **[Equations Guide](./guides/equations.md)** - Equation and expression examples