@teachinglab/omd 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/README.md +138 -0
  2. package/canvas/core/canvasConfig.js +203 -0
  3. package/canvas/core/omdCanvas.js +475 -0
  4. package/canvas/drawing/segment.js +168 -0
  5. package/canvas/drawing/stroke.js +386 -0
  6. package/canvas/events/eventManager.js +435 -0
  7. package/canvas/events/pointerEventHandler.js +263 -0
  8. package/canvas/features/focusFrameManager.js +287 -0
  9. package/canvas/index.js +49 -0
  10. package/canvas/tools/eraserTool.js +322 -0
  11. package/canvas/tools/pencilTool.js +319 -0
  12. package/canvas/tools/selectTool.js +457 -0
  13. package/canvas/tools/tool.js +223 -0
  14. package/canvas/tools/toolManager.js +394 -0
  15. package/canvas/ui/cursor.js +438 -0
  16. package/canvas/ui/toolbar.js +304 -0
  17. package/canvas/utils/boundingBox.js +378 -0
  18. package/canvas/utils/mathUtils.js +259 -0
  19. package/docs/api/configuration-options.md +104 -0
  20. package/docs/api/eventManager.md +68 -0
  21. package/docs/api/focusFrameManager.md +150 -0
  22. package/docs/api/index.md +91 -0
  23. package/docs/api/main.md +58 -0
  24. package/docs/api/omdBinaryExpressionNode.md +227 -0
  25. package/docs/api/omdCanvas.md +142 -0
  26. package/docs/api/omdConfigManager.md +192 -0
  27. package/docs/api/omdConstantNode.md +117 -0
  28. package/docs/api/omdDisplay.md +121 -0
  29. package/docs/api/omdEquationNode.md +161 -0
  30. package/docs/api/omdEquationSequenceNode.md +301 -0
  31. package/docs/api/omdEquationStack.md +139 -0
  32. package/docs/api/omdFunctionNode.md +141 -0
  33. package/docs/api/omdGroupNode.md +182 -0
  34. package/docs/api/omdHelpers.md +96 -0
  35. package/docs/api/omdLeafNode.md +163 -0
  36. package/docs/api/omdNode.md +101 -0
  37. package/docs/api/omdOperationDisplayNode.md +139 -0
  38. package/docs/api/omdOperatorNode.md +127 -0
  39. package/docs/api/omdParenthesisNode.md +122 -0
  40. package/docs/api/omdPopup.md +117 -0
  41. package/docs/api/omdPowerNode.md +127 -0
  42. package/docs/api/omdRationalNode.md +128 -0
  43. package/docs/api/omdSequenceNode.md +128 -0
  44. package/docs/api/omdSimplification.md +110 -0
  45. package/docs/api/omdSqrtNode.md +79 -0
  46. package/docs/api/omdStepVisualizer.md +115 -0
  47. package/docs/api/omdStepVisualizerHighlighting.md +61 -0
  48. package/docs/api/omdStepVisualizerInteractiveSteps.md +129 -0
  49. package/docs/api/omdStepVisualizerLayout.md +60 -0
  50. package/docs/api/omdStepVisualizerNodeUtils.md +140 -0
  51. package/docs/api/omdStepVisualizerTextBoxes.md +68 -0
  52. package/docs/api/omdToolbar.md +102 -0
  53. package/docs/api/omdTranscriptionService.md +76 -0
  54. package/docs/api/omdTreeDiff.md +134 -0
  55. package/docs/api/omdUnaryExpressionNode.md +174 -0
  56. package/docs/api/omdUtilities.md +70 -0
  57. package/docs/api/omdVariableNode.md +148 -0
  58. package/docs/api/selectTool.md +74 -0
  59. package/docs/api/simplificationEngine.md +98 -0
  60. package/docs/api/simplificationRules.md +77 -0
  61. package/docs/api/simplificationUtils.md +64 -0
  62. package/docs/api/transcribe.md +43 -0
  63. package/docs/api-reference.md +85 -0
  64. package/docs/index.html +454 -0
  65. package/docs/user-guide.md +9 -0
  66. package/index.js +67 -0
  67. package/omd/config/omdConfigManager.js +267 -0
  68. package/omd/core/index.js +150 -0
  69. package/omd/core/omdEquationStack.js +347 -0
  70. package/omd/core/omdUtilities.js +115 -0
  71. package/omd/display/omdDisplay.js +443 -0
  72. package/omd/display/omdToolbar.js +502 -0
  73. package/omd/nodes/omdBinaryExpressionNode.js +460 -0
  74. package/omd/nodes/omdConstantNode.js +142 -0
  75. package/omd/nodes/omdEquationNode.js +1223 -0
  76. package/omd/nodes/omdEquationSequenceNode.js +1273 -0
  77. package/omd/nodes/omdFunctionNode.js +352 -0
  78. package/omd/nodes/omdGroupNode.js +68 -0
  79. package/omd/nodes/omdLeafNode.js +77 -0
  80. package/omd/nodes/omdNode.js +557 -0
  81. package/omd/nodes/omdOperationDisplayNode.js +322 -0
  82. package/omd/nodes/omdOperatorNode.js +109 -0
  83. package/omd/nodes/omdParenthesisNode.js +293 -0
  84. package/omd/nodes/omdPowerNode.js +236 -0
  85. package/omd/nodes/omdRationalNode.js +295 -0
  86. package/omd/nodes/omdSqrtNode.js +308 -0
  87. package/omd/nodes/omdUnaryExpressionNode.js +178 -0
  88. package/omd/nodes/omdVariableNode.js +123 -0
  89. package/omd/simplification/omdSimplification.js +171 -0
  90. package/omd/simplification/omdSimplificationEngine.js +886 -0
  91. package/omd/simplification/package.json +6 -0
  92. package/omd/simplification/rules/binaryRules.js +1037 -0
  93. package/omd/simplification/rules/functionRules.js +111 -0
  94. package/omd/simplification/rules/index.js +48 -0
  95. package/omd/simplification/rules/parenthesisRules.js +19 -0
  96. package/omd/simplification/rules/powerRules.js +143 -0
  97. package/omd/simplification/rules/rationalRules.js +475 -0
  98. package/omd/simplification/rules/sqrtRules.js +48 -0
  99. package/omd/simplification/rules/unaryRules.js +37 -0
  100. package/omd/simplification/simplificationRules.js +32 -0
  101. package/omd/simplification/simplificationUtils.js +1056 -0
  102. package/omd/step-visualizer/omdStepVisualizer.js +597 -0
  103. package/omd/step-visualizer/omdStepVisualizerHighlighting.js +206 -0
  104. package/omd/step-visualizer/omdStepVisualizerLayout.js +245 -0
  105. package/omd/step-visualizer/omdStepVisualizerTextBoxes.js +163 -0
  106. package/omd/utils/omdNodeOverlay.js +638 -0
  107. package/omd/utils/omdPopup.js +1084 -0
  108. package/omd/utils/omdStepVisualizerInteractiveSteps.js +491 -0
  109. package/omd/utils/omdStepVisualizerNodeUtils.js +268 -0
  110. package/omd/utils/omdTranscriptionService.js +125 -0
  111. package/omd/utils/omdTreeDiff.js +734 -0
  112. package/package.json +46 -0
  113. package/src/index.js +62 -0
  114. package/src/json-schemas.md +109 -0
  115. package/src/omd-json-samples.js +115 -0
  116. package/src/omd.js +109 -0
  117. package/src/omdApp.js +391 -0
  118. package/src/omdAppCanvas.js +336 -0
  119. package/src/omdBalanceHanger.js +172 -0
  120. package/src/omdColor.js +13 -0
  121. package/src/omdCoordinatePlane.js +467 -0
  122. package/src/omdEquation.js +125 -0
  123. package/src/omdExpression.js +104 -0
  124. package/src/omdFunction.js +113 -0
  125. package/src/omdMetaExpression.js +287 -0
  126. package/src/omdNaturalExpression.js +564 -0
  127. package/src/omdNode.js +384 -0
  128. package/src/omdNumber.js +53 -0
  129. package/src/omdNumberLine.js +107 -0
  130. package/src/omdNumberTile.js +119 -0
  131. package/src/omdOperator.js +73 -0
  132. package/src/omdPowerExpression.js +92 -0
  133. package/src/omdProblem.js +55 -0
  134. package/src/omdRatioChart.js +232 -0
  135. package/src/omdRationalExpression.js +115 -0
  136. package/src/omdSampleData.js +215 -0
  137. package/src/omdShapes.js +476 -0
  138. package/src/omdSpinner.js +148 -0
  139. package/src/omdString.js +39 -0
  140. package/src/omdTable.js +369 -0
  141. package/src/omdTapeDiagram.js +245 -0
  142. package/src/omdTerm.js +92 -0
  143. package/src/omdTileEquation.js +349 -0
  144. package/src/omdVariable.js +51 -0
