linny-r 1.2.1 → 1.3.0
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 +6 -6
- package/console.js +2 -2
- package/package.json +2 -2
- package/static/images/paste.png +0 -0
- package/static/index.html +35 -6
- package/static/linny-r.css +88 -16
- package/static/scripts/linny-r-ctrl.js +22 -4
- package/static/scripts/linny-r-gui.js +637 -63
- package/static/scripts/linny-r-model.js +185 -29
- package/static/scripts/linny-r-utils.js +49 -11
- package/static/scripts/linny-r-vm.js +29 -18
package/README.md
CHANGED
@@ -25,7 +25,7 @@ Technical documentation will be developed on GitHub: https://github.com/pwgbots/
|
|
25
25
|
Linny-R is developed as a JavaScript package, and requires that **Node.js** is installed on your computer.
|
26
26
|
This software can be downloaded from <a href="https://nodejs.org" target="_blank">https://nodejs.org</a>.
|
27
27
|
Make sure that you choose the correct installer for your computer.
|
28
|
-
Linny-R is developed using the _current_ release. Presently (
|
28
|
+
Linny-R is developed using the _current_ release. Presently (June 2023) this is 20.3.0.
|
29
29
|
|
30
30
|
Run the installer and accept the default settings.
|
31
31
|
There is **no** need to install the optional _Tools for Native Modules_.
|
@@ -36,7 +36,7 @@ Verify the installation by typing:
|
|
36
36
|
|
37
37
|
``node --version``
|
38
38
|
|
39
|
-
The response should be the version number of Node.js, for example: v20.
|
39
|
+
The response should be the version number of Node.js, for example: v20.3.0.
|
40
40
|
|
41
41
|
## Installing Linny-R
|
42
42
|
It is advisable to install Linny-R in a directory on your computer, not in a cloud.
|
@@ -170,8 +170,8 @@ Open the Command Line Interface (CLI) of your computer, change to your `WORKING_
|
|
170
170
|
This response should be something similar to:
|
171
171
|
|
172
172
|
<pre>
|
173
|
-
Node.js server for Linny-R version 1.1
|
174
|
-
Node.js version: v20.
|
173
|
+
Node.js server for Linny-R version 1.2.1
|
174
|
+
Node.js version: v20.3.0
|
175
175
|
... etc.
|
176
176
|
</pre>
|
177
177
|
|
@@ -286,8 +286,8 @@ To install Inkscape, please look here: https://inkscape.org/release
|
|
286
286
|
Linny-R will automatically detect whether Inkscape is installed by searching for it in the environment variable PATH on your computer.
|
287
287
|
On a macOS computer, Linny-R will look for Inkscape in /Applications/Inkscape.app/Contents/MacOS.
|
288
288
|
|
289
|
-
**NOTE:** The current installation wizard for Inkscape (version 1.2)
|
290
|
-
|
289
|
+
**NOTE:** The current installation wizard for Inkscape (version 1.2.2) may **not** add the application to the PATH variable.
|
290
|
+
Please check whether you need to do this yourself.
|
291
291
|
|
292
292
|
## Using Linny-R console
|
293
293
|
|
package/console.js
CHANGED
@@ -196,7 +196,7 @@ class ConsoleMonitor {
|
|
196
196
|
return true;
|
197
197
|
}
|
198
198
|
|
199
|
-
submitBlockToSolver(
|
199
|
+
submitBlockToSolver() {
|
200
200
|
let top = MODEL.timeout_period;
|
201
201
|
if(VM.max_solver_time && top > VM.max_solver_time) {
|
202
202
|
top = VM.max_solver_time;
|
@@ -211,7 +211,7 @@ class ConsoleMonitor {
|
|
211
211
|
token: VM.solver_token,
|
212
212
|
block: VM.block_count,
|
213
213
|
round: VM.round_sequence[VM.current_round],
|
214
|
-
data:
|
214
|
+
data: VM.lines,
|
215
215
|
timeout: top
|
216
216
|
}));
|
217
217
|
VM.processServerResponse(data);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "linny-r",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.3.0",
|
4
4
|
"description": "Executable graphical language with WYSIWYG editor for MILP models",
|
5
5
|
"main": "server.js",
|
6
6
|
"scripts": {
|
@@ -29,4 +29,4 @@
|
|
29
29
|
"url": "https://github.com/pwgbots/linny-r/issues"
|
30
30
|
},
|
31
31
|
"homepage": "https://github.com/pwgbots/linny-r#readme"
|
32
|
-
}
|
32
|
+
}
|
package/static/images/paste.png
CHANGED
Binary file
|
package/static/index.html
CHANGED
@@ -28,7 +28,7 @@ implementation is made available via the Linny-R web site.
|
|
28
28
|
-->
|
29
29
|
|
30
30
|
<!--
|
31
|
-
Copyright (c) 2017-
|
31
|
+
Copyright (c) 2017-2023 Delft University of Technology
|
32
32
|
|
33
33
|
Permission is hereby granted, free of charge, to any person obtaining
|
34
34
|
a copy of this software and associated documentation files (the
|
@@ -239,7 +239,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
239
239
|
<img id="load-btn" class="btn enab" src="images/open.png"
|
240
240
|
title="Load model (Ctrl-L)">
|
241
241
|
<img id="settings-btn" class="btn enab" src="images/settings.png"
|
242
|
-
title="Change settings (
|
242
|
+
title="Change model settings (Alt-M)">
|
243
243
|
<img id="save-btn" class="btn enab" src="images/save.png"
|
244
244
|
title="Save model (Ctrl-S)">
|
245
245
|
<img id="repository-btn" class="btn enab" src="images/repository.png"
|
@@ -321,6 +321,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
321
321
|
<td id="step-sep">
|
322
322
|
<img id="stepforward-btn" class="sbtn senab" src="images/forward.png">
|
323
323
|
</td>
|
324
|
+
<td id="issue-panel">
|
325
|
+
<span id="prev-issue">◁</span>
|
326
|
+
<span id="issue-nr"></span>
|
327
|
+
<span id="next-issue">▷</span>
|
328
|
+
</td>
|
324
329
|
<td id="info-line" title="Status bar"></td>
|
325
330
|
<td id="autosave-sep">
|
326
331
|
<img id="autosave-btn" class="btn enab" src="images/restore.png">
|
@@ -347,7 +352,9 @@ and move the cursor over the status bar">
|
|
347
352
|
<img id="note-btn" class="btn toggle enab sep" src="images/note.png"
|
348
353
|
title="Add note">
|
349
354
|
<img id="clone-btn" class="btn disab sep" src="images/clone.png"
|
350
|
-
title="
|
355
|
+
title="Copy selection (Ctrl-C) – Alt-click to clone (Alt-C)">
|
356
|
+
<img id="paste-btn" class="btn disab sep" src="images/paste.png"
|
357
|
+
title="Paste selection (Ctrl-V) -- WORK IN PROGESS!">
|
351
358
|
<img id="delete-btn" class="btn disab sep" src="images/delete.png"
|
352
359
|
title="Delete">
|
353
360
|
<img id="undo-btn" class="btn enab" src="images/undo.png"
|
@@ -1530,7 +1537,8 @@ NOTE: Unit symbols are case-sensitive, so BTU ≠ Btu">
|
|
1530
1537
|
<div id="ds-filter-bar">
|
1531
1538
|
<input id="ds-filter-text" type="text"
|
1532
1539
|
placeholder="(name filtering pattern)"
|
1533
|
-
title="Pattern may contain logical & (AND), | (OR) and ^ (NOT)
|
1540
|
+
title="Pattern may contain logical & (AND), | (OR) and ^ (NOT)
|
1541
|
+
Start with = to find exact match, with ~ to match first characters">
|
1534
1542
|
</div>
|
1535
1543
|
<div id="dataset-scroll-area">
|
1536
1544
|
<table id="dataset-table">
|
@@ -1584,6 +1592,9 @@ NOTE: Unit symbols are case-sensitive, so BTU ≠ Btu">
|
|
1584
1592
|
<img id="ds-delete-modif-btn" class="btn disab"
|
1585
1593
|
src="images/delete.png" title="Delete selected modifier"
|
1586
1594
|
style="margin-left: 20px">
|
1595
|
+
<img id="ds-convert-modif-btn" class="btn enab blink"
|
1596
|
+
src="images/dataset.png" title="Convert modifiers to prefixed datasets"
|
1597
|
+
style="margin-left: 20px; display: none">
|
1587
1598
|
</div>
|
1588
1599
|
<div id="dataset-resize" class="resizer"></div>
|
1589
1600
|
</div>
|
@@ -1604,7 +1615,7 @@ NOTE: Unit symbols are case-sensitive, so BTU ≠ Btu">
|
|
1604
1615
|
<div id="rename-dataset-modal" class="modal">
|
1605
1616
|
<div id="rename-dataset-dlg" class="inp-dlg">
|
1606
1617
|
<div class="dlg-title">
|
1607
|
-
Rename dataset
|
1618
|
+
<span id="rename-dataset-title">Rename dataset</span>
|
1608
1619
|
<img class="cancel-btn" src="images/cancel.png">
|
1609
1620
|
<img class="ok-btn" src="images/ok.png">
|
1610
1621
|
</div>
|
@@ -1643,6 +1654,23 @@ NOTE: * and ? will be interpreted as wildcards"
|
|
1643
1654
|
</div>
|
1644
1655
|
</div>
|
1645
1656
|
|
1657
|
+
<!-- the CONVERT MODIFIER prompts for the new name of a dataset -->
|
1658
|
+
<div id="convert-modifiers-modal" class="modal">
|
1659
|
+
<div id="convert-modifiers-dlg" class="inp-dlg">
|
1660
|
+
<div class="dlg-title">
|
1661
|
+
Convert modifiers to datasets
|
1662
|
+
<img class="cancel-btn" src="images/cancel.png">
|
1663
|
+
<img class="ok-btn" src="images/ok.png">
|
1664
|
+
</div>
|
1665
|
+
<div style="margin: 4px">
|
1666
|
+
Each modifier will become a dataset
|
1667
|
+
<tt><em>prefix</em>: <em>selector</em></tt>
|
1668
|
+
using this prefix:
|
1669
|
+
</div>
|
1670
|
+
<input id="convert-modifiers-prefix" type="text" autocomplete="off">
|
1671
|
+
</div>
|
1672
|
+
</div>
|
1673
|
+
|
1646
1674
|
<!-- the SERIES dialog presents the properties of the time series
|
1647
1675
|
data of the selected dataset, including a text area for copy/paste
|
1648
1676
|
of numbers while showing the line count and checking for correct
|
@@ -1859,7 +1887,8 @@ NOTE: * and ? will be interpreted as wildcards"
|
|
1859
1887
|
<div style="padding: 4px; width: 100px">
|
1860
1888
|
<div id="variable-color-div">
|
1861
1889
|
<div style="display:inline-block; vertical-align:top">Color:</div>
|
1862
|
-
<div id="variable-color"></div>
|
1890
|
+
<div id="variable-color" title="Click to copy, Shift-click to paste"></div>
|
1891
|
+
<div id="variable-paste-color"></div>
|
1863
1892
|
</div>
|
1864
1893
|
<div id="variable-scale-div" style="margin-top: 3px">
|
1865
1894
|
<div style="display:inline-block; vertical-align:top; margin-top: 2px">
|
package/static/linny-r.css
CHANGED
@@ -10,7 +10,7 @@ file that implements the graphical user interface for Linny-R.
|
|
10
10
|
*/
|
11
11
|
|
12
12
|
/*
|
13
|
-
Copyright (c) 2017-
|
13
|
+
Copyright (c) 2017-2023 Delft University of Technology
|
14
14
|
|
15
15
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
16
16
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -413,6 +413,7 @@ textarea {
|
|
413
413
|
#zoom-sep,
|
414
414
|
#step-sep,
|
415
415
|
#info-line,
|
416
|
+
#issue-panel,
|
416
417
|
#autosave-sep {
|
417
418
|
border-right: 1px solid #e2d8e8;
|
418
419
|
}
|
@@ -507,6 +508,36 @@ div.notification-msg.first-msg {
|
|
507
508
|
color: black;
|
508
509
|
}
|
509
510
|
|
511
|
+
#issue-panel {
|
512
|
+
display: none;
|
513
|
+
background-color: Yellow;
|
514
|
+
white-space: nowrap;
|
515
|
+
padding: 0 3px;
|
516
|
+
}
|
517
|
+
|
518
|
+
#issue-nr {
|
519
|
+
padding: 0 4px;
|
520
|
+
cursor: pointer;
|
521
|
+
}
|
522
|
+
|
523
|
+
#prev-issue,
|
524
|
+
#next-issue {
|
525
|
+
cursor: pointer;
|
526
|
+
}
|
527
|
+
|
528
|
+
#prev-issue:hover,
|
529
|
+
#issue-nr:hover,
|
530
|
+
#next-issue:hover {
|
531
|
+
color: Orange;
|
532
|
+
}
|
533
|
+
|
534
|
+
#prev-issue.disab,
|
535
|
+
#next-issue.disab {
|
536
|
+
cursor: default;
|
537
|
+
pointer-events: none;
|
538
|
+
color: #e8d898;
|
539
|
+
}
|
540
|
+
|
510
541
|
/* Modal dialogs cover the entire browser window with a dark,
|
511
542
|
semi-transparent DIV that ignores mouse events. Their z-index
|
512
543
|
is 100+ so that they cover "stay-on-top" dialogs. */
|
@@ -2091,84 +2122,103 @@ tr.def-sel {
|
|
2091
2122
|
font-weight: bold;
|
2092
2123
|
}
|
2093
2124
|
|
2094
|
-
|
2125
|
+
tr.dataset > td > div {
|
2126
|
+
display: inline-block;
|
2127
|
+
}
|
2128
|
+
|
2129
|
+
div.ds-indent {
|
2130
|
+
color: #909090;
|
2131
|
+
text-align: right;
|
2132
|
+
font-weight: normal !important;
|
2133
|
+
margin-right: 2px;
|
2134
|
+
margin-left: 3px;
|
2135
|
+
}
|
2136
|
+
|
2137
|
+
div.tree-btn {
|
2138
|
+
color: #909090;
|
2139
|
+
margin-right: 3px;
|
2140
|
+
cursor: pointer;
|
2141
|
+
margin-left: -13px;
|
2142
|
+
}
|
2143
|
+
|
2144
|
+
div.modif::before {
|
2095
2145
|
content: ' \2045';
|
2096
2146
|
color: #b00080;
|
2097
2147
|
margin-right: 2px;
|
2098
2148
|
}
|
2099
2149
|
|
2100
|
-
|
2150
|
+
div.outcome::before {
|
2101
2151
|
content: ' \25C8';
|
2102
2152
|
color: #b00080;
|
2103
2153
|
margin-right: 1px;
|
2104
2154
|
}
|
2105
2155
|
|
2106
|
-
|
2156
|
+
div.array::before {
|
2107
2157
|
content: ' \2263';
|
2108
2158
|
color: #b00080;
|
2109
2159
|
margin-right: 1px;
|
2110
2160
|
}
|
2111
2161
|
|
2112
|
-
|
2162
|
+
div.series::before {
|
2113
2163
|
content: ' \28B8';
|
2114
2164
|
color: #b00080;
|
2115
2165
|
margin-left: -4px;
|
2116
2166
|
}
|
2117
2167
|
|
2118
|
-
|
2168
|
+
div.outcome.modif::before {
|
2119
2169
|
content: ' \25C8\2045';
|
2120
2170
|
color: #b00080;
|
2121
2171
|
margin-right: 2px;
|
2122
2172
|
}
|
2123
2173
|
|
2124
|
-
|
2174
|
+
div.array.modif::before {
|
2125
2175
|
content: ' \2263\2045';
|
2126
2176
|
color: #b00080;
|
2127
2177
|
margin-right: 1px;
|
2128
2178
|
}
|
2129
2179
|
|
2130
|
-
|
2180
|
+
div.series.modif::before {
|
2131
2181
|
content: ' \28B8\2045';
|
2132
2182
|
color: #b00080;
|
2133
2183
|
margin-left: -4px;
|
2134
2184
|
}
|
2135
2185
|
|
2136
|
-
|
2186
|
+
div.blackbox::before {
|
2137
2187
|
content: ' \25FC';
|
2138
2188
|
color: #b00080;
|
2139
2189
|
}
|
2140
2190
|
|
2141
|
-
|
2191
|
+
div.blackbox.series::before {
|
2142
2192
|
content: ' \25FC\28B8';
|
2143
2193
|
color: #b00080;
|
2144
2194
|
}
|
2145
2195
|
|
2146
|
-
|
2196
|
+
div.blackbox.array::before {
|
2147
2197
|
content: ' \25FC\2263';
|
2148
2198
|
color: #b00080;
|
2149
2199
|
}
|
2150
2200
|
|
2151
|
-
|
2201
|
+
div.blackbox.outcome::before {
|
2152
2202
|
content: ' \25FC\25C8';
|
2153
2203
|
color: #b00080;
|
2154
2204
|
}
|
2155
2205
|
|
2156
|
-
|
2206
|
+
div.blackbox.modif::before {
|
2157
2207
|
content: ' \25FC\2045';
|
2158
2208
|
color: #b00080;
|
2159
2209
|
}
|
2160
2210
|
|
2161
|
-
|
2211
|
+
div.blackbox.series.modif::before {
|
2162
2212
|
content: ' \25FC\28B8\2045';
|
2163
2213
|
color: #b00080;
|
2164
2214
|
}
|
2165
2215
|
|
2166
|
-
|
2216
|
+
div.blackbox.array.modif::before {
|
2167
2217
|
content: ' \25FC\2263\2045';
|
2168
2218
|
color: #b00080;
|
2169
2219
|
}
|
2170
2220
|
|
2171
|
-
|
2221
|
+
div.blackbox.outcome.modif::before {
|
2172
2222
|
content: ' \25FC\25C8\2045';
|
2173
2223
|
color: #b00080;
|
2174
2224
|
}
|
@@ -2294,6 +2344,17 @@ td.equation-expression {
|
|
2294
2344
|
bottom: 5px;
|
2295
2345
|
}
|
2296
2346
|
|
2347
|
+
/* CONVERT MODIFIERS modal dialog */
|
2348
|
+
#convert-modifiers-dlg {
|
2349
|
+
width: 220px;
|
2350
|
+
height: 84px;
|
2351
|
+
}
|
2352
|
+
|
2353
|
+
#convert-modifiers-prefix {
|
2354
|
+
margin: 3px;
|
2355
|
+
width: calc(100% - 8px);
|
2356
|
+
}
|
2357
|
+
|
2297
2358
|
/* SERIES modal dialog */
|
2298
2359
|
#series-dlg {
|
2299
2360
|
width: 165px;
|
@@ -2738,6 +2799,17 @@ img.v-disab {
|
|
2738
2799
|
height: 15px;
|
2739
2800
|
border: 1px solid Black;
|
2740
2801
|
background-color: #c00000;
|
2802
|
+
cursor: pointer;
|
2803
|
+
}
|
2804
|
+
|
2805
|
+
#variable-paste-color {
|
2806
|
+
display: none;
|
2807
|
+
vertical-align: top;
|
2808
|
+
margin-left: 3px;
|
2809
|
+
width: 13px;
|
2810
|
+
height: 13px;
|
2811
|
+
border: 1px solid Silver;
|
2812
|
+
background-color: #c00000;
|
2741
2813
|
}
|
2742
2814
|
|
2743
2815
|
#variable-scale {
|
@@ -12,7 +12,7 @@ file all have their graphical extensions in file linny-r-gui.js.
|
|
12
12
|
*/
|
13
13
|
|
14
14
|
/*
|
15
|
-
Copyright (c) 2017-
|
15
|
+
Copyright (c) 2017-2023 Delft University of Technology
|
16
16
|
|
17
17
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
18
18
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -290,15 +290,32 @@ class Controller {
|
|
290
290
|
validName(name) {
|
291
291
|
// Returns TRUE if `name` is a valid Linny-R entity name. These names
|
292
292
|
// must not be empty strings, may not contain brackets, backslashes or
|
293
|
-
// vertical bars,
|
294
|
-
//
|
293
|
+
// vertical bars, may not end with a colon, and must start with an
|
294
|
+
// underscore, a letter or a digit. This is enforced mainly to
|
295
|
+
// preclude parsing issues with variable names
|
295
296
|
// NOTE: normalize to also accept letters with accents
|
296
297
|
if(name === this.TOP_CLUSTER_NAME) return true;
|
297
298
|
name = name.normalize('NFKD').trim();
|
298
|
-
return name && !name.match(/\[\\\|\]/) &&
|
299
|
+
return name && !name.match(/\[\\\|\]/) && !name.endsWith(':') &&
|
299
300
|
(name.startsWith(this.BLACK_BOX) || name[0].match(/[\w]/));
|
300
301
|
}
|
301
302
|
|
303
|
+
prefixesAndName(name) {
|
304
|
+
// Returns name split exclusively at '[non-space]: [non-space]'
|
305
|
+
const
|
306
|
+
s = name.split(this.PREFIXER),
|
307
|
+
pan = [s[0]];
|
308
|
+
for(let i = 1; i < s.length; i++) {
|
309
|
+
const j = pan.length - 1;
|
310
|
+
if(s[i].startsWith(' ') || (i > 0 && pan[j].endsWith(' '))) {
|
311
|
+
pan[j] += s[i];
|
312
|
+
} else {
|
313
|
+
pan.push(s[i]);
|
314
|
+
}
|
315
|
+
}
|
316
|
+
return pan;
|
317
|
+
}
|
318
|
+
|
302
319
|
nameToID(name) {
|
303
320
|
// Returns a name in lower case with link arrow replaced by three
|
304
321
|
// underscores, constraint link arrow by four underscores, and spaces
|
@@ -466,6 +483,7 @@ class Controller {
|
|
466
483
|
rotatingIcon() {}
|
467
484
|
setProgressNeedle() {}
|
468
485
|
updateTimeStep() {}
|
486
|
+
updateIssuePanel() {}
|
469
487
|
updateDraggableDialogs() {}
|
470
488
|
logHeapSize() {}
|
471
489
|
|