@pie-element/graphing-solution-set 6.2.2-beta.5 → 6.2.2-beta.6
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/CHANGELOG.md +4 -0
- package/configure/CHANGELOG.md +4 -0
- package/configure/package.json +4 -4
- package/controller/CHANGELOG.md +4 -0
- package/controller/package.json +1 -1
- package/package.json +4 -4
- package/configure/lib/configure.js +0 -312
- package/configure/lib/configure.js.map +0 -1
- package/configure/lib/correct-response.js +0 -435
- package/configure/lib/correct-response.js.map +0 -1
- package/configure/lib/defaults.js +0 -357
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/graphing-config.js +0 -408
- package/configure/lib/graphing-config.js.map +0 -1
- package/configure/lib/index.js +0 -167
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/utils.js +0 -630
- package/configure/lib/utils.js.map +0 -1
- package/controller/lib/defaults.js +0 -69
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -351
- package/controller/lib/index.js.map +0 -1
- package/controller/lib/utils.js +0 -212
- package/controller/lib/utils.js.map +0 -1
- package/lib/index.js +0 -165
- package/lib/index.js.map +0 -1
- package/lib/main.js +0 -355
- package/lib/main.js.map +0 -1
- package/lib/utils.js +0 -515
- package/lib/utils.js.map +0 -1
package/controller/lib/utils.js
DELETED
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.sortedAnswers = exports.removeInvalidSegments = exports.removeInvalidAnswers = exports.removeDuplicateSegments = exports.equalSegment = exports.equalPolygon = exports.equalMarks = exports.equalLine = exports.constructSegmentsFromPoints = void 0;
|
|
7
|
-
var _lodashEs = require("lodash-es");
|
|
8
|
-
/*
|
|
9
|
-
* Constant to check equal segments
|
|
10
|
-
* @param {Object} segment1 - segment 1
|
|
11
|
-
* @param {Object} segment2 - segment 2
|
|
12
|
-
* */
|
|
13
|
-
const equalSegment = (segment1, segment2) => {
|
|
14
|
-
// A.from = B.from, A.to = B.to OR A.from = B.to, A.to = B.from
|
|
15
|
-
// x1 = x3 & y1 = y3 & x2 = x4 & y2 = y4
|
|
16
|
-
return (0, _lodashEs.isEqual)(segment1.from, segment2.from) && (0, _lodashEs.isEqual)(segment1.to, segment2.to) || (0, _lodashEs.isEqual)(segment1.to, segment2.from) && (0, _lodashEs.isEqual)(segment1.from, segment2.to);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
// this function is implemented in configure as well
|
|
20
|
-
/*
|
|
21
|
-
* Constant to get sorted answers
|
|
22
|
-
* @param {Object} answers - answers
|
|
23
|
-
* */
|
|
24
|
-
exports.equalSegment = equalSegment;
|
|
25
|
-
const sortedAnswers = answers => Object.keys(answers || {}).sort().reduce((result, key) => {
|
|
26
|
-
if (key !== 'correctAnswer') {
|
|
27
|
-
result[key] = answers[key];
|
|
28
|
-
}
|
|
29
|
-
return result;
|
|
30
|
-
}, {});
|
|
31
|
-
|
|
32
|
-
/*
|
|
33
|
-
* Constant to return line equation coefficients
|
|
34
|
-
* @param {Object} line - line
|
|
35
|
-
* */
|
|
36
|
-
exports.sortedAnswers = sortedAnswers;
|
|
37
|
-
const returnLineEquationCoefficients = line => {
|
|
38
|
-
line = {
|
|
39
|
-
...line,
|
|
40
|
-
to: {
|
|
41
|
-
...line.to
|
|
42
|
-
},
|
|
43
|
-
from: {
|
|
44
|
-
...line.from
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
const xA = line.from.x;
|
|
48
|
-
const yA = line.from.y;
|
|
49
|
-
const xB = line.to.x;
|
|
50
|
-
const yB = line.to.y;
|
|
51
|
-
return {
|
|
52
|
-
a: yB - yA,
|
|
53
|
-
b: xA - xB,
|
|
54
|
-
c: xB * yA - xA * yB
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
/*
|
|
59
|
-
* Constant to get significant decimals
|
|
60
|
-
* @param {Number} number - number
|
|
61
|
-
* */
|
|
62
|
-
const getSignificantDecimals = number => Math.round(number * 10000) / 10000;
|
|
63
|
-
|
|
64
|
-
/*
|
|
65
|
-
* Constant to check equal lines
|
|
66
|
-
* @param {Object} line1 - line 1
|
|
67
|
-
* @param {Object} line2 - line 2
|
|
68
|
-
* */
|
|
69
|
-
const equalLine = (line1, line2) => {
|
|
70
|
-
// line equation: ax + by + c = 0
|
|
71
|
-
// 2 lines are equal if a1/a2 = b1/b2 = c1/c2, where a, b, c are the coefficients in line equation
|
|
72
|
-
// line equation knowing 2 points: (y - yA) / (yB - yA) = (x - xA) / (xB - xA)
|
|
73
|
-
// extending this equation, we get: x * (yB - yA) + y * (xA - xB) + (xB * yA - xA * yB) = 0
|
|
74
|
-
// where a = yB - yA; b = xA - xB; c = xB * yA - xA * yB
|
|
75
|
-
const {
|
|
76
|
-
a: a1,
|
|
77
|
-
b: b1,
|
|
78
|
-
c: c1
|
|
79
|
-
} = returnLineEquationCoefficients(line1);
|
|
80
|
-
const {
|
|
81
|
-
a: a2,
|
|
82
|
-
b: b2,
|
|
83
|
-
c: c2
|
|
84
|
-
} = returnLineEquationCoefficients(line2);
|
|
85
|
-
const proportions = [];
|
|
86
|
-
if (a2 !== 0) {
|
|
87
|
-
proportions.push(getSignificantDecimals(a1 / a2));
|
|
88
|
-
} else if (a1 !== a2) {
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
if (b2 !== 0) {
|
|
92
|
-
proportions.push(getSignificantDecimals(b1 / b2));
|
|
93
|
-
} else if (b1 !== b2) {
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
if (c2 !== 0) {
|
|
97
|
-
proportions.push(getSignificantDecimals(c1 / c2));
|
|
98
|
-
} else if (c1 !== c2) {
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
return (0, _lodashEs.uniq)(proportions).length === 1 && line1.fill === line2.fill;
|
|
102
|
-
// (y2 - y1)/(x2 - x1) = (y4 - y3)/(x4 - x3);
|
|
103
|
-
// return ((Math.abs((line1.to.y - line1.from.y) / (line1.to.x - line1.from.x))) === (Math.abs((line2.to.y - line2.from.y) / (line2.to.x - line2.from.x))));
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
/*
|
|
107
|
-
* Constant to construct segments from points
|
|
108
|
-
* @param {Array} points - points
|
|
109
|
-
* */
|
|
110
|
-
exports.equalLine = equalLine;
|
|
111
|
-
const constructSegmentsFromPoints = points => {
|
|
112
|
-
// takes the list of points that represent a polygon and transforms it into a list of segments; eg.:
|
|
113
|
-
// points: A, B, C, D => segments: AB, BC, CD, DA
|
|
114
|
-
return (points || []).map((point, index) => ({
|
|
115
|
-
from: point,
|
|
116
|
-
to: points[(index + 1) % points.length]
|
|
117
|
-
}));
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
/*
|
|
121
|
-
* Constant to remove duplicate segments
|
|
122
|
-
* @param {Array} segments - segments
|
|
123
|
-
* */
|
|
124
|
-
exports.constructSegmentsFromPoints = constructSegmentsFromPoints;
|
|
125
|
-
const removeDuplicateSegments = segments => {
|
|
126
|
-
segments = segments || [];
|
|
127
|
-
// removes segments that are duplicates; eg. These segments are the same, so one will be removed:
|
|
128
|
-
// segment1: from: { x: 1, y: 1 }, to: { x: 2, y: 1 }
|
|
129
|
-
// segment2: from: { x: 2, y: 1 }, to: { x: 1, y: 1 }
|
|
130
|
-
return (0, _lodashEs.uniqWith)(segments, (s1, s2) => equalSegment(s1, s2));
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
/*
|
|
134
|
-
* Constant to remove invalid segments
|
|
135
|
-
* @param {Array} segments - segments
|
|
136
|
-
* */
|
|
137
|
-
exports.removeDuplicateSegments = removeDuplicateSegments;
|
|
138
|
-
const removeInvalidSegments = segments => {
|
|
139
|
-
segments = segments || [];
|
|
140
|
-
// removes segments that start in a point and end in the same point (eg.: from: { x: 1, y: 1 }, to: { x: 1, y: 1 })
|
|
141
|
-
return segments.filter(segment => !(0, _lodashEs.isEqual)(segment.from, segment.to));
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
/*
|
|
145
|
-
* Constant to check equal polygons
|
|
146
|
-
* @param {Object} poly1 - polygon 1 points
|
|
147
|
-
* @param {Object} poly2 - polygon 2 points
|
|
148
|
-
* */
|
|
149
|
-
exports.removeInvalidSegments = removeInvalidSegments;
|
|
150
|
-
const equalPolygon = (poly1, poly2) => {
|
|
151
|
-
const {
|
|
152
|
-
points: points1
|
|
153
|
-
} = poly1;
|
|
154
|
-
const {
|
|
155
|
-
points: points2
|
|
156
|
-
} = poly2;
|
|
157
|
-
// generate segments
|
|
158
|
-
const segments1 = constructSegmentsFromPoints(points1);
|
|
159
|
-
const segments2 = constructSegmentsFromPoints(points2);
|
|
160
|
-
const segments1NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments1));
|
|
161
|
-
const segments2NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments2));
|
|
162
|
-
const differentSegments1 = (0, _lodashEs.differenceWith)(segments1NoDuplicates, segments2NoDuplicates, equalSegment);
|
|
163
|
-
const differentSegments2 = (0, _lodashEs.differenceWith)(segments2NoDuplicates, segments1NoDuplicates, equalSegment);
|
|
164
|
-
return (!differentSegments1 || !differentSegments1.length) && (!differentSegments2 || !differentSegments2.length);
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
/*
|
|
168
|
-
* Constant to compare equal marks
|
|
169
|
-
* */
|
|
170
|
-
exports.equalPolygon = equalPolygon;
|
|
171
|
-
const equalMarks = exports.equalMarks = {
|
|
172
|
-
line: (sessAnswer, mark) => equalLine(sessAnswer, mark),
|
|
173
|
-
polygon: (sessAnswer, poly) => equalPolygon(sessAnswer, poly)
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
/*
|
|
177
|
-
* Check if a point is correct and complete
|
|
178
|
-
* @param {Object} point - point object
|
|
179
|
-
* */
|
|
180
|
-
const completePoint = point => point && Number.isFinite(point.x) && Number.isFinite(point.y);
|
|
181
|
-
|
|
182
|
-
/*
|
|
183
|
-
* Check if a line is complete
|
|
184
|
-
* @param {Object} item - mark object
|
|
185
|
-
* */
|
|
186
|
-
const completeFromTo = item => item && completeMark.point(item.from) && completeMark.point(item.to);
|
|
187
|
-
|
|
188
|
-
/*
|
|
189
|
-
* Check if a point is correct and complete
|
|
190
|
-
* @param {Object} item - mark object
|
|
191
|
-
* */
|
|
192
|
-
const completePoints = item => item && item.points && item.points.length && (item.points.filter(point => completePoint(point)) || []).length === item.points.length;
|
|
193
|
-
|
|
194
|
-
/*
|
|
195
|
-
* Complete mark object for line and point
|
|
196
|
-
* */
|
|
197
|
-
const completeMark = {
|
|
198
|
-
point: completePoint,
|
|
199
|
-
line: completeFromTo,
|
|
200
|
-
polygon: completePoints
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
/*
|
|
204
|
-
* Function to remove invalid answers
|
|
205
|
-
* @param {Array} answers - answers array
|
|
206
|
-
* */
|
|
207
|
-
const removeInvalidAnswers = answers => answers ? (answers || []).filter(({
|
|
208
|
-
type,
|
|
209
|
-
...answer
|
|
210
|
-
}) => completeMark[type] ? completeMark[type](answer) : false) : [];
|
|
211
|
-
exports.removeInvalidAnswers = removeInvalidAnswers;
|
|
212
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["_lodashEs","require","equalSegment","segment1","segment2","isEqual","from","to","exports","sortedAnswers","answers","Object","keys","sort","reduce","result","key","returnLineEquationCoefficients","line","xA","x","yA","y","xB","yB","a","b","c","getSignificantDecimals","number","Math","round","equalLine","line1","line2","a1","b1","c1","a2","b2","c2","proportions","push","uniq","length","fill","constructSegmentsFromPoints","points","map","point","index","removeDuplicateSegments","segments","uniqWith","s1","s2","removeInvalidSegments","filter","segment","equalPolygon","poly1","poly2","points1","points2","segments1","segments2","segments1NoDuplicates","segments2NoDuplicates","differentSegments1","differenceWith","differentSegments2","equalMarks","sessAnswer","mark","polygon","poly","completePoint","Number","isFinite","completeFromTo","item","completeMark","completePoints","removeInvalidAnswers","type","answer"],"sources":["../src/utils.js"],"sourcesContent":["import { isEqual, differenceWith, uniq, uniqWith } from 'lodash-es';\n\n/*\n * Constant to check equal segments\n * @param {Object} segment1 - segment 1\n * @param {Object} segment2 - segment 2\n * */\nexport const equalSegment = (segment1, segment2) => {\n // A.from = B.from, A.to = B.to OR A.from = B.to, A.to = B.from\n // x1 = x3 & y1 = y3 & x2 = x4 & y2 = y4\n return (\n (isEqual(segment1.from, segment2.from) && isEqual(segment1.to, segment2.to)) ||\n (isEqual(segment1.to, segment2.from) && isEqual(segment1.from, segment2.to))\n );\n};\n\n// this function is implemented in configure as well\n/*\n * Constant to get sorted answers\n * @param {Object} answers - answers\n * */\nexport const sortedAnswers = (answers) =>\n Object.keys(answers || {})\n .sort()\n .reduce((result, key) => {\n if (key !== 'correctAnswer') {\n result[key] = answers[key];\n }\n return result;\n }, {});\n\n/*\n * Constant to return line equation coefficients\n * @param {Object} line - line\n * */\nconst returnLineEquationCoefficients = (line) => {\n line = { ...line, to: { ...line.to }, from: { ...line.from } };\n const xA = line.from.x;\n const yA = line.from.y;\n const xB = line.to.x;\n const yB = line.to.y;\n return {\n a: yB - yA,\n b: xA - xB,\n c: xB * yA - xA * yB,\n };\n};\n\n/*\n * Constant to get significant decimals\n * @param {Number} number - number\n * */\nconst getSignificantDecimals = (number) => Math.round(number * 10000) / 10000;\n\n/*\n * Constant to check equal lines\n * @param {Object} line1 - line 1\n * @param {Object} line2 - line 2\n * */\nexport const equalLine = (line1, line2) => {\n // line equation: ax + by + c = 0\n // 2 lines are equal if a1/a2 = b1/b2 = c1/c2, where a, b, c are the coefficients in line equation\n // line equation knowing 2 points: (y - yA) / (yB - yA) = (x - xA) / (xB - xA)\n // extending this equation, we get: x * (yB - yA) + y * (xA - xB) + (xB * yA - xA * yB) = 0\n // where a = yB - yA; b = xA - xB; c = xB * yA - xA * yB\n const { a: a1, b: b1, c: c1 } = returnLineEquationCoefficients(line1);\n const { a: a2, b: b2, c: c2 } = returnLineEquationCoefficients(line2);\n const proportions = [];\n if (a2 !== 0) {\n proportions.push(getSignificantDecimals(a1 / a2));\n } else if (a1 !== a2) {\n return false;\n }\n if (b2 !== 0) {\n proportions.push(getSignificantDecimals(b1 / b2));\n } else if (b1 !== b2) {\n return false;\n }\n if (c2 !== 0) {\n proportions.push(getSignificantDecimals(c1 / c2));\n } else if (c1 !== c2) {\n return false;\n }\n return uniq(proportions).length === 1 && line1.fill === line2.fill;\n // (y2 - y1)/(x2 - x1) = (y4 - y3)/(x4 - x3);\n // return ((Math.abs((line1.to.y - line1.from.y) / (line1.to.x - line1.from.x))) === (Math.abs((line2.to.y - line2.from.y) / (line2.to.x - line2.from.x))));\n};\n\n/*\n * Constant to construct segments from points\n * @param {Array} points - points\n * */\nexport const constructSegmentsFromPoints = (points) => {\n // takes the list of points that represent a polygon and transforms it into a list of segments; eg.:\n // points: A, B, C, D => segments: AB, BC, CD, DA\n return (points || []).map((point, index) => ({ from: point, to: points[(index + 1) % points.length] }));\n};\n\n/*\n * Constant to remove duplicate segments\n * @param {Array} segments - segments\n * */\nexport const removeDuplicateSegments = (segments) => {\n segments = segments || [];\n // removes segments that are duplicates; eg. These segments are the same, so one will be removed:\n // segment1: from: { x: 1, y: 1 }, to: { x: 2, y: 1 }\n // segment2: from: { x: 2, y: 1 }, to: { x: 1, y: 1 }\n return uniqWith(segments, (s1, s2) => equalSegment(s1, s2));\n};\n\n/*\n * Constant to remove invalid segments\n * @param {Array} segments - segments\n * */\nexport const removeInvalidSegments = (segments) => {\n segments = segments || [];\n // removes segments that start in a point and end in the same point (eg.: from: { x: 1, y: 1 }, to: { x: 1, y: 1 })\n return segments.filter((segment) => !isEqual(segment.from, segment.to));\n};\n\n/*\n * Constant to check equal polygons\n * @param {Object} poly1 - polygon 1 points\n * @param {Object} poly2 - polygon 2 points\n * */\nexport const equalPolygon = (poly1, poly2) => {\n const { points: points1 } = poly1;\n const { points: points2 } = poly2;\n // generate segments\n const segments1 = constructSegmentsFromPoints(points1);\n const segments2 = constructSegmentsFromPoints(points2);\n const segments1NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments1));\n const segments2NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments2));\n const differentSegments1 = differenceWith(segments1NoDuplicates, segments2NoDuplicates, equalSegment);\n const differentSegments2 = differenceWith(segments2NoDuplicates, segments1NoDuplicates, equalSegment);\n return (!differentSegments1 || !differentSegments1.length) && (!differentSegments2 || !differentSegments2.length);\n};\n\n/*\n * Constant to compare equal marks\n * */\nexport const equalMarks = {\n line: (sessAnswer, mark) => equalLine(sessAnswer, mark),\n polygon: (sessAnswer, poly) => equalPolygon(sessAnswer, poly),\n};\n\n/*\n * Check if a point is correct and complete\n * @param {Object} point - point object\n * */\nconst completePoint = (point) => point && Number.isFinite(point.x) && Number.isFinite(point.y);\n\n/*\n * Check if a line is complete\n * @param {Object} item - mark object\n * */\nconst completeFromTo = (item) => item && completeMark.point(item.from) && completeMark.point(item.to);\n\n/*\n * Check if a point is correct and complete\n * @param {Object} item - mark object\n * */\nconst completePoints = (item) =>\n item &&\n item.points &&\n item.points.length &&\n (item.points.filter((point) => completePoint(point)) || []).length === item.points.length;\n\n/*\n * Complete mark object for line and point\n * */\nconst completeMark = {\n point: completePoint,\n line: completeFromTo,\n polygon: completePoints,\n};\n\n/*\n * Function to remove invalid answers\n * @param {Array} answers - answers array\n * */\nexport const removeInvalidAnswers = (answers) =>\n answers\n ? (answers || []).filter(({ type, ...answer }) => (completeMark[type] ? completeMark[type](answer) : false))\n : [];\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMC,YAAY,GAAGA,CAACC,QAAQ,EAAEC,QAAQ,KAAK;EAClD;EACA;EACA,OACG,IAAAC,iBAAO,EAACF,QAAQ,CAACG,IAAI,EAAEF,QAAQ,CAACE,IA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AAC+B,IAAI,CAAC1E,IAAI,CAAC,IAAI2E,YAAY,CAAChC,KAAK,CAAC+B,IAAI,CAACzE,EAAE,CAAC;;AAErG;AACA;AACA;AACA;AACA,MAAM2E,cAAc,GAAIF,IAAI,IAC1BA,IAAI,IACJA,IAAI,CAACjC,MAAM,IACXiC,IAAI,CAACjC,MAAM,CAACH,MAAM,IAClB,CAACoC,IAAI,CAACjC,MAAM,CAACU,MAAM,CAAER,KAAK,IAAK2B,aAAa,CAAC3B,KAAK,CAAC,CAAC,IAAI,EAAE,EAAEL,MAAM,KAAKoC,IAAI,CAACjC,MAAM,CAACH,MAAM;;AAE3F;AACA;AACA;AACA,MAAMqC,YAAY,GAAG;EACnBhC,KAAK,EAAE2B,aAAa;EACpB1D,IAAI,EAAE6D,cAAc;EACpBL,OAAO,EAAEQ;AACX,CAAC;;AAED;AACA;AACA;AACA;AACO,MAAMC,oBAAoB,GAAIzE,OAAO,IAC1CA,OAAO,GACH,CAACA,OAAO,IAAI,EAAE,EAAE+C,MAAM,CAAC,CAAC;EAAE2B,IAAI;EAAE,GAAGC;AAAO,CAAC,KAAMJ,YAAY,CAACG,IAAI,CAAC,GAAGH,YAAY,CAACG,IAAI,CAAC,CAACC,MAAM,CAAC,GAAG,KAAM,CAAC,GAC1G,EAAE;AAAC7E,OAAA,CAAA2E,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
package/lib/index.js
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
Object.defineProperty(exports, "Component", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return _main.default;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
exports.default = void 0;
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
var _react = _interopRequireDefault(require("react"));
|
|
16
|
-
var _client = require("react-dom/client");
|
|
17
|
-
var _piePlayerEvents = require("@pie-framework/pie-player-events");
|
|
18
|
-
var _mathRendering = require("@pie-lib/math-rendering");
|
|
19
|
-
var _utils = require("./utils");
|
|
20
|
-
var _main = _interopRequireDefault(require("./main"));
|
|
21
|
-
class Graphing extends HTMLElement {
|
|
22
|
-
constructor() {
|
|
23
|
-
super();
|
|
24
|
-
/*
|
|
25
|
-
* Is complete function
|
|
26
|
-
* @param {object} answer - Answer object
|
|
27
|
-
* */
|
|
28
|
-
(0, _defineProperty2.default)(this, "isComplete", answer => Array.isArray(answer) && answer.length > 0);
|
|
29
|
-
/*
|
|
30
|
-
* Callback function to change answers
|
|
31
|
-
* @param {object} answer - Answer object
|
|
32
|
-
* @param {boolean} isUndoOperation - Boolean value to check if undo operation is performed
|
|
33
|
-
* */
|
|
34
|
-
(0, _defineProperty2.default)(this, "changeAnswers", (answer, isUndoOperation) => {
|
|
35
|
-
// avoid removeInvalidObjects when undo or redo operations are executed
|
|
36
|
-
// in order to preserve the logic of undo and redo
|
|
37
|
-
const {
|
|
38
|
-
gssData
|
|
39
|
-
} = this._model;
|
|
40
|
-
if (gssData.selectedTool === 'lineA' && answer.length > 0) {
|
|
41
|
-
answer[0].fill = gssData['lineA'].lineType;
|
|
42
|
-
}
|
|
43
|
-
if (gssData.selectedTool === 'lineB' && answer.length > 1) {
|
|
44
|
-
answer[1].fill = gssData['lineB'].lineType;
|
|
45
|
-
}
|
|
46
|
-
if (answer.length === 0) {
|
|
47
|
-
gssData.selectedTool = 'lineA';
|
|
48
|
-
this._model.gssData = gssData;
|
|
49
|
-
}
|
|
50
|
-
if (!isUndoOperation) {
|
|
51
|
-
this._session.answer = (0, _utils.removeInvalidAnswers)(answer);
|
|
52
|
-
} else {
|
|
53
|
-
this._session.answer = answer;
|
|
54
|
-
}
|
|
55
|
-
this.dispatchEvent(new _piePlayerEvents.SessionChangedEvent(this.tagName.toLowerCase(), this.isComplete(this._session.answer)));
|
|
56
|
-
this._render();
|
|
57
|
-
});
|
|
58
|
-
/*
|
|
59
|
-
* Function to set gssData object and session object
|
|
60
|
-
* @param {object} gssData - GSS Data object
|
|
61
|
-
* @param {object} session - Session object
|
|
62
|
-
* */
|
|
63
|
-
(0, _defineProperty2.default)(this, "setGssData", (gssData, session) => {
|
|
64
|
-
this._model.gssData = gssData;
|
|
65
|
-
this._session = session;
|
|
66
|
-
this.dispatchEvent(new _piePlayerEvents.SessionChangedEvent(this.tagName.toLowerCase(), this.isComplete(this._session.answer)));
|
|
67
|
-
this._render();
|
|
68
|
-
});
|
|
69
|
-
this._root = null;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/*
|
|
73
|
-
* Function to set model
|
|
74
|
-
* @param {object} m - Model object
|
|
75
|
-
* */
|
|
76
|
-
set model(m) {
|
|
77
|
-
this._model = m;
|
|
78
|
-
this._render();
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/*
|
|
82
|
-
* Function to set session
|
|
83
|
-
* @param {object} s - Session object
|
|
84
|
-
* */
|
|
85
|
-
set session(s) {
|
|
86
|
-
this._session = s;
|
|
87
|
-
if (!this._session.answer) {
|
|
88
|
-
this._session.answer = [];
|
|
89
|
-
}
|
|
90
|
-
const {
|
|
91
|
-
answer
|
|
92
|
-
} = this._session || {};
|
|
93
|
-
const {
|
|
94
|
-
gssLineData,
|
|
95
|
-
domain,
|
|
96
|
-
range
|
|
97
|
-
} = this._model;
|
|
98
|
-
let section = answer && answer.filter(mark => mark.type === 'polygon').length > 0;
|
|
99
|
-
if (gssLineData.numberOfLines === 1) {
|
|
100
|
-
this._model.gssData = {
|
|
101
|
-
numberOfLines: 1,
|
|
102
|
-
selectedTool: section ? 'solutionSet' : 'lineA',
|
|
103
|
-
sections: [],
|
|
104
|
-
lineA: {
|
|
105
|
-
lineType: answer && answer.length > 0 ? answer[0].fill : 'Solid'
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
} else {
|
|
109
|
-
this._model.gssData = {
|
|
110
|
-
numberOfLines: 2,
|
|
111
|
-
selectedTool: section ? 'solutionSet' : 'lineA',
|
|
112
|
-
sections: [],
|
|
113
|
-
lineA: {
|
|
114
|
-
lineType: answer && answer.length > 0 ? answer[0].fill : 'Solid'
|
|
115
|
-
},
|
|
116
|
-
lineB: {
|
|
117
|
-
lineType: answer && answer.length > 1 ? answer[1].fill : 'Solid'
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
if (section) {
|
|
122
|
-
this._model.gssData = (0, _utils.findSectionsInSolutionSet)(this._model.gssData, answer, domain, range);
|
|
123
|
-
}
|
|
124
|
-
this._render();
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/*
|
|
128
|
-
* Function to get session
|
|
129
|
-
* */
|
|
130
|
-
get session() {
|
|
131
|
-
return this._session;
|
|
132
|
-
}
|
|
133
|
-
connectedCallback() {
|
|
134
|
-
this._render();
|
|
135
|
-
}
|
|
136
|
-
/*
|
|
137
|
-
* Render function
|
|
138
|
-
* */
|
|
139
|
-
_render() {
|
|
140
|
-
if (!this._model || !this._session) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
const el = /*#__PURE__*/_react.default.createElement(_main.default, {
|
|
144
|
-
model: this._model,
|
|
145
|
-
session: this._session,
|
|
146
|
-
onAnswersChange: this.changeAnswers,
|
|
147
|
-
setGssData: this.setGssData
|
|
148
|
-
});
|
|
149
|
-
if (!this._root) {
|
|
150
|
-
this._root = (0, _client.createRoot)(this);
|
|
151
|
-
}
|
|
152
|
-
this._root.render(el);
|
|
153
|
-
queueMicrotask(() => {
|
|
154
|
-
(0, _mathRendering.renderMath)(this);
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
disconnectedCallback() {
|
|
158
|
-
if (this._root) {
|
|
159
|
-
this._root.unmount();
|
|
160
|
-
this._root = null;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
exports.default = Graphing;
|
|
165
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_client","_piePlayerEvents","_mathRendering","_utils","_main","Graphing","HTMLElement","constructor","_defineProperty2","default","answer","Array","isArray","length","isUndoOperation","gssData","_model","selectedTool","fill","lineType","_session","removeInvalidAnswers","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","isComplete","_render","session","_root","model","m","s","gssLineData","domain","range","section","filter","mark","type","numberOfLines","sections","lineA","lineB","findSectionsInSolutionSet","connectedCallback","el","React","createElement","Main","onAnswersChange","changeAnswers","setGssData","createRoot","render","queueMicrotask","renderMath","disconnectedCallback","unmount","exports"],"sources":["../src/index.js"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { SessionChangedEvent } from '@pie-framework/pie-player-events';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport { findSectionsInSolutionSet, removeInvalidAnswers } from './utils';\nimport Main from './main';\n\nexport { Main as Component };\n\nexport default class Graphing extends HTMLElement {\n constructor() {\n super();\n this._root = null;\n }\n\n /*\n * Function to set model\n * @param {object} m - Model object\n * */\n set model(m) {\n this._model = m;\n this._render();\n }\n\n /*\n * Function to set session\n * @param {object} s - Session object\n * */\n set session(s) {\n this._session = s;\n if (!this._session.answer) {\n this._session.answer = [];\n }\n const { answer } = this._session || {};\n const { gssLineData, domain, range } = this._model;\n let section = answer && answer.filter((mark) => mark.type === 'polygon').length > 0;\n if (gssLineData.numberOfLines === 1) {\n this._model.gssData = {\n numberOfLines: 1,\n selectedTool: section ? 'solutionSet' : 'lineA',\n sections: [],\n lineA: {\n lineType: answer && answer.length > 0 ? answer[0].fill : 'Solid',\n },\n };\n } else {\n this._model.gssData = {\n numberOfLines: 2,\n selectedTool: section ? 'solutionSet' : 'lineA',\n sections: [],\n lineA: {\n lineType: answer && answer.length > 0 ? answer[0].fill : 'Solid',\n },\n lineB: {\n lineType: answer && answer.length > 1 ? answer[1].fill : 'Solid',\n },\n };\n }\n if (section) {\n this._model.gssData = findSectionsInSolutionSet(this._model.gssData, answer, domain, range);\n }\n this._render();\n }\n\n /*\n * Function to get session\n * */\n get session() {\n return this._session;\n }\n\n connectedCallback() {\n this._render();\n }\n\n /*\n * Is complete function\n * @param {object} answer - Answer object\n * */\n isComplete = (answer) => Array.isArray(answer) && answer.length > 0;\n\n /*\n * Callback function to change answers\n * @param {object} answer - Answer object\n * @param {boolean} isUndoOperation - Boolean value to check if undo operation is performed\n * */\n changeAnswers = (answer, isUndoOperation) => {\n // avoid removeInvalidObjects when undo or redo operations are executed\n // in order to preserve the logic of undo and redo\n const { gssData } = this._model;\n if (gssData.selectedTool === 'lineA' && answer.length > 0) {\n answer[0].fill = gssData['lineA'].lineType;\n }\n if (gssData.selectedTool === 'lineB' && answer.length > 1) {\n answer[1].fill = gssData['lineB'].lineType;\n }\n if (answer.length === 0) {\n gssData.selectedTool = 'lineA';\n this._model.gssData = gssData;\n }\n if (!isUndoOperation) {\n this._session.answer = removeInvalidAnswers(answer);\n } else {\n this._session.answer = answer;\n }\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this.isComplete(this._session.answer)));\n this._render();\n };\n\n /*\n * Function to set gssData object and session object\n * @param {object} gssData - GSS Data object\n * @param {object} session - Session object\n * */\n setGssData = (gssData, session) => {\n this._model.gssData = gssData;\n this._session = session;\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this.isComplete(this._session.answer)));\n this._render();\n };\n\n /*\n * Render function\n * */\n _render() {\n if (!this._model || !this._session) {\n return;\n }\n const el = React.createElement(Main, {\n model: this._model,\n session: this._session,\n onAnswersChange: this.changeAnswers,\n setGssData: this.setGssData,\n });\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(el);\n queueMicrotask(() => {\n renderMath(this);\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