@teachinglab/omd 0.3.0 → 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.
- package/docs/api/configuration-options.md +198 -198
- package/docs/api/eventManager.md +82 -82
- package/docs/api/focusFrameManager.md +144 -144
- package/docs/api/index.md +105 -105
- package/docs/api/main.md +62 -62
- package/docs/api/omdBinaryExpressionNode.md +86 -86
- package/docs/api/omdCanvas.md +83 -83
- package/docs/api/omdConfigManager.md +112 -112
- package/docs/api/omdConstantNode.md +52 -52
- package/docs/api/omdDisplay.md +87 -87
- package/docs/api/omdEquationNode.md +174 -174
- package/docs/api/omdEquationSequenceNode.md +258 -258
- package/docs/api/omdEquationStack.md +156 -156
- package/docs/api/omdFunctionNode.md +82 -82
- package/docs/api/omdGroupNode.md +78 -78
- package/docs/api/omdHelpers.md +87 -87
- package/docs/api/omdLeafNode.md +85 -85
- package/docs/api/omdNode.md +201 -201
- package/docs/api/omdOperationDisplayNode.md +117 -117
- package/docs/api/omdOperatorNode.md +91 -91
- package/docs/api/omdParenthesisNode.md +133 -133
- package/docs/api/omdPopup.md +191 -191
- package/docs/api/omdPowerNode.md +131 -131
- package/docs/api/omdRationalNode.md +144 -144
- package/docs/api/omdSimplification.md +78 -78
- package/docs/api/omdSqrtNode.md +144 -144
- package/docs/api/omdStepVisualizer.md +146 -146
- package/docs/api/omdStepVisualizerHighlighting.md +65 -65
- package/docs/api/omdStepVisualizerInteractiveSteps.md +108 -108
- package/docs/api/omdStepVisualizerLayout.md +70 -70
- package/docs/api/omdStepVisualizerTextBoxes.md +76 -76
- package/docs/api/omdTranscriptionService.md +95 -95
- package/docs/api/omdTreeDiff.md +169 -169
- package/docs/api/omdUnaryExpressionNode.md +137 -137
- package/docs/api/omdUtilities.md +82 -82
- package/docs/api/omdVariableNode.md +123 -123
- package/omd/nodes/omdConstantNode.js +141 -141
- package/omd/nodes/omdGroupNode.js +67 -67
- package/omd/nodes/omdLeafNode.js +76 -76
- package/omd/nodes/omdOperatorNode.js +108 -108
- package/omd/nodes/omdParenthesisNode.js +292 -292
- package/omd/nodes/omdPowerNode.js +235 -235
- package/omd/nodes/omdRationalNode.js +295 -295
- package/omd/nodes/omdVariableNode.js +122 -122
- package/omd/simplification/omdSimplification.js +140 -140
- package/omd/step-visualizer/omdStepVisualizer.js +947 -947
- package/omd/step-visualizer/omdStepVisualizerLayout.js +892 -892
- package/package.json +1 -1
- package/src/index.js +11 -0
- package/src/omdBalanceHanger.js +2 -1
- package/src/omdEquation.js +1 -1
- package/src/omdNumber.js +1 -1
- package/src/omdNumberLine.js +13 -7
- package/src/omdRatioChart.js +11 -0
- package/src/omdShapes.js +1 -1
- package/src/omdTapeDiagram.js +1 -1
- package/src/omdTerm.js +1 -1
package/package.json
CHANGED
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';
|
package/src/omdBalanceHanger.js
CHANGED
|
@@ -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
|
-
|
|
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 )
|
package/src/omdEquation.js
CHANGED
|
@@ -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
package/src/omdNumberLine.js
CHANGED
|
@@ -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(
|
|
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,
|
|
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,
|
|
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.
|
|
102
|
-
dot.
|
|
106
|
+
dot.setStrokeWidth( 0 );
|
|
107
|
+
dot.setWidthAndHeight( 9,9 );
|
|
108
|
+
dot.setPosition( pX, 25 );
|
|
103
109
|
this.addChild( dot );
|
|
104
110
|
}
|
|
105
111
|
}
|
package/src/omdRatioChart.js
CHANGED
|
@@ -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
|
{
|
package/src/omdTapeDiagram.js
CHANGED
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 )
|