linny-r 1.4.3 → 1.4.5
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/README.md +102 -48
- package/package.json +1 -1
- package/server.js +31 -6
- package/static/images/check-off-not-same-changed.png +0 -0
- package/static/images/check-off-not-same-not-changed.png +0 -0
- package/static/images/check-off-same-changed.png +0 -0
- package/static/images/check-off-same-not-changed.png +0 -0
- package/static/images/check-on-not-same-changed.png +0 -0
- package/static/images/check-on-not-same-not-changed.png +0 -0
- package/static/images/check-on-same-changed.png +0 -0
- package/static/images/check-on-same-not-changed.png +0 -0
- package/static/images/eq-not-same-changed.png +0 -0
- package/static/images/eq-not-same-not-changed.png +0 -0
- package/static/images/eq-same-changed.png +0 -0
- package/static/images/eq-same-not-changed.png +0 -0
- package/static/images/ne-not-same-changed.png +0 -0
- package/static/images/ne-not-same-not-changed.png +0 -0
- package/static/images/ne-same-changed.png +0 -0
- package/static/images/ne-same-not-changed.png +0 -0
- package/static/images/sort-asc-lead.png +0 -0
- package/static/images/sort-asc.png +0 -0
- package/static/images/sort-desc-lead.png +0 -0
- package/static/images/sort-desc.png +0 -0
- package/static/images/sort-not.png +0 -0
- package/static/index.html +51 -35
- package/static/linny-r.css +167 -53
- package/static/scripts/linny-r-gui-actor-manager.js +340 -0
- package/static/scripts/linny-r-gui-chart-manager.js +944 -0
- package/static/scripts/linny-r-gui-constraint-editor.js +681 -0
- package/static/scripts/linny-r-gui-controller.js +4005 -0
- package/static/scripts/linny-r-gui-dataset-manager.js +1176 -0
- package/static/scripts/linny-r-gui-documentation-manager.js +739 -0
- package/static/scripts/linny-r-gui-equation-manager.js +307 -0
- package/static/scripts/linny-r-gui-experiment-manager.js +1944 -0
- package/static/scripts/linny-r-gui-expression-editor.js +450 -0
- package/static/scripts/linny-r-gui-file-manager.js +392 -0
- package/static/scripts/linny-r-gui-finder.js +727 -0
- package/static/scripts/linny-r-gui-model-autosaver.js +230 -0
- package/static/scripts/linny-r-gui-monitor.js +448 -0
- package/static/scripts/linny-r-gui-paper.js +2789 -0
- package/static/scripts/linny-r-gui-receiver.js +323 -0
- package/static/scripts/linny-r-gui-repository-browser.js +819 -0
- package/static/scripts/linny-r-gui-scale-unit-manager.js +244 -0
- package/static/scripts/linny-r-gui-sensitivity-analysis.js +778 -0
- package/static/scripts/linny-r-gui-undo-redo.js +560 -0
- package/static/scripts/linny-r-model.js +34 -15
- package/static/scripts/linny-r-utils.js +11 -1
- package/static/scripts/linny-r-vm.js +21 -12
- package/static/scripts/linny-r-gui.js +0 -16908
@@ -483,6 +483,16 @@ function matchingNumber(m, s) {
|
|
483
483
|
return (n == m ? n : false);
|
484
484
|
}
|
485
485
|
|
486
|
+
function matchingNumberInList(ml, s) {
|
487
|
+
// Traverses list `ml` and returns the first matching number, or FALSE
|
488
|
+
// if no match is found.
|
489
|
+
for(let i = 0; i < ml.length; i++) {
|
490
|
+
const n = matchingNumber(ml[i], s);
|
491
|
+
if(n !== false) return n;
|
492
|
+
}
|
493
|
+
return false;
|
494
|
+
}
|
495
|
+
|
486
496
|
function compareWithTailNumbers(s1, s2) {
|
487
497
|
// Returns 0 on equal, an integer < 0 if `s1` comes before `s2`, and
|
488
498
|
// an integer > 0 if `s2` comes before `s1`.
|
@@ -656,7 +666,7 @@ function customizeXML(str) {
|
|
656
666
|
// First modify `str` -- by default, do nothing
|
657
667
|
|
658
668
|
/*
|
659
|
-
if(str.indexOf('<
|
669
|
+
if(str.indexOf('<version>1.4.') >= 0) {
|
660
670
|
str = str.replace(/<url>NL\/(\w+)\.csv<\/url>/g, '<url></url>');
|
661
671
|
}
|
662
672
|
*/
|
@@ -454,18 +454,24 @@ class Expression {
|
|
454
454
|
this.stack.pop();
|
455
455
|
// Check whether either number is an error code
|
456
456
|
let check = Math.min(dyad[0], dyad[1]);
|
457
|
-
if(check < VM.MINUS_INFINITY
|
458
|
-
|
457
|
+
if(check < VM.MINUS_INFINITY &&
|
458
|
+
// Exception: "array index out of bounds" error may also be
|
459
|
+
// ignored by using the | operator.
|
460
|
+
!(no_check && check === VM.ARRAY_INDEX)) {
|
461
|
+
// If error, leave the severest error on top of the stack
|
459
462
|
this.retop(check);
|
460
463
|
this.trace(VM.errorMessage(check) + ' in dyad: ' + dyad.toString());
|
461
464
|
return false;
|
462
465
|
}
|
463
|
-
//
|
466
|
+
// Now check for "undefined", "not computed", and "still computing".
|
464
467
|
check = dyad[0];
|
465
468
|
if(no_check) {
|
466
|
-
//
|
467
|
-
// B is also "undefined"
|
468
|
-
if(check === VM.UNDEFINED
|
469
|
+
// For VMI_replace_undefined, ignore that A is "undefined" or even
|
470
|
+
// "array index out of bounds" unless B is also "undefined".
|
471
|
+
if(check === VM.UNDEFINED || check === VM.ARRAY_INDEX) {
|
472
|
+
dyad[0] = VM.UNDEFINED; // Treat "out of bounds" as "undefined".
|
473
|
+
check = dyad[1];
|
474
|
+
}
|
469
475
|
} else {
|
470
476
|
check = Math.max(check, dyad[1]);
|
471
477
|
}
|
@@ -474,7 +480,7 @@ class Expression {
|
|
474
480
|
this.trace(VM.errorMessage(check) + ' in dyad: ' + dyad.toString());
|
475
481
|
return false;
|
476
482
|
}
|
477
|
-
// No problem(s)? Then return the dyad
|
483
|
+
// No problem(s)? Then return the dyad.
|
478
484
|
return dyad;
|
479
485
|
}
|
480
486
|
|
@@ -5993,6 +5999,12 @@ function VMI_push_dataset_modifier(x, args) {
|
|
5993
5999
|
// defines the expression to use. If not, `obj` will be the dataset
|
5994
6000
|
// vector (so same as when "use data" is set).
|
5995
6001
|
obj = ds.activeModifierExpression;
|
6002
|
+
if(wcnr === false && obj instanceof Expression && MODEL.running_experiment) {
|
6003
|
+
// If experiment run defines the modifier selector, the active
|
6004
|
+
// combination may provide a context for #.
|
6005
|
+
wcnr = matchingNumberInList(MODEL.running_experiment.activeCombination,
|
6006
|
+
obj.attribute);
|
6007
|
+
}
|
5996
6008
|
}
|
5997
6009
|
if(!obj) {
|
5998
6010
|
console.log('ANOMALY: no object. obj, wcnr, args, x', obj, wcnr, args, x);
|
@@ -6021,7 +6033,6 @@ function VMI_push_dataset_modifier(x, args) {
|
|
6021
6033
|
VM.out_of_bounds_array = ds.displayName;
|
6022
6034
|
VM.out_of_bounds_msg = `Index ${index} not in array dataset ` +
|
6023
6035
|
`${ds.displayName}, which has length ${obj.length}`;
|
6024
|
-
console.log(VM.out_of_bounds_msg);
|
6025
6036
|
}
|
6026
6037
|
}
|
6027
6038
|
// Fall through: no change to `v` => dataset default value is pushed.
|
@@ -6030,8 +6041,6 @@ function VMI_push_dataset_modifier(x, args) {
|
|
6030
6041
|
// NOTE: Readjust `t` when `obj` is an expression for an *array-type*
|
6031
6042
|
// dataset modifier.
|
6032
6043
|
if(obj.object instanceof Dataset && obj.object.array) t++;
|
6033
|
-
// Pass modifier selector (if specified; may be FALSE) so that result
|
6034
|
-
// will be recomputed with this selector as context for #.
|
6035
6044
|
v = obj.result(t, wcnr);
|
6036
6045
|
}
|
6037
6046
|
// Trace only now that time step t has been computed.
|
@@ -6306,7 +6315,7 @@ function VMI_push_statistic(x, args) {
|
|
6306
6315
|
function VMI_replace_undefined(x, empty) {
|
6307
6316
|
// Replaces one of the two top numbers on the stack by the other if the one
|
6308
6317
|
// is undefined
|
6309
|
-
const d = x.pop(true); //
|
6318
|
+
const d = x.pop(true); // TRUE denotes that "undefined" should be ignored as issue
|
6310
6319
|
if(d !== false) {
|
6311
6320
|
if(DEBUGGING) console.log('REPLACE UNDEFINED (' + d.join(', ') + ')');
|
6312
6321
|
x.retop(d[0] === VM.UNDEFINED ? d[1] : d[0]);
|
@@ -7706,7 +7715,7 @@ const
|
|
7706
7715
|
|
7707
7716
|
OPERATORS = DYADIC_OPERATORS.concat(MONADIC_OPERATORS),
|
7708
7717
|
OPERATOR_CODES = DYADIC_CODES.concat(MONADIC_CODES),
|
7709
|
-
PRIORITIES = [1, 2, 2, 3, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8,
|
7718
|
+
PRIORITIES = [1, 2, 2, 3, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8, 10,
|
7710
7719
|
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9],
|
7711
7720
|
ACTUAL_SYMBOLS = CONSTANT_SYMBOLS.concat(OPERATORS),
|
7712
7721
|
SYMBOL_CODES = CONSTANT_CODES.concat(OPERATOR_CODES);
|