@pie-element/number-line 13.1.2-next.5 → 13.1.3
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.json +1247 -0
- package/CHANGELOG.md +2447 -0
- package/LICENSE.md +5 -0
- package/README.md +28 -0
- package/configure/CHANGELOG.json +827 -0
- package/configure/CHANGELOG.md +2094 -0
- package/configure/lib/arrows.js +89 -0
- package/configure/lib/arrows.js.map +1 -0
- package/configure/lib/card-bar.js +57 -0
- package/configure/lib/card-bar.js.map +1 -0
- package/configure/lib/defaults.js +177 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/domain.js +87 -0
- package/configure/lib/domain.js.map +1 -0
- package/configure/lib/index.js +176 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/main.js +815 -0
- package/configure/lib/main.js.map +1 -0
- package/configure/lib/number-text-field.js +26 -0
- package/configure/lib/number-text-field.js.map +1 -0
- package/configure/lib/point-config.js +84 -0
- package/configure/lib/point-config.js.map +1 -0
- package/configure/lib/size.js +66 -0
- package/configure/lib/size.js.map +1 -0
- package/configure/lib/ticks.js +234 -0
- package/configure/lib/ticks.js.map +1 -0
- package/configure/lib/utils.js +12 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +20 -0
- package/controller/CHANGELOG.json +332 -0
- package/controller/CHANGELOG.md +1360 -0
- package/controller/lib/defaults.js +56 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +430 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/lib/tickUtils.js +294 -0
- package/controller/lib/tickUtils.js.map +1 -0
- package/controller/lib/utils.js +168 -0
- package/controller/lib/utils.js.map +1 -0
- package/controller/package.json +20 -0
- package/demo.gif +0 -0
- package/docs/config-schema.json +2532 -0
- package/docs/config-schema.json.md +1844 -0
- package/docs/demo/config.js +8 -0
- package/docs/demo/generate.js +39 -0
- package/docs/demo/index.html +1 -0
- package/docs/pie-schema.json +2461 -0
- package/docs/pie-schema.json.md +1228 -0
- package/docs/schemas/config.json +256 -0
- package/lib/data-converter.js +96 -0
- package/lib/data-converter.js.map +1 -0
- package/lib/draggable/index.js +114 -0
- package/lib/draggable/index.js.map +1 -0
- package/lib/index.js +196 -0
- package/lib/index.js.map +1 -0
- package/lib/number-line/colors.js +11 -0
- package/lib/number-line/colors.js.map +1 -0
- package/lib/number-line/feedback.js +92 -0
- package/lib/number-line/feedback.js.map +1 -0
- package/lib/number-line/graph/arrow.js +44 -0
- package/lib/number-line/graph/arrow.js.map +1 -0
- package/lib/number-line/graph/elements/base.js +20 -0
- package/lib/number-line/graph/elements/base.js.map +1 -0
- package/lib/number-line/graph/elements/builder.js +37 -0
- package/lib/number-line/graph/elements/builder.js.map +1 -0
- package/lib/number-line/graph/elements/line.js +259 -0
- package/lib/number-line/graph/elements/line.js.map +1 -0
- package/lib/number-line/graph/elements/point.js +204 -0
- package/lib/number-line/graph/elements/point.js.map +1 -0
- package/lib/number-line/graph/elements/ray.js +190 -0
- package/lib/number-line/graph/elements/ray.js.map +1 -0
- package/lib/number-line/graph/index.js +262 -0
- package/lib/number-line/graph/index.js.map +1 -0
- package/lib/number-line/graph/line.js +38 -0
- package/lib/number-line/graph/line.js.map +1 -0
- package/lib/number-line/graph/stacks.js +78 -0
- package/lib/number-line/graph/stacks.js.map +1 -0
- package/lib/number-line/graph/tick-utils.js +347 -0
- package/lib/number-line/graph/tick-utils.js.map +1 -0
- package/lib/number-line/graph/ticks.js +188 -0
- package/lib/number-line/graph/ticks.js.map +1 -0
- package/lib/number-line/index.js +384 -0
- package/lib/number-line/index.js.map +1 -0
- package/lib/number-line/point-chooser/button.js +49 -0
- package/lib/number-line/point-chooser/button.js.map +1 -0
- package/lib/number-line/point-chooser/img.js +8 -0
- package/lib/number-line/point-chooser/img.js.map +1 -0
- package/lib/number-line/point-chooser/index.js +197 -0
- package/lib/number-line/point-chooser/index.js.map +1 -0
- package/lib/number-line/point-chooser/styles.js +77 -0
- package/lib/number-line/point-chooser/styles.js.map +1 -0
- package/lib/number-line/transitions/fade.js +88 -0
- package/lib/number-line/transitions/fade.js.map +1 -0
- package/lib/number-line/transitions/index.js +14 -0
- package/lib/number-line/transitions/index.js.map +1 -0
- package/package.json +22 -87
- package/configure.js +0 -2
- package/controller.js +0 -1
- package/dist/_virtual/_rolldown/runtime.js +0 -11
- package/dist/author/arrows.d.ts +0 -28
- package/dist/author/arrows.js +0 -69
- package/dist/author/card-bar.d.ts +0 -20
- package/dist/author/card-bar.js +0 -41
- package/dist/author/defaults.d.ts +0 -178
- package/dist/author/defaults.js +0 -144
- package/dist/author/domain.d.ts +0 -15
- package/dist/author/domain.js +0 -54
- package/dist/author/index.d.ts +0 -23
- package/dist/author/index.js +0 -89
- package/dist/author/main.d.ts +0 -44
- package/dist/author/main.js +0 -485
- package/dist/author/number-text-field.d.ts +0 -13
- package/dist/author/number-text-field.js +0 -13
- package/dist/author/point-config.d.ts +0 -25
- package/dist/author/point-config.js +0 -69
- package/dist/author/size.d.ts +0 -24
- package/dist/author/size.js +0 -48
- package/dist/author/ticks.d.ts +0 -22
- package/dist/author/ticks.js +0 -115
- package/dist/author/utils.d.ts +0 -9
- package/dist/author/utils.js +0 -4
- package/dist/browser/author/index.js +0 -46162
- package/dist/browser/author/index.js.map +0 -1
- package/dist/browser/controller/index.js +0 -569
- package/dist/browser/controller/index.js.map +0 -1
- package/dist/browser/delivery/index.js +0 -2
- package/dist/browser/delivery-bcOQIdko.js +0 -17953
- package/dist/browser/delivery-bcOQIdko.js.map +0 -1
- package/dist/browser/dist-BnIaVPcz.js +0 -19042
- package/dist/browser/dist-BnIaVPcz.js.map +0 -1
- package/dist/browser/impureFunctionsAny.generated-BwG6hrJc.js +0 -10162
- package/dist/browser/impureFunctionsAny.generated-BwG6hrJc.js.map +0 -1
- package/dist/browser/number-line.css +0 -2
- package/dist/controller/defaults.d.ts +0 -58
- package/dist/controller/defaults.js +0 -50
- package/dist/controller/index.d.ts +0 -47
- package/dist/controller/index.js +0 -165
- package/dist/controller/tickUtils.d.ts +0 -21
- package/dist/controller/tickUtils.js +0 -252
- package/dist/controller/utils.d.ts +0 -9
- package/dist/controller/utils.js +0 -68
- package/dist/delivery/data-converter.d.ts +0 -64
- package/dist/delivery/data-converter.js +0 -70
- package/dist/delivery/draggable/index.d.ts +0 -33
- package/dist/delivery/draggable/index.js +0 -39
- package/dist/delivery/index.d.ts +0 -35
- package/dist/delivery/index.js +0 -109
- package/dist/delivery/number-line/colors.d.ts +0 -11
- package/dist/delivery/number-line/colors.js +0 -5
- package/dist/delivery/number-line/feedback.d.ts +0 -19
- package/dist/delivery/number-line/feedback.js +0 -57
- package/dist/delivery/number-line/graph/arrow.d.ts +0 -30
- package/dist/delivery/number-line/graph/arrow.js +0 -27
- package/dist/delivery/number-line/graph/elements/base.d.ts +0 -16
- package/dist/delivery/number-line/graph/elements/base.js +0 -11
- package/dist/delivery/number-line/graph/elements/builder.d.ts +0 -33
- package/dist/delivery/number-line/graph/elements/builder.js +0 -30
- package/dist/delivery/number-line/graph/elements/line.d.ts +0 -51
- package/dist/delivery/number-line/graph/elements/line.js +0 -188
- package/dist/delivery/number-line/graph/elements/point.d.ts +0 -43
- package/dist/delivery/number-line/graph/elements/point.js +0 -127
- package/dist/delivery/number-line/graph/elements/ray.d.ts +0 -43
- package/dist/delivery/number-line/graph/elements/ray.js +0 -130
- package/dist/delivery/number-line/graph/index.d.ts +0 -59
- package/dist/delivery/number-line/graph/index.js +0 -196
- package/dist/delivery/number-line/graph/line.d.ts +0 -46
- package/dist/delivery/number-line/graph/line.js +0 -27
- package/dist/delivery/number-line/graph/stacks.d.ts +0 -10
- package/dist/delivery/number-line/graph/stacks.js +0 -40
- package/dist/delivery/number-line/graph/tick-utils.d.ts +0 -80
- package/dist/delivery/number-line/graph/tick-utils.js +0 -295
- package/dist/delivery/number-line/graph/ticks.d.ts +0 -46
- package/dist/delivery/number-line/graph/ticks.js +0 -115
- package/dist/delivery/number-line/index.d.ts +0 -35
- package/dist/delivery/number-line/index.js +0 -215
- package/dist/delivery/number-line/point-chooser/button.d.ts +0 -31
- package/dist/delivery/number-line/point-chooser/button.js +0 -36
- package/dist/delivery/number-line/point-chooser/img.d.ts +0 -10
- package/dist/delivery/number-line/point-chooser/img.js +0 -4
- package/dist/delivery/number-line/point-chooser/index.d.ts +0 -37
- package/dist/delivery/number-line/point-chooser/index.js +0 -154
- package/dist/delivery/number-line/point-chooser/styles.d.ts +0 -192
- package/dist/delivery/number-line/transitions/fade.d.ts +0 -34
- package/dist/delivery/number-line/transitions/fade.js +0 -75
- package/dist/delivery/number-line/transitions/index.d.ts +0 -10
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -197
- package/dist/index.js +0 -2
- package/dist/runtime-support.d.ts +0 -12
- package/dist/runtime-support.js +0 -12
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/number-line/controller/src/defaults.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
declare const _default: {
|
|
10
|
-
correctResponse: never[];
|
|
11
|
-
feedback: {
|
|
12
|
-
correct: {
|
|
13
|
-
default: string;
|
|
14
|
-
type: string;
|
|
15
|
-
};
|
|
16
|
-
incorrect: {
|
|
17
|
-
default: string;
|
|
18
|
-
type: string;
|
|
19
|
-
};
|
|
20
|
-
partial: {
|
|
21
|
-
default: string;
|
|
22
|
-
type: string;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
graph: {
|
|
26
|
-
arrows: {
|
|
27
|
-
left: boolean;
|
|
28
|
-
right: boolean;
|
|
29
|
-
};
|
|
30
|
-
availableTypes: {
|
|
31
|
-
PF: boolean;
|
|
32
|
-
};
|
|
33
|
-
domain: {
|
|
34
|
-
min: number;
|
|
35
|
-
max: number;
|
|
36
|
-
};
|
|
37
|
-
exhibitOnly: boolean;
|
|
38
|
-
initialElements: never[];
|
|
39
|
-
initialType: string;
|
|
40
|
-
maxNumberOfPoints: number;
|
|
41
|
-
ticks: {
|
|
42
|
-
minor: number;
|
|
43
|
-
major: number;
|
|
44
|
-
tickIntervalType: string;
|
|
45
|
-
};
|
|
46
|
-
title: string;
|
|
47
|
-
width: number;
|
|
48
|
-
};
|
|
49
|
-
prompt: string;
|
|
50
|
-
promptEnabled: boolean;
|
|
51
|
-
rationale: string;
|
|
52
|
-
rationaleEnabled: boolean;
|
|
53
|
-
teacherInstructions: string;
|
|
54
|
-
teacherInstructionsEnabled: boolean;
|
|
55
|
-
toolbarEditorPosition: string;
|
|
56
|
-
widthEnabled: boolean;
|
|
57
|
-
};
|
|
58
|
-
export default _default;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
//#region src/controller/defaults.ts
|
|
2
|
-
var e = {
|
|
3
|
-
correctResponse: [],
|
|
4
|
-
feedback: {
|
|
5
|
-
correct: {
|
|
6
|
-
default: "Correct",
|
|
7
|
-
type: "none"
|
|
8
|
-
},
|
|
9
|
-
incorrect: {
|
|
10
|
-
default: "Incorrect",
|
|
11
|
-
type: "none"
|
|
12
|
-
},
|
|
13
|
-
partial: {
|
|
14
|
-
default: "Nearly",
|
|
15
|
-
type: "none"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
graph: {
|
|
19
|
-
arrows: {
|
|
20
|
-
left: !0,
|
|
21
|
-
right: !0
|
|
22
|
-
},
|
|
23
|
-
availableTypes: { PF: !0 },
|
|
24
|
-
domain: {
|
|
25
|
-
min: -1,
|
|
26
|
-
max: 1
|
|
27
|
-
},
|
|
28
|
-
exhibitOnly: !1,
|
|
29
|
-
initialElements: [],
|
|
30
|
-
initialType: "PF",
|
|
31
|
-
maxNumberOfPoints: 1,
|
|
32
|
-
ticks: {
|
|
33
|
-
minor: .125,
|
|
34
|
-
major: .5,
|
|
35
|
-
tickIntervalType: "Decimal"
|
|
36
|
-
},
|
|
37
|
-
title: "",
|
|
38
|
-
width: 500
|
|
39
|
-
},
|
|
40
|
-
prompt: "",
|
|
41
|
-
promptEnabled: !0,
|
|
42
|
-
rationale: "",
|
|
43
|
-
rationaleEnabled: !0,
|
|
44
|
-
teacherInstructions: "",
|
|
45
|
-
teacherInstructionsEnabled: !0,
|
|
46
|
-
toolbarEditorPosition: "bottom",
|
|
47
|
-
widthEnabled: !0
|
|
48
|
-
};
|
|
49
|
-
//#endregion
|
|
50
|
-
export { e as default };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/number-line/controller/src/index.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Generates detailed trace log for scoring evaluation
|
|
11
|
-
* @param {Object} model - the question model
|
|
12
|
-
* @param {Object} session - the student session
|
|
13
|
-
* @param {Object} env - the environment
|
|
14
|
-
* @returns {Array} traceLog - array of trace messages
|
|
15
|
-
*/
|
|
16
|
-
export declare const getLogTrace: (model: any, session: any, env: any) => string[];
|
|
17
|
-
/**
|
|
18
|
-
*/
|
|
19
|
-
export declare function outcome(model: any, session: any, env: any): Promise<unknown>;
|
|
20
|
-
export declare function getScore(question: any, session: any): Promise<unknown>;
|
|
21
|
-
export declare const CLOSE_TO_PRECISION = 3;
|
|
22
|
-
export declare const closeTo: (a: any, b: any, precision: any) => boolean;
|
|
23
|
-
export declare const getCorrected: (answer: any, correctResponse: any) => any;
|
|
24
|
-
export declare const getCorrectness: (corrected: any) => "unknown" | "unanswered" | "correct" | "partial" | "incorrect";
|
|
25
|
-
/**
|
|
26
|
-
* A sample of a normalize function see:
|
|
27
|
-
* https://github.com/pie-framework/pie-elements/issues/21
|
|
28
|
-
*/
|
|
29
|
-
export declare function normalize(question: any): any;
|
|
30
|
-
export declare function createDefaultModel(model?: {}): Promise<unknown>;
|
|
31
|
-
export declare function model(question: any, session: any, env: any): Promise<Partial<{
|
|
32
|
-
prompt: any;
|
|
33
|
-
teacherInstructions: any;
|
|
34
|
-
graph: any;
|
|
35
|
-
disabled: boolean;
|
|
36
|
-
corrected: any;
|
|
37
|
-
correctResponse: any;
|
|
38
|
-
feedback: "" | {
|
|
39
|
-
type: string | false;
|
|
40
|
-
message: string;
|
|
41
|
-
} | undefined;
|
|
42
|
-
colorContrast: any;
|
|
43
|
-
language: any;
|
|
44
|
-
extraCSSRules: any;
|
|
45
|
-
}>>;
|
|
46
|
-
export declare const createCorrectResponseSession: (question: any, env: any) => Promise<unknown>;
|
|
47
|
-
export declare const validate: (model?: {}, config?: {}) => {};
|
package/dist/controller/index.js
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import e from "./defaults.js";
|
|
2
|
-
import { reloadTicksData as t } from "./utils.js";
|
|
3
|
-
import * as n from "mathjs";
|
|
4
|
-
import { cloneDeep as r, find as i, isEmpty as a, isEqualWith as o, merge as s, omitBy as c } from "@pie-element/shared-lodash";
|
|
5
|
-
import { getFeedbackForCorrectness as l } from "@pie-element/shared-feedback";
|
|
6
|
-
import { partialScoring as u } from "@pie-element/shared-controller-utils";
|
|
7
|
-
//#region src/controller/index.ts
|
|
8
|
-
var d = (e) => ({ score: { scaled: e } }), f = (e, t) => {
|
|
9
|
-
let { correct: n } = e, r = t.find((e) => e.numberOfCorrect === n.length);
|
|
10
|
-
return r ? 1 * (r.scorePercentage / 100) : 0;
|
|
11
|
-
}, p = (e) => (t, n) => t + +!!e.some((e) => y(e)(n)), m = (e, t, n) => {
|
|
12
|
-
let i = [], a = t?.answer || [], o = e?.correctResponse || [];
|
|
13
|
-
if (!a.length) return ["Student did not interact with the number line."];
|
|
14
|
-
let { correct: s, incorrect: c, notInAnswer: l, noCorrectResponse: d } = b(a, r(o));
|
|
15
|
-
if (d) return ["No correct response is defined for this item."];
|
|
16
|
-
let f = s.length, p = c.length, m = l.length;
|
|
17
|
-
f > 0 && i.push(`${f} object(s) correctly placed.`), p > 0 && i.push(`${p} incorrect object(s) placed.`), m > 0 && i.push(`${m} expected object(s) were not placed.`);
|
|
18
|
-
let h = [...a];
|
|
19
|
-
[...o], s.forEach((e) => {
|
|
20
|
-
let t = h[e], n = t?.type || "object";
|
|
21
|
-
i.push(`${n.charAt(0).toUpperCase() + n.slice(1)} at position ${t.domainPosition} is correct.`);
|
|
22
|
-
}), c.forEach((e) => {
|
|
23
|
-
let t = h[e], n = t?.type || "object";
|
|
24
|
-
i.push(`${n.charAt(0).toUpperCase() + n.slice(1)} at position ${t.domainPosition} does not match the expected response.`);
|
|
25
|
-
}), l.forEach((e) => {
|
|
26
|
-
let t = e?.type || "object";
|
|
27
|
-
i.push(`Expected ${t} at position ${e.domainPosition} was not placed by the student.`);
|
|
28
|
-
});
|
|
29
|
-
let g = u.enabled(e, n);
|
|
30
|
-
g ? (i.push("Score calculated using partial scoring."), i.push("Partial scoring is based on the number of correct objects, with deductions for extras.")) : i.push("Score calculated using all-or-nothing scoring.");
|
|
31
|
-
let _ = o.length || 1, v = a.length > _ ? a.length - _ : 0;
|
|
32
|
-
v > 0 && i.push(`${v} extra object(s) beyond the required amount were placed and deducted.`);
|
|
33
|
-
let y = Math.max(0, (f - v) / _), x = g ? y : +(y === 1);
|
|
34
|
-
return i.push(`Final score: ${x}.`), i;
|
|
35
|
-
};
|
|
36
|
-
function h(e, t, n) {
|
|
37
|
-
return new Promise((r) => {
|
|
38
|
-
if (!t || a(t)) r({
|
|
39
|
-
score: 0,
|
|
40
|
-
empty: !0,
|
|
41
|
-
logTrace: ["Student did not interact with the number line."]
|
|
42
|
-
});
|
|
43
|
-
else {
|
|
44
|
-
let i = u.enabled(e, n), a = (t.answer || []).reduce(p(e.correctResponse), 0), o = e.correctResponse.length, s = 0;
|
|
45
|
-
(t.answer || []).length > o && (s = (t.answer || []).length - o), o === 0 && (o = 1);
|
|
46
|
-
let c = a < 0 ? 0 : (a - s) / o;
|
|
47
|
-
c < 0 && (c = 0), r({
|
|
48
|
-
score: i ? c : +(c === 1),
|
|
49
|
-
logTrace: m(e, t, n)
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
function g(e, t) {
|
|
55
|
-
return new Promise((n) => {
|
|
56
|
-
if (!t || a(t)) n({ score: { scaled: 0 } });
|
|
57
|
-
else {
|
|
58
|
-
t.answer = t.answer || [];
|
|
59
|
-
let i = b(t.answer, r(e.correctResponse)), o = x(i);
|
|
60
|
-
if (o === "correct") n(d(1));
|
|
61
|
-
else if (o === "incorrect") n(d(0));
|
|
62
|
-
else if (o === "partial") {
|
|
63
|
-
let { allowPartialScoring: t, partialScoring: r } = e, o = (r || []).filter((e) => !a(e));
|
|
64
|
-
t && o.length > 0 ? n(d(f(i, o))) : n(d(0));
|
|
65
|
-
} else n({ score: { scaled: -1 } });
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
var _ = 3, v = (e, t, n) => {
|
|
70
|
-
n ||= 5;
|
|
71
|
-
let r = 10 ** -n / 2;
|
|
72
|
-
return Math.abs(e - t) <= r;
|
|
73
|
-
}, y = (e) => (t) => o(e, t, (e, t) => {
|
|
74
|
-
if (typeof e == "number" && typeof t == "number") return v(e, t, 3);
|
|
75
|
-
}), b = (e, t) => a(t) && e.length > 0 ? {
|
|
76
|
-
correct: [],
|
|
77
|
-
incorrect: [],
|
|
78
|
-
notInAnswer: [],
|
|
79
|
-
noCorrectResponse: !0
|
|
80
|
-
} : e.reduce((e, t, n) => {
|
|
81
|
-
let { correct: r, incorrect: a, notInAnswer: o } = e, s = i(o, y(t));
|
|
82
|
-
return s ? (r.push(n), o.splice(o.indexOf(s), 1)) : a.push(n), {
|
|
83
|
-
correct: r,
|
|
84
|
-
incorrect: a,
|
|
85
|
-
notInAnswer: o
|
|
86
|
-
};
|
|
87
|
-
}, {
|
|
88
|
-
correct: [],
|
|
89
|
-
incorrect: [],
|
|
90
|
-
notInAnswer: t
|
|
91
|
-
}), x = (e) => {
|
|
92
|
-
let { incorrect: t, correct: n, notInAnswer: r, noCorrectResponse: i } = e;
|
|
93
|
-
return i ? "unknown" : t.length === 0 && n.length === 0 ? "unanswered" : t.length === 0 && r.length === 0 ? "correct" : t.length > 0 || r.length > 0 ? n.length > 0 ? "partial" : "incorrect" : "unknown";
|
|
94
|
-
};
|
|
95
|
-
function S(t) {
|
|
96
|
-
let n = s(e.feedback, t.feedback);
|
|
97
|
-
return {
|
|
98
|
-
...e,
|
|
99
|
-
...t,
|
|
100
|
-
feedback: n
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
function C(t = {}) {
|
|
104
|
-
return new Promise((n) => {
|
|
105
|
-
n(c({
|
|
106
|
-
...t,
|
|
107
|
-
graph: {
|
|
108
|
-
...e.graph,
|
|
109
|
-
...t.graph
|
|
110
|
-
},
|
|
111
|
-
colorContrast: "black_on_white"
|
|
112
|
-
}, (e) => !e));
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
var w = (e) => {
|
|
116
|
-
let { graph: { domain: t, labelStep: r, ticks: i = {} } = {} } = e, { minor: a, major: o } = i;
|
|
117
|
-
if (t && (t.min = Number((t.min || 0).toFixed(2)), t.max = Number((t.max || 0).toFixed(2))), r && typeof r == "string" && r.match(/^[1-9][0-9]*\/[1-9][0-9]*$/g)) {
|
|
118
|
-
e.graph.fraction = !0, i.tickIntervalType = "Fraction";
|
|
119
|
-
let t = n.evaluate(r);
|
|
120
|
-
t !== o && (i.major = t, i.minor = t / (o / a));
|
|
121
|
-
}
|
|
122
|
-
return e;
|
|
123
|
-
};
|
|
124
|
-
async function T(e, n, i) {
|
|
125
|
-
if (!e) throw Error("question is null");
|
|
126
|
-
let a = await S(e), o = t(w(a).graph);
|
|
127
|
-
if (o) {
|
|
128
|
-
let e = i.mode === "evaluate", t = r(a.correctResponse), s = e && b(n && n.answer || [], t), u = e && x(s), { exhibitOnly: d } = o, f = i.mode !== "gather" || d === !0, p = null;
|
|
129
|
-
i.role === "instructor" && (i.mode === "view" || e) && (p = a.teacherInstructions);
|
|
130
|
-
let m = e ? await l(u, a.feedback) : void 0;
|
|
131
|
-
return c({
|
|
132
|
-
prompt: a.prompt,
|
|
133
|
-
teacherInstructions: p,
|
|
134
|
-
graph: o,
|
|
135
|
-
disabled: f,
|
|
136
|
-
corrected: s,
|
|
137
|
-
correctResponse: e && ["unanswered", "correct"].indexOf(u) === -1 && a.correctResponse,
|
|
138
|
-
feedback: m && {
|
|
139
|
-
type: u,
|
|
140
|
-
message: m
|
|
141
|
-
},
|
|
142
|
-
colorContrast: i.accessibility && i.accessibility.colorContrast || "black_on_white",
|
|
143
|
-
language: a.language,
|
|
144
|
-
extraCSSRules: a.extraCSSRules
|
|
145
|
-
}, (e) => !e);
|
|
146
|
-
} else throw Error("graph is undefined");
|
|
147
|
-
}
|
|
148
|
-
var E = (e, t) => new Promise((n) => {
|
|
149
|
-
if (t.mode !== "evaluate" && t.role === "instructor") {
|
|
150
|
-
let { correctResponse: t } = e;
|
|
151
|
-
n({
|
|
152
|
-
answer: t,
|
|
153
|
-
id: "1"
|
|
154
|
-
});
|
|
155
|
-
} else n(null);
|
|
156
|
-
}), D = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), O = (e = {}, t = {}) => {
|
|
157
|
-
let { graph: n, correctResponse: r } = e || {}, { maxMaxElements: i = 20, numberLineDimensions: { min: a = 200, max: o = 800 } = {} } = t || {}, { width: s, domain: c, maxNumberOfPoints: l } = n || {}, { min: u, max: d } = c || {}, f = {};
|
|
158
|
-
["teacherInstructions", "prompt"].forEach((n) => {
|
|
159
|
-
t[n]?.required && !D(e[n]) && (f[n] = "This field is required.");
|
|
160
|
-
}), (s < a || s > o) && (f.widthError = `Width should be a value between ${a} and ${o}.`);
|
|
161
|
-
let p = -1e5, m = 1e5;
|
|
162
|
-
return (u < p || u > m || d < p || d > m) && (f.domainError = `Min and max values must both be in the range [${p}, ${m}].`), u >= d && (f.maxError = "Max value must be greater than min value."), (l < 1 || l > i) && (f.pointsError = `Max number of elements should be between 1 and ${i}.`), r && r.length === 0 && (f.correctResponseError = "The correct answer should include at least one number line object."), f;
|
|
163
|
-
};
|
|
164
|
-
//#endregion
|
|
165
|
-
export { _ as CLOSE_TO_PRECISION, v as closeTo, E as createCorrectResponseSession, C as createDefaultModel, b as getCorrected, x as getCorrectness, m as getLogTrace, g as getScore, T as model, S as normalize, h as outcome, O as validate };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/number-line/controller/src/tickUtils.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import * as math from 'mathjs';
|
|
10
|
-
export declare const getMinorLimits: (domain: any, width: any) => {
|
|
11
|
-
min: number & (number | math.MathCollection<math.MathNumericType>);
|
|
12
|
-
max: number;
|
|
13
|
-
};
|
|
14
|
-
export declare const generateMinorValues: (minorLimits: any) => {
|
|
15
|
-
fraction: never[];
|
|
16
|
-
decimal: never[];
|
|
17
|
-
};
|
|
18
|
-
export declare const generateMajorValuesForMinor: (minor: any, domain: any, width: any) => {
|
|
19
|
-
decimal: never[];
|
|
20
|
-
fraction: never[];
|
|
21
|
-
};
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import * as e from "mathjs";
|
|
2
|
-
import { isNumber as t, isObject as n, uniqWith as r } from "@pie-element/shared-lodash";
|
|
3
|
-
//#region src/controller/tickUtils.ts
|
|
4
|
-
var i = [
|
|
5
|
-
.001,
|
|
6
|
-
.01,
|
|
7
|
-
.02,
|
|
8
|
-
.04,
|
|
9
|
-
.05,
|
|
10
|
-
.1,
|
|
11
|
-
.125,
|
|
12
|
-
.2,
|
|
13
|
-
.25,
|
|
14
|
-
.5
|
|
15
|
-
], a = [
|
|
16
|
-
"1/1000",
|
|
17
|
-
"1/100",
|
|
18
|
-
"1/64",
|
|
19
|
-
"1/50",
|
|
20
|
-
"1/32",
|
|
21
|
-
"1/25",
|
|
22
|
-
"1/20",
|
|
23
|
-
"1/16",
|
|
24
|
-
"1/15",
|
|
25
|
-
"1/12",
|
|
26
|
-
"1/10",
|
|
27
|
-
"1/9",
|
|
28
|
-
"1/8",
|
|
29
|
-
"1/7",
|
|
30
|
-
"1/6",
|
|
31
|
-
"1/5",
|
|
32
|
-
"1/4",
|
|
33
|
-
"1/3",
|
|
34
|
-
"1/2"
|
|
35
|
-
], o = {
|
|
36
|
-
1: [
|
|
37
|
-
1,
|
|
38
|
-
2,
|
|
39
|
-
3,
|
|
40
|
-
4,
|
|
41
|
-
5,
|
|
42
|
-
6,
|
|
43
|
-
7,
|
|
44
|
-
8,
|
|
45
|
-
9,
|
|
46
|
-
10
|
|
47
|
-
],
|
|
48
|
-
2: [
|
|
49
|
-
1,
|
|
50
|
-
2,
|
|
51
|
-
4,
|
|
52
|
-
6,
|
|
53
|
-
8,
|
|
54
|
-
10
|
|
55
|
-
],
|
|
56
|
-
3: [
|
|
57
|
-
1,
|
|
58
|
-
3,
|
|
59
|
-
6,
|
|
60
|
-
9
|
|
61
|
-
],
|
|
62
|
-
4: [
|
|
63
|
-
1,
|
|
64
|
-
2,
|
|
65
|
-
4,
|
|
66
|
-
8
|
|
67
|
-
],
|
|
68
|
-
5: [
|
|
69
|
-
1,
|
|
70
|
-
5,
|
|
71
|
-
10
|
|
72
|
-
],
|
|
73
|
-
6: [
|
|
74
|
-
1,
|
|
75
|
-
2,
|
|
76
|
-
3,
|
|
77
|
-
6
|
|
78
|
-
],
|
|
79
|
-
7: [1, 7],
|
|
80
|
-
8: [
|
|
81
|
-
1,
|
|
82
|
-
2,
|
|
83
|
-
4,
|
|
84
|
-
8
|
|
85
|
-
],
|
|
86
|
-
9: [
|
|
87
|
-
1,
|
|
88
|
-
3,
|
|
89
|
-
9
|
|
90
|
-
],
|
|
91
|
-
10: [
|
|
92
|
-
1,
|
|
93
|
-
2,
|
|
94
|
-
5,
|
|
95
|
-
10
|
|
96
|
-
],
|
|
97
|
-
12: [
|
|
98
|
-
1,
|
|
99
|
-
2,
|
|
100
|
-
3,
|
|
101
|
-
4,
|
|
102
|
-
6
|
|
103
|
-
],
|
|
104
|
-
15: [
|
|
105
|
-
1,
|
|
106
|
-
3,
|
|
107
|
-
5
|
|
108
|
-
],
|
|
109
|
-
16: [
|
|
110
|
-
1,
|
|
111
|
-
2,
|
|
112
|
-
4,
|
|
113
|
-
8
|
|
114
|
-
],
|
|
115
|
-
20: [
|
|
116
|
-
1,
|
|
117
|
-
2,
|
|
118
|
-
4,
|
|
119
|
-
5,
|
|
120
|
-
10
|
|
121
|
-
],
|
|
122
|
-
25: [1, 5],
|
|
123
|
-
32: [
|
|
124
|
-
1,
|
|
125
|
-
2,
|
|
126
|
-
4,
|
|
127
|
-
8
|
|
128
|
-
],
|
|
129
|
-
50: [
|
|
130
|
-
1,
|
|
131
|
-
2,
|
|
132
|
-
5,
|
|
133
|
-
10
|
|
134
|
-
],
|
|
135
|
-
64: [
|
|
136
|
-
1,
|
|
137
|
-
2,
|
|
138
|
-
4,
|
|
139
|
-
8
|
|
140
|
-
],
|
|
141
|
-
100: [
|
|
142
|
-
1,
|
|
143
|
-
2,
|
|
144
|
-
4,
|
|
145
|
-
5,
|
|
146
|
-
10
|
|
147
|
-
],
|
|
148
|
-
1e3: [
|
|
149
|
-
1,
|
|
150
|
-
2,
|
|
151
|
-
4,
|
|
152
|
-
5,
|
|
153
|
-
8,
|
|
154
|
-
10
|
|
155
|
-
]
|
|
156
|
-
}, s = (t, n, r) => {
|
|
157
|
-
let i = e.mod(e.abs(t), e.abs(r));
|
|
158
|
-
if (!e.equal(i, 0)) throw Error("start point must be divisible by interval");
|
|
159
|
-
if (e.equal(t, n)) return [];
|
|
160
|
-
let a = e.subtract(n, e.mod(n, e.abs(r))), o = e.larger(r, 0) ? "positive" : "negative";
|
|
161
|
-
if (o === "negative" && e.largerEq(n, t)) throw Error("start must be > than end when doing a negative decrement");
|
|
162
|
-
if (o === "positive" && e.smallerEq(n, t)) throw Error("start must be < end when doing increments");
|
|
163
|
-
let s = o === "positive" ? e.smallerEq : e.equal(a, n) ? e.largerEq : e.larger, c = [], l = t;
|
|
164
|
-
for (; s(l, a);) c.push(l), l = e.add(l, r);
|
|
165
|
-
return c;
|
|
166
|
-
}, c = (e, t) => `Can only do a positive or negative range, but got: start: ${e} and end:${t}`, l = (t, n, r) => {
|
|
167
|
-
t = e.fraction(t), n = e.fraction(n), r = e.fraction(r);
|
|
168
|
-
let i = e.abs(e.subtract(n, t));
|
|
169
|
-
if (e.larger(i, e.abs(n))) throw Error(c(t, n));
|
|
170
|
-
let a = {
|
|
171
|
-
start: e.abs(t),
|
|
172
|
-
end: e.abs(n),
|
|
173
|
-
interval: e.abs(r),
|
|
174
|
-
multiplier: e.smaller(r, 0) ? -1 : 1
|
|
175
|
-
}, o = e.mod(a.start, a.interval), l = s(e.larger(o, 0) ? e.add(e.subtract(a.start, o), a.interval) : a.start, a.end, a.interval), u = a.multiplier === -1 ? l.map((t) => e.multiply(t, -1)) : l;
|
|
176
|
-
return e.smaller(r, 0) && u.reverse(), u;
|
|
177
|
-
}, u = (t, n) => (t = e.fraction(t), n = e.fraction(n), e.smaller(t, n) ? t : n), d = (t, n) => (t = e.fraction(t), n = e.fraction(n), e.larger(t, n) ? t : n), f = (t, n, i) => {
|
|
178
|
-
t = e.fraction(t), n = e.fraction(n), i = e.fraction(i);
|
|
179
|
-
let a = e.larger(n, 0) ? l(d(0, t), n, i) : [];
|
|
180
|
-
return r((e.smaller(t, 0) ? l(u(0, n), t, e.multiply(i, -1)) : []).concat(a), e.equal);
|
|
181
|
-
}, p = (e, t, n) => {
|
|
182
|
-
n ||= 2;
|
|
183
|
-
let r = 10 ** -n / 2;
|
|
184
|
-
return Math.abs(e - t) < r;
|
|
185
|
-
}, m = (t, n, r) => e.smaller(_(t), _(n)) ? n : e.larger(_(t), _(r)) ? r : t, h = (t, n) => {
|
|
186
|
-
let r = t.max - t.min, i = e.number(e.multiply(10, e.divide(e.fraction(r), n)));
|
|
187
|
-
return {
|
|
188
|
-
min: i,
|
|
189
|
-
max: e.number(e.multiply(20, i))
|
|
190
|
-
};
|
|
191
|
-
}, g = (t, n) => {
|
|
192
|
-
let r = e.mod(t, n);
|
|
193
|
-
return e.equal(r, 0);
|
|
194
|
-
}, _ = (r) => {
|
|
195
|
-
if (n(r)) return e.fraction(r.n * r.s, r.d);
|
|
196
|
-
if (t(r)) return e.fraction(r);
|
|
197
|
-
}, v = (t, n, r, i) => {
|
|
198
|
-
let a = i ? i.limit !== !1 : !0, o = h(t, n), s = a ? m(_(r.minor), o.min, o.max) : _(r.minor), c = a ? m(_(r.major), s, e.multiply(s, 20)) : _(r.major);
|
|
199
|
-
if (!g(c, s)) {
|
|
200
|
-
let t = e.divide(c, s), n = t <= 2 ? 2 : Math.round(t);
|
|
201
|
-
return {
|
|
202
|
-
minor: s,
|
|
203
|
-
major: e.multiply(s, n)
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
return {
|
|
207
|
-
major: c,
|
|
208
|
-
minor: s
|
|
209
|
-
};
|
|
210
|
-
}, y = (t, n, r, i) => (r = v(t, n, r, i), f(t.min, t.max, r.minor).filter((n) => e.smallerEq(n, e.fraction(t.max))).map((t) => {
|
|
211
|
-
let n = "minor", i = e.mod(t, r.major);
|
|
212
|
-
return p(e.number(i), 0) && (n = "major"), {
|
|
213
|
-
x: t,
|
|
214
|
-
type: n
|
|
215
|
-
};
|
|
216
|
-
})), b = (t) => {
|
|
217
|
-
let n = {
|
|
218
|
-
fraction: [],
|
|
219
|
-
decimal: []
|
|
220
|
-
};
|
|
221
|
-
return i.forEach((e) => {
|
|
222
|
-
e >= t.min && e <= t.max && n.decimal.push(e);
|
|
223
|
-
}), a.forEach((r) => {
|
|
224
|
-
let i = e.number(e.fraction(r));
|
|
225
|
-
i >= t.min && i <= t.max && n.fraction.push(r);
|
|
226
|
-
}), n;
|
|
227
|
-
}, x = (t, n, r) => {
|
|
228
|
-
let i = {
|
|
229
|
-
decimal: [],
|
|
230
|
-
fraction: []
|
|
231
|
-
}, a = e.fraction(e.number(e.number(t))), s = a.n, c = a.d;
|
|
232
|
-
if (s >= 1 && c === 1) for (let a = 1; a <= 10; a++) {
|
|
233
|
-
let o = e.number(e.multiply(s, a));
|
|
234
|
-
S(n, r, {
|
|
235
|
-
minor: t,
|
|
236
|
-
major: o
|
|
237
|
-
}, { fraction: void 0 }).filter((e) => e.type === "major").length > 1 && (i.fraction.push(o.toString()), i.decimal.push(o));
|
|
238
|
-
}
|
|
239
|
-
else for (let a in o[c]) {
|
|
240
|
-
let l = e.multiply(e.fraction(s, c), o[c][a]);
|
|
241
|
-
S(n, r, {
|
|
242
|
-
minor: t,
|
|
243
|
-
major: e.number(l)
|
|
244
|
-
}, { fraction: void 0 }).filter((e) => e.type === "major").length > 1 && (l.d === 1 ? i.fraction.push(l.n.toString()) : i.fraction.push(l.n + "/" + l.d), i.decimal.push(e.number(l)));
|
|
245
|
-
}
|
|
246
|
-
return i;
|
|
247
|
-
}, S = (t, n, r, i) => y(t, n, r, i).map((t) => i.fraction ? t : {
|
|
248
|
-
...t,
|
|
249
|
-
x: e.number(t.x) || 0
|
|
250
|
-
});
|
|
251
|
-
//#endregion
|
|
252
|
-
export { x as generateMajorValuesForMinor, b as generateMinorValues, h as getMinorLimits };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/number-line/controller/src/utils.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
export declare const reloadTicksData: (graph: any) => any;
|
package/dist/controller/utils.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { generateMajorValuesForMinor as e, generateMinorValues as t, getMinorLimits as n } from "./tickUtils.js";
|
|
2
|
-
import * as r from "mathjs";
|
|
3
|
-
//#region src/controller/utils.ts
|
|
4
|
-
var i = (t) => {
|
|
5
|
-
let { domain: n, ticks: r, width: i } = t, a = e(r.minor, n, i);
|
|
6
|
-
if (a.decimal.indexOf(r.major) === -1) {
|
|
7
|
-
let e = 0;
|
|
8
|
-
e = r.tickIntervalType === "Integer" && a.decimal.length > 4 ? 4 : a.decimal.length - 1, r.major = a.decimal[e];
|
|
9
|
-
}
|
|
10
|
-
return t.fraction = r.tickIntervalType === "Fraction" && r.major < 1, {
|
|
11
|
-
...t,
|
|
12
|
-
ticks: r
|
|
13
|
-
};
|
|
14
|
-
}, a = (e) => {
|
|
15
|
-
let { domain: a, ticks: o = {}, width: s } = e;
|
|
16
|
-
o.tickIntervalType || (o.minor > .5 ? o.tickIntervalType = "Integer" : o.tickIntervalType = "Decimal");
|
|
17
|
-
let c = n(a, s);
|
|
18
|
-
if (c.min >= 1) o.tickIntervalType = "Integer", o.minor = o.minor < 1 ? r.number(r.ceil(c.min)) : o.minor >= r.number(r.ceil(c.min)) && o.minor <= r.number(r.floor(c.max)) ? o.minor : r.number(r.ceil(c.min)), o.integerTick = o.minor, o.fractionTick = "0", o.decimalTick = 0;
|
|
19
|
-
else if (c.min >= 0 && c.max < 1) {
|
|
20
|
-
o.tickIntervalType === "Integer" && (o.tickIntervalType = "Fraction");
|
|
21
|
-
let e = t(c), n = r.number(r.fraction(e.fraction[0])), i = r.number(r.fraction(e.fraction[e.fraction.length - 1]));
|
|
22
|
-
if (o.minor < n || o.minor > i) switch (o.tickIntervalType) {
|
|
23
|
-
case "Fraction":
|
|
24
|
-
o.minor = r.number(r.fraction(e.fraction[e.fraction.length - 1])), o.fractionTick = e.fraction[e.fraction.length - 1], o.decimalTick = e.decimal[0];
|
|
25
|
-
break;
|
|
26
|
-
case "Decimal":
|
|
27
|
-
case "Integer": o.minor = e.decimal[e.decimal.length - 1], o.decimalTick = e.decimal[e.decimal.length - 1], o.fractionTick = e.fraction[0];
|
|
28
|
-
}
|
|
29
|
-
else switch (o.tickIntervalType) {
|
|
30
|
-
case "Fraction":
|
|
31
|
-
let t = r.fraction(r.number(o.minor));
|
|
32
|
-
o.fractionTick = t.n + "/" + t.d, o.decimalTick = o.decimalTick ? o.decimalTick : e.decimal[0];
|
|
33
|
-
break;
|
|
34
|
-
case "Decimal":
|
|
35
|
-
case "Integer": o.decimalTick = o.minor, o.fractionTick = o.fractionTick ? o.fractionTick : e.fraction[0];
|
|
36
|
-
}
|
|
37
|
-
o.integerTick = 1;
|
|
38
|
-
} else if (c.min < 1 && c.max >= 1) {
|
|
39
|
-
let e = t(c);
|
|
40
|
-
if (o.minor >= c.min && o.minor <= c.max) switch (o.tickIntervalType) {
|
|
41
|
-
case "Integer":
|
|
42
|
-
o.integerTick = o.minor, o.decimalTick = c.min > .5 ? 0 : e.decimal[0], o.fractionTick = c.min > .5 ? "0" : e.fraction[0];
|
|
43
|
-
break;
|
|
44
|
-
case "Decimal":
|
|
45
|
-
o.integerTick = 1, o.decimalTick = o.minor, o.fractionTick = e.fraction[0];
|
|
46
|
-
break;
|
|
47
|
-
case "Fraction":
|
|
48
|
-
o.integerTick = 1, o.decimalTick = e.decimal[0];
|
|
49
|
-
let t = r.fraction(r.number(o.minor));
|
|
50
|
-
o.fractionTick = t.n + "/" + t.d;
|
|
51
|
-
}
|
|
52
|
-
else switch (c.min > .5 && (o.tickIntervalType = "Integer"), o.tickIntervalType) {
|
|
53
|
-
case "Integer":
|
|
54
|
-
o.minor = r.number(r.ceil(c.min)), o.integerTick = o.minor, o.decimalTick = c.min > .5 ? 0 : e.decimal[0], o.fractionTick = c.min > .5 ? "0" : e.fraction[0];
|
|
55
|
-
break;
|
|
56
|
-
case "Decimal":
|
|
57
|
-
o.minor = e.decimal[0], o.integerTick = 1, o.decimalTick = o.minor, o.fractionTick = e.fraction[0];
|
|
58
|
-
break;
|
|
59
|
-
case "Fraction": o.minor = r.number(r.fraction(e.fraction[0])), o.integerTick = 1, o.decimalTick = e.decimal[0], o.fractionTick = e.fraction[0];
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return i({
|
|
63
|
-
...e,
|
|
64
|
-
ticks: o
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
//#endregion
|
|
68
|
-
export { a as reloadTicksData };
|