linny-r 2.0.9 → 2.0.11

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.
@@ -331,7 +331,7 @@ class GUIChartManager extends ChartManager {
331
331
  }
332
332
 
333
333
  updateSelector() {
334
- // Adds one option to the selector for each chart defined for the model.
334
+ // Add one option to the selector for each chart defined for the model.
335
335
  // NOTE: Add the "new chart" option if it is not in the list.
336
336
  MODEL.addChart(this.new_chart_title);
337
337
  if(this.chart_index < 0) this.chart_index = 0;
@@ -545,16 +545,16 @@ class GUIChartManager extends ChartManager {
545
545
  }
546
546
 
547
547
  selectChart() {
548
- // Sets the selected chart to be the "active" chart
548
+ // Set the selected chart to be the "active" chart.
549
549
  const ci = parseInt(this.chart_selector.value);
550
- // Deselect variable only if different chart is selected
550
+ // Deselect variable only if different chart is selected.
551
551
  if(ci !== this.chart_index) this.variable_index = -1;
552
552
  this.chart_index = ci;
553
553
  this.updateDialog();
554
554
  }
555
555
 
556
556
  promptForTitle() {
557
- // Prompts modeler for a new title for the current chart
557
+ // Prompt modeler for a new title for the current chart.
558
558
  if(this.chart_index >= 0) {
559
559
  this.rename_chart_modal.show();
560
560
  const nct = document.getElementById('new-chart-title');
@@ -564,29 +564,29 @@ class GUIChartManager extends ChartManager {
564
564
  }
565
565
 
566
566
  renameChart() {
567
- // Renames the current chart
567
+ // Rename the current chart.
568
568
  if(this.chart_index >= 0) {
569
- const t = document.getElementById('new-chart-title').value.trim();
570
- // Check if a chart with this title already exists
569
+ const t = UI.cleanName(document.getElementById('new-chart-title').value);
570
+ // Check if a chart with this title already exists.
571
571
  const ci = MODEL.indexOfChart(t);
572
572
  if(ci >= 0 && ci != this.chart_index) {
573
573
  UI.warn(`A chart with title "${t}" already exists`);
574
574
  } else {
575
575
  const c = MODEL.charts[this.chart_index];
576
- // Remember the old title of the chart-to-be-renamed
576
+ // Remember the old title of the chart-to-be-renamed.
577
577
  const ot = c.title;
578
578
  c.title = t;
579
- // If the default '(new chart)' has been renamed, create a new one
579
+ // If the default '(new chart)' has been renamed, create a new one.
580
580
  if(ot === this.new_chart_title) {
581
581
  MODEL.addChart(ot);
582
582
  }
583
- // Update the chart index so that it points to the renamed chart
583
+ // Update the chart index so that it points to the renamed chart.
584
584
  this.chart_index = MODEL.indexOfChart(t);
585
585
  this.updateSelector();
586
- // Redraw the chart if title is shown
586
+ // Redraw the chart if title is shown.
587
587
  if(c.show_title) this.drawChart();
588
588
  }
589
- // Update experiment viewer in case its current experiment uses this chart
589
+ // Update dialogs that may refer to this chart.
590
590
  UI.updateControllerDialogs('CFX');
591
591
  }
592
592
  this.rename_chart_modal.hide();
@@ -744,6 +744,7 @@ class GUIChartManager extends ChartManager {
744
744
  chart.addWildcardVariables(dsm, indices);
745
745
  } else if(dsm.selector.startsWith(':')) {
746
746
  UI.notify('Plotting methods is work-in-progress!');
747
+ console.log('HERE dsm', dsm, 'expr', dsm.expression.text, 'indices', indices);
747
748
  } else {
748
749
  UI.notify(`Variable "${dsm.displayName}" cannot be plotted`);
749
750
  }
@@ -1114,13 +1114,13 @@ class ConstraintEditor {
1114
1114
  }
1115
1115
 
1116
1116
  showDialog(group=[]) {
1117
- this.from_node = MODEL.objectByName(this.from_name.innerHTML);
1118
- this.to_node = MODEL.objectByName(this.to_name.innerHTML);
1119
- // Double-check that these nodes exist
1117
+ this.from_node = MODEL.objectByName(this.from_name.innerText);
1118
+ this.to_node = MODEL.objectByName(this.to_name.innerText);
1119
+ // Double-check that these nodes exist.
1120
1120
  if(!(this.from_node && this.to_node)) {
1121
1121
  throw 'ERROR: Unknown constraint node(s)';
1122
1122
  }
1123
- // See if existing constraint is edited
1123
+ // See if existing constraint is edited.
1124
1124
  this.edited_constraint = this.from_node.doesConstrain(this.to_node);
1125
1125
  if(this.edited_constraint) {
1126
1126
  // Make a working copy, as the constraint must be changed only when