@teachinglab/omd 0.2.10 → 0.3.1

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 (58) hide show
  1. package/docs/api/configuration-options.md +198 -198
  2. package/docs/api/eventManager.md +82 -82
  3. package/docs/api/focusFrameManager.md +144 -144
  4. package/docs/api/index.md +105 -105
  5. package/docs/api/main.md +62 -62
  6. package/docs/api/omdBinaryExpressionNode.md +86 -86
  7. package/docs/api/omdCanvas.md +83 -83
  8. package/docs/api/omdConfigManager.md +112 -112
  9. package/docs/api/omdConstantNode.md +52 -52
  10. package/docs/api/omdDisplay.md +87 -87
  11. package/docs/api/omdEquationNode.md +174 -174
  12. package/docs/api/omdEquationSequenceNode.md +258 -258
  13. package/docs/api/omdEquationStack.md +156 -156
  14. package/docs/api/omdFunctionNode.md +82 -82
  15. package/docs/api/omdGroupNode.md +78 -78
  16. package/docs/api/omdHelpers.md +87 -87
  17. package/docs/api/omdLeafNode.md +85 -85
  18. package/docs/api/omdNode.md +201 -201
  19. package/docs/api/omdOperationDisplayNode.md +117 -117
  20. package/docs/api/omdOperatorNode.md +91 -91
  21. package/docs/api/omdParenthesisNode.md +133 -133
  22. package/docs/api/omdPopup.md +191 -191
  23. package/docs/api/omdPowerNode.md +131 -131
  24. package/docs/api/omdRationalNode.md +144 -144
  25. package/docs/api/omdSimplification.md +78 -78
  26. package/docs/api/omdSqrtNode.md +144 -144
  27. package/docs/api/omdStepVisualizer.md +146 -146
  28. package/docs/api/omdStepVisualizerHighlighting.md +65 -65
  29. package/docs/api/omdStepVisualizerInteractiveSteps.md +108 -108
  30. package/docs/api/omdStepVisualizerLayout.md +70 -70
  31. package/docs/api/omdStepVisualizerTextBoxes.md +76 -76
  32. package/docs/api/omdTranscriptionService.md +95 -95
  33. package/docs/api/omdTreeDiff.md +169 -169
  34. package/docs/api/omdUnaryExpressionNode.md +137 -137
  35. package/docs/api/omdUtilities.md +82 -82
  36. package/docs/api/omdVariableNode.md +123 -123
  37. package/omd/nodes/omdConstantNode.js +141 -141
  38. package/omd/nodes/omdGroupNode.js +67 -67
  39. package/omd/nodes/omdLeafNode.js +76 -76
  40. package/omd/nodes/omdOperatorNode.js +108 -108
  41. package/omd/nodes/omdParenthesisNode.js +292 -292
  42. package/omd/nodes/omdPowerNode.js +235 -235
  43. package/omd/nodes/omdRationalNode.js +295 -295
  44. package/omd/nodes/omdVariableNode.js +122 -122
  45. package/omd/simplification/omdSimplification.js +140 -140
  46. package/omd/step-visualizer/omdStepVisualizer.js +947 -947
  47. package/omd/step-visualizer/omdStepVisualizerLayout.js +892 -892
  48. package/omd/utils/omdStepVisualizerInteractiveSteps.js +5 -3
  49. package/package.json +1 -1
  50. package/src/index.js +11 -0
  51. package/src/omdBalanceHanger.js +2 -1
  52. package/src/omdEquation.js +1 -1
  53. package/src/omdNumber.js +1 -1
  54. package/src/omdNumberLine.js +13 -7
  55. package/src/omdRatioChart.js +11 -0
  56. package/src/omdShapes.js +1 -1
  57. package/src/omdTapeDiagram.js +1 -1
  58. package/src/omdTerm.js +1 -1
@@ -375,9 +375,11 @@ export class omdStepVisualizerInteractiveSteps {
375
375
  alignItems: 'flex-start !important'
376
376
  };
377
377
 
