Skip to content

Commit 869d5fd

Browse files
committed
Minor changes
1 parent 36031b7 commit 869d5fd

File tree

12 files changed

+38
-38
lines changed

12 files changed

+38
-38
lines changed

src/backend/controllers/compiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import path from 'path';
44
const router = express.Router();
55

66
const getJsWorker = (req, res, next) => {
7-
res.sendFile(path.resolve(__dirname, '..', 'tracers', 'js', 'built', 'index.js'));
7+
res.sendFile(path.resolve(__dirname, '..', 'tracers', 'languages', 'js', 'built', 'index.js'));
88
};
99

1010
const compileJava = (req, res, next) => {

src/backend/tracers

src/frontend/common/stylesheet/colors.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ $color-font: #bbbbbb;
55
$color-shadow: rgba(#000000, .2);
66
$color-overlay: rgba(#ffffff, .1);
77
$color-selected: #2962ff;
8-
$color-notified: #c51162;
8+
$color-patched: #c51162;
99
$color-highlight: #29d;
1010

1111
:export {
@@ -16,6 +16,6 @@ $color-highlight: #29d;
1616
colorShadow: $color-shadow;
1717
colorOverlay: $color-overlay;
1818
colorSelected: $color-selected;
19-
colorNotified: $color-notified;
19+
colorNotified: $color-patched;
2020
colorHighlight: $color-highlight;
2121
}

src/frontend/core/datas/Array1DData.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ class Array1DData extends Array2DData {
2121
super.depatch(0, x);
2222
}
2323

24-
select(s, e = s) {
25-
super.select(0, s, 0, e);
24+
select(sx, ex = sx) {
25+
super.select(0, sx, 0, ex);
2626
}
2727

28-
deselect(s, e = s) {
29-
super.deselect(0, s, 0, e);
28+
deselect(sx, ex = sx) {
29+
super.deselect(0, sx, 0, ex);
3030
}
3131

3232
chart(tracerKey) {

src/frontend/core/datas/Array2DData.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Array2DData extends Data {
88
for (const value of array1d) {
99
const col = {
1010
value,
11-
notified: false,
11+
patched: false,
1212
selected: false,
1313
};
1414
row.push(col);
@@ -20,11 +20,11 @@ class Array2DData extends Data {
2020

2121
patch(x, y, v = this.data[x][y].value) {
2222
this.data[x][y].value = v;
23-
this.data[x][y].notified = true;
23+
this.data[x][y].patched = true;
2424
}
2525

2626
depatch(x, y) {
27-
this.data[x][y].notified = false;
27+
this.data[x][y].patched = false;
2828
}
2929

3030
select(sx, sy, ex = sx, ey = sy) {

src/frontend/core/datas/Data.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ class Data {
1616
if (this.onRender) this.onRender();
1717
}
1818

19-
reset() {
20-
this.set();
19+
set() {
2120
}
2221

23-
set() {
22+
reset() {
23+
this.set();
2424
}
2525

2626
delay() {

src/frontend/core/datas/GraphData.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ class GraphData extends Data {
2020
this.logData = null;
2121
}
2222

23-
directed(isDirected = true) {
24-
this.isDirected = isDirected;
25-
}
26-
27-
weighted(isWeighted = true) {
28-
this.isWeighted = isWeighted;
29-
}
30-
3123
set(array2d = []) {
3224
this.nodes = [];
3325
this.edges = [];
@@ -44,6 +36,14 @@ class GraphData extends Data {
4436
super.set();
4537
}
4638

39+
directed(isDirected = true) {
40+
this.isDirected = isDirected;
41+
}
42+
43+
weighted(isWeighted = true) {
44+
this.isWeighted = isWeighted;
45+
}
46+
4747
addNode(id, weight = null, visitedCount = 0, selectedCount = 0, x = 0, y = 0) {
4848
if (this.findNode(id)) return;
4949
this.nodes.push({ id, weight, visitedCount, selectedCount, x, y });
@@ -184,14 +184,14 @@ class GraphData extends Data {
184184
}
185185

186186
visit(target, source, weight) {
187-
this.visitOrLeave(target, source, weight, true);
187+
this.visitOrLeave(true, target, source, weight);
188188
}
189189

190190
leave(target, source, weight) {
191-
this.visitOrLeave(target, source, weight, false);
191+
this.visitOrLeave(false, target, source, weight);
192192
}
193193

194-
visitOrLeave(target, source, weight, visit) {
194+
visitOrLeave(visit, target, source = null, weight = null) {
195195
const edge = this.findEdge(source, target);
196196
if (edge) edge.visitedCount += visit ? 1 : -1;
197197
const node = this.findNode(target);
@@ -203,14 +203,14 @@ class GraphData extends Data {
203203
}
204204

205205
select(target, source) {
206-
this.selectOrDeselect(target, source, true);
206+
this.selectOrDeselect(true, target, source);
207207
}
208208

209209
deselect(target, source) {
210-
this.selectOrDeselect(target, source, false);
210+
this.selectOrDeselect(false, target, source);
211211
}
212212

213-
selectOrDeselect(target, source, select) {
213+
selectOrDeselect(select, target, source = null) {
214214
const edge = this.findEdge(source, target);
215215
if (edge) edge.selectedCount += select ? 1 : -1;
216216
const node = this.findNode(target);

src/frontend/core/renderers/Array2DRenderer/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Array2DRenderer extends Renderer {
1616
<tr className={styles.row} key={i}>
1717
{
1818
row.map((col, j) => (
19-
<td className={classes(styles.col, col.selected && styles.selected, col.notified && styles.notified)}
19+
<td className={classes(styles.col, col.selected && styles.selected, col.patched && styles.patched)}
2020
key={j}>
2121
<span className={styles.value}>{this.toString(col.value)}</span>
2222
</td>

src/frontend/core/renderers/Array2DRenderer/stylesheet.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
background-color: $color-selected;
2929
}
3030

31-
&.notified {
32-
background-color: $color-notified;
31+
&.patched {
32+
background-color: $color-patched;
3333
}
3434
}
3535
}

0 commit comments

Comments
 (0)