linny-r 1.4.4 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linny-r",
3
- "version": "1.4.4",
3
+ "version": "1.4.5",
4
4
  "description": "Executable graphical language with WYSIWYG editor for MILP models",
5
5
  "main": "server.js",
6
6
  "scripts": {
@@ -205,7 +205,8 @@ NOTE: Grouping groups results in a single group, e.g., (1;2);(3;4;5) evaluates a
205
205
  }
206
206
  }
207
207
  if(a) n += ` (${a})`;
208
- UI.edited_object = MODEL.objectByName(n);
208
+ // NOTE: Names may contain ampersand as HTML entity.
209
+ UI.edited_object = MODEL.objectByName(n.replace('&', '&'));
209
210
  this.edited_input_id = UI.edited_object.type.toLowerCase() + '-' + ids[1];
210
211
  this.edited_expression = UI.edited_object.attributeExpression(ids[1]);
211
212
  }
@@ -2988,7 +2988,8 @@ class LinnyRModel {
2988
2988
  if(names.indexOf(n) < 0) {
2989
2989
  // Here, too, NULL can be used as "owner chart".
2990
2990
  const cv = new ChartVariable(null);
2991
- cv.setProperties(ds, dm.selector, false, '#000000');
2991
+ // NOTE: For equations, the object is the dataset modifier.
2992
+ cv.setProperties(eq ? dm : ds, dm.selector, false, '#000000');
2992
2993
  vbls.push(cv);
2993
2994
  }
2994
2995
  }
@@ -8913,9 +8914,12 @@ class ChartVariable {
8913
8914
  // by its scale factor unless it equals 1 (no scaling).
8914
8915
  const sf = (this.scale_factor === 1 ? '' :
8915
8916
  ` (x${VM.sig4Dig(this.scale_factor)})`);
8916
- // NOTE: Display name of equation is just the equations dataset modifier.
8917
- if(this.object === MODEL.equations_dataset) {
8918
- let eqn = this.attribute;
8917
+ //Display name of equation is just the equations dataset selector.
8918
+ if(this.object instanceof DatasetModifier ||
8919
+ // NOTE: Same holds for "dummy variables" added for wildcard
8920
+ // dataset selectors.
8921
+ this.object === MODEL.equations_dataset) {
8922
+ let eqn = this.object.selector;
8919
8923
  if(this.wildcard_index !== false) {
8920
8924
  eqn = eqn.replace('??', this.wildcard_index);
8921
8925
  }
@@ -9299,6 +9303,8 @@ class Chart {
9299
9303
  vlist.push(v);
9300
9304
  }
9301
9305
  return vlist;
9306
+ // FALL-THROUGH: Equation name has no wildcard => use the equation
9307
+ // object (= dataset modifier) as `obj`.
9302
9308
  }
9303
9309
  const v = new ChartVariable(this);
9304
9310
  v.setProperties(obj, a, false, this.nextAvailableDefaultColor, 1, 1);
@@ -666,7 +666,7 @@ function customizeXML(str) {
666
666
  // First modify `str` -- by default, do nothing
667
667
 
668
668
  /*
669
- if(str.indexOf('<author>XXX</author>') >= 0) {
669
+ if(str.indexOf('<version>1.4.') >= 0) {
670
670
  str = str.replace(/<url>NL\/(\w+)\.csv<\/url>/g, '<url></url>');
671
671
  }
672
672
  */