378
- // Add drop shadow if requested
379
- if (this.stylingOptions.dropShadow) {
380
- baseStyles.boxShadow = '0 2px 8px rgba(0,0,0,0.15)';
378
+ // Add drop shadow if requested - but NOT to individual step boxes
379
+ // The drop shadow should only be on the outer background rectangle
380
+ // Remove any previous drop shadow from individual steps
381
+ if (stepBox.div) {
382
+ stepBox.div.style.boxShadow = 'none';
381
383
  }
382
384
 
383
385
  // Set font family if specified
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teachinglab/omd",
3
- "version": "0.2.10",
3
+ "version": "0.3.1",
4
4
  "description": "omd",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",
package/src/index.js CHANGED
@@ -8,6 +8,17 @@ export { omdTileEquation } from './omdTileEquation.js';
8
8
  // OMD Charts and Diagrams
9
9
  export { omdRatioChart } from './omdRatioChart.js';
10
10
  export { omdNumberLine } from './omdNumberLine.js';
11
+ export { omdNumberTile } from './omdNumberTile.js';
12
+
13
+ // OMD Mathematical Components
14
+ export { omdEquation } from './omdEquation.js';
15
+ export { omdExpression } from './omdExpression.js';
16
+ export { omdTerm } from './omdTerm.js';
17
+ export { omdNumber } from './omdNumber.js';
18
+ export { omdVariable } from './omdVariable.js';
19
+ export { omdPowerExpression } from './omdPowerExpression.js';
20
+ export { omdRationalExpression } from './omdRationalExpression.js';
21
+ export { omdFunction } from './omdFunction.js';
11
22
 
12
23
  // OMD Core Components
13
24
  export { omdApp } from './omdApp.js';
@@ -120,7 +120,8 @@ export class omdBalanceHanger extends jsvgGroup
120
120
  const displayHeight = Math.max(200, contentHeight + padding);
121
121
  this.setWidthAndHeight(displayWidth, displayHeight);
122
122
  this.svgObject.setAttribute("viewBox", `${-displayWidth/2} ${-displayHeight/2} ${displayWidth} ${displayHeight}`);
123
- this.setPosition(-displayWidth / 2, -displayHeight / 2);
123
+ // Don't set position since the viewBox already handles centering
124
+ // this.setPosition(-displayWidth / 2, -displayHeight / 2);
124
125
  }
125
126
 
126
127
  makeValueStack( values, xOffset, yOffset )
@@ -7,7 +7,7 @@ import { omdTerm } from "./omdTerm.js";
7
7
  import { omdExpression } from "./omdExpression.js";
8
8
  import { omdVariable } from "./omdVariable.js";
9
9
  import { omdString } from "./omdString.js";
10
-
10
+ import { omdNumber } from "./omdNumber.js";
11
11
 
12
12
  export class omdEquation extends omdMetaExpression
13
13
  {
package/src/omdNumber.js CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { omdColor } from "./omdColor.js";
3
3
  import { omdMetaExpression } from "./omdMetaExpression.js"
4
-
4
+ import { jsvgGroup, jsvgRect, jsvgTextBox } from "@teachinglab/jsvg";
5
5
  export class omdNumber extends omdMetaExpression
6
6
  {
7
7
  constructor( V = 1 )
@@ -50,13 +50,18 @@ export class omdNumberLine extends jsvgGroup
50
50
  {
51
51
  this.removeAllChildren();
52
52
 
53
+ // Set proper dimensions and viewBox for positioning
54
+ this.width = 360;
55
+ this.height = 70;
56
+ this.svgObject.setAttribute('viewBox', `0 0 ${this.width} ${this.height}`);
57
+
53
58
  // make line
54
59
  this.line = new jsvgRect();
55
60
  // this.line.setStrokeColor( "black" );
56
61
  // this.line.setStrokeWidth( 1 );
57
62
  // this.line.setEndpoints( 0,0, 300, 0 );
58
63
  this.line.setWidthAndHeight(320,5);
59
- this.line.setPosition( -10, -2.5 );
64
+ this.line.setPosition( 20, 22.5 );
60
65
  this.line.setFillColor( omdColor.mediumGray );
61
66
  this.line.setCornerRadius( 2.5 );
62
67
  this.addChild( this.line );
@@ -67,12 +72,12 @@ export class omdNumberLine extends jsvgGroup
67
72
  var N = i - this.min;
68
73
  var dX = 300 / (this.max - this.min);
69
74
 
70
- var pX = N*dX;
75
+ var pX = 30 + N*dX;
71
76
 
72
77
  var tick = new jsvgLine();
73
78
  tick.setStrokeColor( "black" );
74
79
  tick.setStrokeWidth( 1 );
75
- tick.setEndpoints( pX, -5, pX, 5 );
80
+ tick.setEndpoints( pX, 20, pX, 30 );
76
81
  this.addChild( tick );
77
82
 
78
83
  var tickText = new jsvgTextBox();
@@ -83,7 +88,7 @@ export class omdNumberLine extends jsvgGroup
83
88
  tickText.setFontSize( 10 );
84
89
  tickText.setAlignment("center");
85
90
  tickText.setText( i.toString() );
86
- tickText.setPosition( pX-15, 10 );
91
+ tickText.setPosition( pX-15, 32 );
87
92
  this.addChild( tickText );
88
93
  }
89
94
 
@@ -94,12 +99,13 @@ export class omdNumberLine extends jsvgGroup
94
99
 
95
100
  var N = V - this.min;
96
101
  var dX = 300 / (this.max - this.min);
97
- var pX = N*dX;
102
+ var pX = 30 + N*dX;
98
103
 
99
104
  var dot = new jsvgEllipse();
100
105
  dot.setFillColor( "black" );
101
- dot.setWidthAndHeight( 10,10 );
102
- dot.setPosition( pX, 0 );
106
+ dot.setStrokeWidth( 0 );
107
+ dot.setWidthAndHeight( 9,9 );
108
+ dot.setPosition( pX, 25 );
103
109
  this.addChild( dot );
104
110
  }
105
111
  }