@@ -0,0 +1,98 @@
1
+ # SimplificationEngine
2
+
3
+ The `SimplificationEngine` is a static class that provides a collection of helper methods for creating, matching, and transforming expression nodes. It forms the backbone of the simplification rule system.
4
+
5
+ ## Overview
6
+
7
+ The engine is not instantiated. Instead, its static methods are used directly by the simplification rules to perform their logic. The methods can be grouped into several categories:
8
+
9
+ - **Node Creation:** Helpers to build new `omdNode` instances (e.g., `createConstant`, `createBinaryOp`).
10
+ - **Pattern Matching:** Helpers to check if a node matches a specific structure or value (e.g., `isBinaryOp`, `isConstantValue`).
11
+ - **Monomial Helpers:** Specialized functions for working with monomials (terms like `2x^2`), which are essential for rules like combining like terms.
12
+ - **Rule Definition:** The `SimplificationRule` inner class, which defines the structure for all simplification rules.
13
+
14
+ ## Node Creation Helpers
15
+
16
+ These methods simplify the process of creating new nodes, often by abstracting away the underlying AST structure.
17
+
18
+ #### `createConstant(value, fontSize)`
19
+ - Creates an `omdConstantNode`.
20
+
21
+ #### `createBinaryOp(left, operator, right, ...)`
22
+ - Creates an `omdBinaryExpressionNode` for operations like 'add', 'subtract', etc.
23
+
24
+ #### `createMultiplication(leftConstantNode, rightNode, ...)`
25
+ - A specialized version of `createBinaryOp` for multiplication.
26
+
27
+ #### `createRational(numerator, denominator, fontSize)`
28
+ - Creates an `omdRationalNode` (a fraction).
29
+
30
+ #### `createMonomial(coefficient, variable, power, ...)`
31
+ - Constructs a complete monomial term (e.g., `2x^3`) from its constituent parts.
32
+
33
+ ## Pattern Matching Helpers
34
+
35
+ These methods are used within the `match` function of a simplification rule to determine if the rule applies to a given node.
36
+
37
+ #### `isType(node, typeName)`
38
+ - Checks if a node is an instance of a specific class (e.g., `'omdConstantNode'`).
39
+
40
+ #### `isBinaryOp(node, operator)`
41
+ - Checks if a node is a binary operation, optionally matching a specific operator (e.g., `'add'`).
42
+
43
+ #### `isConstantValue(node, value)`
44
+ - Checks if a node is a constant, optionally matching a specific value.
45
+
46
+ #### `hasConstantOperand(node)`
47
+ - For a binary operation, checks if one of its operands is a constant and returns both the constant and the other operand.
48
+
49
+ #### `unwrapParentheses(node)`
50
+ - If the given node is an `omdParenthesisNode`, it returns the inner expression; otherwise, it returns the node itself.
51
+
52
+ ## Monomial and Like Terms Helpers
53
+
54
+ #### `isMonomial(node)`
55
+ - A powerful helper that checks if a node represents a monomial (e.g., `x`, `2x`, `-5x^2`).
56
+ - **Returns:** An object with `{ coefficient, variable, power, ... }` if it is a monomial, otherwise `null`.
57
+
58
+ #### `areLikeTerms(monomial1, monomial2)`
59
+ - Compares the output of two `isMonomial` calls to see if they have the same variable and power.
60
+
61
+ ## `SimplificationRule` Class
62
+
63
+ This is an inner class of `SimplificationEngine` that provides the blueprint for all simplification rules.
64
+
65
+ ### Constructor
66
+
67
+ `new SimplificationRule(name, matchFn, transformFn, messageFn, type)`
68
+
69
+ - `name` {string}: The name of the rule (e.g., "Combine Constants").
70
+ - `matchFn` {function}: A function that takes a node and returns `true` or a data object if the rule applies, `false` otherwise.
71
+ - `transformFn` {function}: A function that takes the matched node and the data from `matchFn` and returns a new, transformed node.
72
+ - `messageFn` {function} (optional): A function to generate a user-friendly description of the change.
73
+
74
+ ### Key Methods
75
+
76
+ - `canApply(node)`: Executes the `matchFn`.
77
+ - `apply(node, ruleData, currentRoot)`: Executes the `transformFn` and handles replacing the old node with the new one in the expression tree.
78
+
79
+ ## Rule Factory Functions
80
+
81
+ These are static methods on `SimplificationEngine` that create common types of rules.
82
+
83
+ #### `createRule(...)`
84
+ - The base factory function for creating a `SimplificationRule` instance.
85
+
86
+ #### `createConstantFoldRule(name, operator)`
87
+ - Creates a rule that evaluates binary operations on two constants (e.g., `2 + 3` -> `5`).
88
+
89
+ #### `createIdentityRule(name, operator, identityValue, side)`
90
+ - Creates a rule for identity operations (e.g., `x + 0` -> `x` or `y * 1` -> `y`).
91
+
92
+ #### `createZeroMultiplicationRule()`
93
+ - Creates the rule for `x * 0` -> `0`.
94
+
95
+ ### See Also
96
+
97
+ - [`omdSimplification`](./omdSimplification.md): The top-level module that uses the engine.
98
+ - [`simplificationRules`](./simplificationRules.md): The module where specific rules are defined using the engine's helpers.
@@ -0,0 +1,77 @@
1
+ # Simplification Rules
2
+
3
+ This module defines the specific simplification rules used by the `SimplificationEngine`. The rules are organized into an object, keyed by the `omdNode` type they apply to.
4
+
5
+ ## Rule Structure
6
+
7
+ Each rule is an instance of `SimplificationEngine.SimplificationRule` and has three main parts:
8
+
9
+ 1. **`match` function:** Determines if the rule can be applied to a given node.
10
+ 2. **`transform` function:** Executes the simplification and returns a new, transformed node.
11
+ 3. **`message` function:** Generates a human-readable description of the transformation.
12
+
13
+ ## Available Rules
14
+
15
+ The `rules` object contains arrays of rules for each of the following node types:
16
+
17
+ ### `binary` (for `omdBinaryExpressionNode`)
18
+
19
+ - **Same Term Cancellation:** `a - a` simplifies to `0`.
20
+ - **Opposite Term Cancellation:** `a + (-a)` simplifies to `0`.
21
+ - **Cancel Constants in Sums:** `x + 2 - 2` simplifies to `x + 0`.
22
+ - **Constant Folding:** Evaluates operations on constants (e.g., `2 + 3` -> `5`). Includes rules for `add`, `subtract`, `multiply`, and `divide`.
23
+ - **Identity Operations:** Simplifies operations with identity elements (e.g., `x + 0` -> `x`, `y * 1` -> `y`).
24
+ - **Zero Multiplication:** `x * 0` simplifies to `0`.
25
+ - **Combine Coefficients:** `2 * 3x` simplifies to `6x`.
26
+ - **Distributive Property:** `2 * (x + 3)` expands to `2x + 6`.
27
+ - **Expand Polynomial Multiplication:** `(x + 2)(x + 3)` expands to `x^2 + 5x + 6`.
28
+ - **Multiply Monomials:** `2x * 3x` simplifies to `6x^2`.
29
+ - **Combine Like Factors:** `x * x` simplifies to `x^2`.
30
+ - **Combine Multiple Constants in Sums:** `x + 2 + 3` simplifies to `x + 5`.
31
+ - **Combine Like Terms:** `2x + 3x` simplifies to `5x`.
32
+
33
+ ### `rational` (for `omdRationalNode`)
34
+
35
+ - **Variable Self Division:** `x / x` simplifies to `1`.
36
+ - **Power Base Division:** `x^n / x` simplifies to `x^(n-1)`.
37
+ - **Monomial Variable Division:** `cx / x` simplifies to `c`.
38
+ - **Simplify Fraction:** Reduces constant fractions to their simplest form (e.g., `6/8` -> `3/4`).
39
+ - **Simplify Multiplication in Rational:** `(4x)/3` restructures to `(4/3) * x`.
40
+ - **Simplify Rational Division:** `(4x + 6) / 2` distributes the division to `2x + 3`.
41
+
42
+ ### `parenthesis` (for `omdParenthesisNode`)
43
+
44
+ - **Remove Redundant Parentheses:** `((x))` simplifies to `(x)`.
45
+
46
+ ### `unary` (for `omdUnaryExpressionNode`)
47
+
48
+ - **Simplify Double Negation:** `-(-x)` simplifies to `x`.
49
+ - **Remove Unary Plus:** `+x` simplifies to `x`.
50
+
51
+ ### `power` (for `omdPowerNode`)
52
+
53
+ - **Calculate Powers:** Evaluates constant powers (e.g., `2^3` -> `8`).
54
+ - **Power of Zero:** `x^0` simplifies to `1`.
55
+ - **Power of One:** `x^1` simplifies to `x`.
56
+ - **Expand Polynomial Power:** `(x - 2)^2` expands to `x^2 - 4x + 4`.
57
+ - **Square of Square Root:** `(sqrt(x))^2` simplifies to `x`.
58
+ - **Fractional Exponent to Square Root:** `x^(1/2)` converts to `sqrt(x)`.
59
+
60
+ ### `sqrt` (for `omdSqrtNode`)
61
+
62
+ - **Simplify Square Root of Constant:** `sqrt(9)` simplifies to `3`.
63
+ - **Square Root of Square:** `sqrt(x^2)` simplifies to `x` (assuming `x >= 0`).
64
+
65
+ ### `function` (for `omdFunctionNode`)
66
+
67
+ - **Function Inverse Simplification:** `sin(arcsin(x))` simplifies to `x`.
68
+ - **Function to Sqrt Node:** Converts `sqrt(x)` from a function representation to the dedicated `omdSqrtNode`.
69
+
70
+ ## Rule Lookup
71
+
72
+ The `getRulesForNode(node)` function is used by the simplification engine to retrieve the appropriate list of rules for a given node based on its type.
73
+
74
+ ### See Also
75
+
76
+ - [`omdSimplification`](./omdSimplification.md): The top-level module that uses these rules.
77
+ - [`SimplificationEngine`](./simplificationEngine.md): The engine that provides the helpers to create and apply these rules.
@@ -0,0 +1,64 @@
1
+ # Simplification Utilities
2
+
3
+ This module provides a collection of helper functions that are used throughout the simplification engine and rules. These utilities handle common tasks like creating nodes, manipulating expression trees, and formatting output.
4
+
5
+ ## Core Functions
6
+
7
+ #### `gcd(a, b)`
8
+ - Calculates the greatest common divisor of two numbers.
9
+
10
+ #### `createConstantNode(value, fontSize)`
11
+ - Creates a new, fully initialized `omdConstantNode`.
12
+
13
+ #### `createRationalNode(numerator, denominator, fontSize)`
14
+ - Creates a new, fully initialized `omdRationalNode`, handling negative numerators and cases where the denominator is 1.
15
+
16
+ #### `nodeToString(node)`
17
+ - A robust function that converts any `omdNode` into a human-readable string, handling different node types and formatting them correctly.
18
+
19
+ ## Expression Tree Manipulation
20
+
21
+ #### `flattenSum(node, terms)`
22
+ - A key utility that takes a nested tree of additions and subtractions (e.g., `a - (b + c)`) and flattens it into a linear list of terms, each with an associated sign.
23
+ - **Parameters:**
24
+ - `node`: The root of the expression to flatten.
25
+ - `terms`: An array that will be populated with the term objects (`{ node, sign }`).
26
+
27
+ #### `buildSumTree(terms, fontSize)`
28
+ - The counterpart to `flattenSum`. It takes a list of terms (like the one produced by `flattenSum`) and reconstructs a valid, balanced `omdBinaryExpressionNode` tree from them.
29
+
30
+ #### `_replaceNodeInTree(oldNode, newNode, currentRoot)`
31
+ - An internal helper that safely replaces a node within the larger expression tree, handling parent-child connections and ensuring the tree remains valid.
32
+
33
+ ## Polynomial and Monomial Helpers
34
+
35
+ #### `expandPolynomialPower(terms, exponent, fontSize)`
36
+ - Expands a polynomial raised to a power (e.g., `(a+b)^2`). It uses more specific helpers for common cases.
37
+
38
+ #### `expandBinomialSquare(terms, fontSize)`
39
+ - Expands `(a+b+...)^2`.
40
+
41
+ #### `expandBinomialCube(terms, fontSize)`
42
+ - Expands `(a+b)^3`.
43
+
44
+ #### `expandBinomialFourth(terms, fontSize)`
45
+ - Expands `(a+b)^4`.
46
+
47
+ #### `multiplyTermArrays(terms1, terms2, fontSize)`
48
+ - Performs polynomial multiplication by multiplying each term from the first array by each term from the second.
49
+
50
+ ## Provenance Helpers
51
+
52
+ #### `extractLeafNodes(node)`
53
+ - Traverses an expression and returns an array of all its leaf nodes (constants and variables). This is used for detailed provenance tracking.
54
+
55
+ #### `extractMonomialProvenance(termNode)`
56
+ - A specialized function that separates the leaf nodes of a monomial into `coefficientNodes` and `variableNodes` for highly granular highlighting.
57
+
58
+ #### `createMonomialWithGranularProvenance(...)`
59
+ - Creates a monomial while assigning separate provenance chains to its coefficient and variable parts.
60
+
61
+ ### See Also
62
+
63
+ - [`omdSimplification`](./omdSimplification.md)
64
+ - [`simplificationRules`](./simplificationRules.md)
@@ -0,0 +1,43 @@
1
+ # Netlify Function: transcribe
2
+
3
+ This Netlify serverless function provides a backend for the `omdTranscriptionService`. It receives an image, sends it to the Gemini API for transcription, and returns the result.
4
+
5
+ ## Endpoint
6
+
7
+ `/.netlify/functions/transcribe`
8
+
9
+ ## Method
10
+
11
+ `POST`
12
+
13
+ ## Request Body
14
+
15
+ The request body should be a JSON object with the following properties:
16
+
17
+ * **imageBase64** (`string`, required): The base64 encoded image data (without the `data:image/png;base64,` prefix).
18
+ * **prompt** (`string`, optional): A custom prompt to guide the transcription. If not provided, a default prompt for mathematical expressions is used.
19
+
20
+ ## Responses
21
+
22
+ ### Success Response (200 OK)
23
+
24
+ A successful response will be a JSON object with the following properties:
25
+
26
+ * **text** (`string`): The transcribed text.
27
+ * **provider** (`string`): The transcription provider used (always `'gemini'`).
28
+ * **confidence** (`number`): The confidence score of the transcription (currently hardcoded to `1.0`).
29
+
30
+ ### Error Responses
31
+
32
+ * **400 Bad Request**: This error is returned if the `imageBase64` property is missing from the request body.
33
+ * **500 Internal Server Error**: This error is returned if there is an issue with the transcription process on the server, such as an error from the Gemini API.
34
+
35
+ ## Environment Variables
36
+
37
+ This function requires the following environment variable to be set in your Netlify environment:
38
+
39
+ * `GEMINI_API_KEY`: Your API key for the Gemini service.
40
+
41
+ ## CORS
42
+
43
+ The function is configured to allow cross-origin requests from any origin.
@@ -0,0 +1,85 @@
1
+ # OMD Library API Reference
2
+
3
+ > This is the complete API reference for the OMD (On-screen Math Display) library. Use the table of contents below to navigate to the detailed documentation for each module and class.
4
+
5
+ ---
6
+
7
+ ## Table of Contents
8
+
9
+ The API is organized into the following categories for clarity:
10
+
11
+ | Category | Description |
12
+ | ----------------------- | --------------------------------------------------------------------------------- |
13
+ | **[Core Components](#core-components)** | The main entry points for rendering and managing expressions. |
14
+ | **[Node Types](#node-types)** | The building blocks of all mathematical expressions. |
15
+ | **[UI Components](#ui-components)** | Interactive components for user interfaces. |
16
+ | **[Helper Utilities](#helper-utilities)** | Utility functions for common tasks like node creation and visualization. |
17
+ | **[Configuration](#configuration)** | Modules for managing the library's settings and behavior. |
18
+ | **[Simplification](#simplification)** | The expression simplification engine and its components. |
19
+
20
+ ---
21
+
22
+
23
+ ### Core Components
24
+
25
+ The foundational classes for interacting with the OMD library.
26
+
27
+ - **[`omdNode`](./api/omdNode.md)**: The abstract base class for all mathematical nodes in the expression tree.
28
+ - **[`omdDisplay`](./api/omdDisplay.md)**: A component for rendering a single, auto-centered mathematical expression.
29
+ - **[`omdEquationStack`](./api/omdEquationStack.md)**: A component for managing and displaying a sequence of equation steps.
30
+
31
+ ### Node Types
32
+
33
+ These classes represent the different parts of a mathematical expression.
34
+
35
+ - **[`omdConstantNode`](./api/omdConstantNode.md)**: Represents numeric constants (e.g., `5`, `3.14`).
36
+ - **[`omdVariableNode`](./api/omdVariableNode.md)**: Represents variables (e.g., `x`, `y`).
37
+ - **[`omdBinaryExpressionNode`](./api/omdBinaryExpressionNode.md)**: Represents binary operations (`+`, `-`, `*`, `/`).
38
+ - **[`omdUnaryExpressionNode`](./api/omdUnaryExpressionNode.md)**: Represents unary operations (e.g., negation `-x`).
39
+ - **[`omdPowerNode`](./api/omdPowerNode.md)**: Represents exponentiation (`x^2`).
40
+ - **[`omdSqrtNode`](./api/omdSqrtNode.md)**: Represents square roots (`√x`).
41
+ - **[`omdRationalNode`](./api/omdRationalNode.md)**: Represents fractions and rational numbers (`x/y`).
42
+ - **[`omdEquationNode`](./api/omdEquationNode.md)**: Represents equations with a left and right side.
43
+ - **[`omdFunctionNode`](./api/omdFunctionNode.md)**: Represents mathematical functions (e.g., `sin(x)`).
44
+ - **[`omdParenthesisNode`](./api/omdParenthesisNode.md)**: Represents expressions enclosed in parentheses.
45
+ - **[`omdEquationSequenceNode`](./api/omdEquationSequenceNode.md)**: A container for displaying step-by-step solutions.
46
+ - **[`omdOperationDisplayNode`](./api/omdOperationDisplayNode.md)**: Represents visual operation hints.
47
+ - **[`omdGroupNode`](./api/omdGroupNode.md)**: A container for grouping related nodes.
48
+
49
+ ### UI Components
50
+
51
+ Interactive components for building math interfaces.
52
+
53
+ - **[`omdToolbar`](./api/omdToolbar.md)**: A customizable toolbar for mathematical operations.
54
+ - **[`omdStepVisualizer`](./api/omdStepVisualizer.md)**: Component for visualizing step-by-step solutions.
55
+ - **[`omdStepVisualizerHighlighting`](./api/omdStepVisualizerHighlighting.md)**: Manages highlighting of nodes in step visualizations.
56
+ - **[`omdStepVisualizerLayout`](./api/omdStepVisualizerLayout.md)**: Handles layout and positioning of step visualizer elements.
57
+ - **[`omdStepVisualizerTextBoxes`](./api/omdStepVisualizerTextBoxes.md)**: Manages interactive text boxes for step explanations.
58
+ - **[`omdStepVisualizerInteractiveSteps`](./api/omdStepVisualizerInteractiveSteps.md)**: Creates interactive step elements for explanations.
59
+
60
+ ### Helper Utilities
61
+
62
+ - **[`omdHelpers`](./api/omdHelpers.md)**: Utility functions for node creation.
63
+ - **[`omdUtilities`](./api/omdUtilities.md)**: General utilities for AST mapping and text bounds.
64
+ - **[`omdStepVisualizerNodeUtils`](./api/omdStepVisualizerNodeUtils.md)**: Utilities for node operations in step visualizations.
65
+ - **[`omdTreeDiff`](./api/omdTreeDiff.md)**: Utilities for comparing expression trees.
66
+
67
+ ### Configuration
68
+
69
+ - **[`omdConfigManager`](./api/omdConfigManager.md)**: The main object for managing library configuration.
70
+ - **[`Configuration Options`](./api/configuration-options.md)**: A detailed list of all available configuration settings.
71
+
72
+ ### Simplification
73
+
74
+ - **[`omdSimplification`](./api/omdSimplification.md)**: The main simplification module.
75
+ - **[`omdSimplificationEngine`](./api/simplificationEngine.md)**: Core simplification engine.
76
+ - **[`Simplification Rules`](./api/simplificationRules.md)**: Available simplification rules.
77
+ - **[`Simplification Utilities`](./api/simplificationUtils.md)**: Helper functions for simplification rules.
78
+
79
+
80
+ ---
81
+
82
+
83
+ ## See Also
84
+ - **[User Guide](user-guide.md)**: Getting started, usage, and tutorials (in progress)
85
+ - **[Examples](../examples/)**: A directory of live, interactive examples.