@@ -78,6 +78,11 @@ export class omdRatioChart extends jsvgGroup
78
78
  if ( this.size == "small" )
79
79
  circleSize = 40;
80
80
 
81
+ // Set dimensions for the pie chart
82
+ this.width = circleSize;
83
+ this.height = circleSize;
84
+ this.svgObject.setAttribute('viewBox', `0 0 ${this.width} ${this.height}`);
85
+
81
86
  // holder group
82
87
  var G = new jsvgGroup();
83
88
  G.setPosition( circleSize/2, circleSize/2 );
@@ -143,6 +148,7 @@ export class omdRatioChart extends jsvgGroup
143
148
 
144
149
  this.width = R.width;
145
150
  this.height = R.height;
151
+ this.svgObject.setAttribute('viewBox', `0 0 ${this.width} ${this.height}`);
146
152
 
147
153
  // make top dots
148
154
  var pX = spacer;
@@ -204,6 +210,11 @@ export class omdRatioChart extends jsvgGroup
204
210
 
205
211
  var p = this.valueA / ( this.valueA + this.valueB );
206
212
 
213
+ // Set dimensions for the bar chart
214
+ this.width = W;
215
+ this.height = 30;
216
+ this.svgObject.setAttribute('viewBox', `0 0 ${this.width} ${this.height}`);
217
+
207
218
  var B1 = new jsvgRect();
208
219
  B1.setWidthAndHeight( W, 30 );
209
220
  // B1.setCornerRadius(5);
package/src/omdShapes.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { omdColor } from "./omdColor.js";
3
- import { jsvgGroup, jsvgPath, jsvgLine, jsvgTextLine } from "@teachinglab/jsvg";
3
+ import { jsvgGroup, jsvgPath, jsvgLine, jsvgTextLine, jsvgEllipse } from "@teachinglab/jsvg";
4
4
 
5
5
  export class omdRightTriangle extends jsvgGroup
6
6
  {
@@ -1,5 +1,5 @@
1
1
  import { omdColor } from "./omdColor.js";
2
- import { jsvgGroup, jsvgRect, jsvgTextBox } from "@teachinglab/jsvg";
2
+ import { jsvgGroup, jsvgRect, jsvgTextBox, jsvgLine} from "@teachinglab/jsvg";
3
3
 
4
4
  export class omdTapeLabel extends jsvgGroup
5
5
  {
package/src/omdTerm.js CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { omdColor } from "./omdColor.js";
3
3
  import { omdMetaExpression } from "./omdMetaExpression.js"
4
-
4
+ import { jsvgGroup, jsvgRect, jsvgTextBox } from "@teachinglab/jsvg";
5
5
  export class omdTerm extends omdMetaExpression
6
6
  {
7
7
  constructor( coefficient=1, variable='', exponent=1 )