提交 869d5fdc 编写于 作者: J Jason Park

Minor changes

上级 36031b77
......@@ -4,7 +4,7 @@ import path from 'path';
const router = express.Router();
const getJsWorker = (req, res, next) => {
res.sendFile(path.resolve(__dirname, '..', 'tracers', 'js', 'built', 'index.js'));
res.sendFile(path.resolve(__dirname, '..', 'tracers', 'languages', 'js', 'built', 'index.js'));
};
const compileJava = (req, res, next) => {
......
Subproject commit 3503c7aaefd8940262cc66db16a20d73a3bc5229
Subproject commit 0a6c45206fae3150ea588dd8b92dfe246a29b194
Subproject commit d3a19f1bc766d54db2398467539f9245f6d3c6e5
Subproject commit bb36f233ba74c31c7506f5d3df74a6ec6716f8a8
......@@ -5,7 +5,7 @@ $color-font: #bbbbbb;
$color-shadow: rgba(#000000, .2);
$color-overlay: rgba(#ffffff, .1);
$color-selected: #2962ff;
$color-notified: #c51162;
$color-patched: #c51162;
$color-highlight: #29d;
:export {
......@@ -16,6 +16,6 @@ $color-highlight: #29d;
colorShadow: $color-shadow;
colorOverlay: $color-overlay;
colorSelected: $color-selected;
colorNotified: $color-notified;
colorNotified: $color-patched;
colorHighlight: $color-highlight;
}
\ No newline at end of file
......@@ -21,12 +21,12 @@ class Array1DData extends Array2DData {
super.depatch(0, x);
}
select(s, e = s) {
super.select(0, s, 0, e);
select(sx, ex = sx) {
super.select(0, sx, 0, ex);
}
deselect(s, e = s) {
super.deselect(0, s, 0, e);
deselect(sx, ex = sx) {
super.deselect(0, sx, 0, ex);
}
chart(tracerKey) {
......
......@@ -8,7 +8,7 @@ class Array2DData extends Data {
for (const value of array1d) {
const col = {
value,
notified: false,
patched: false,
selected: false,
};
row.push(col);
......@@ -20,11 +20,11 @@ class Array2DData extends Data {
patch(x, y, v = this.data[x][y].value) {
this.data[x][y].value = v;
this.data[x][y].notified = true;
this.data[x][y].patched = true;
}
depatch(x, y) {
this.data[x][y].notified = false;
this.data[x][y].patched = false;
}
select(sx, sy, ex = sx, ey = sy) {
......
......@@ -16,11 +16,11 @@ class Data {
if (this.onRender) this.onRender();
}
reset() {
this.set();
set() {
}
set() {
reset() {
this.set();
}
delay() {
......
......@@ -20,14 +20,6 @@ class GraphData extends Data {
this.logData = null;
}
directed(isDirected = true) {
this.isDirected = isDirected;
}
weighted(isWeighted = true) {
this.isWeighted = isWeighted;
}
set(array2d = []) {
this.nodes = [];
this.edges = [];
......@@ -44,6 +36,14 @@ class GraphData extends Data {
super.set();
}
directed(isDirected = true) {
this.isDirected = isDirected;
}
weighted(isWeighted = true) {
this.isWeighted = isWeighted;
}
addNode(id, weight = null, visitedCount = 0, selectedCount = 0, x = 0, y = 0) {
if (this.findNode(id)) return;
this.nodes.push({ id, weight, visitedCount, selectedCount, x, y });
......@@ -184,14 +184,14 @@ class GraphData extends Data {
}
visit(target, source, weight) {
this.visitOrLeave(target, source, weight, true);
this.visitOrLeave(true, target, source, weight);
}
leave(target, source, weight) {
this.visitOrLeave(target, source, weight, false);
this.visitOrLeave(false, target, source, weight);
}
visitOrLeave(target, source, weight, visit) {
visitOrLeave(visit, target, source = null, weight = null) {
const edge = this.findEdge(source, target);
if (edge) edge.visitedCount += visit ? 1 : -1;
const node = this.findNode(target);
......@@ -203,14 +203,14 @@ class GraphData extends Data {
}
select(target, source) {
this.selectOrDeselect(target, source, true);
this.selectOrDeselect(true, target, source);
}
deselect(target, source) {
this.selectOrDeselect(target, source, false);
this.selectOrDeselect(false, target, source);
}
selectOrDeselect(target, source, select) {
selectOrDeselect(select, target, source = null) {
const edge = this.findEdge(source, target);
if (edge) edge.selectedCount += select ? 1 : -1;
const node = this.findNode(target);
......
......@@ -16,7 +16,7 @@ class Array2DRenderer extends Renderer {
<tr className={styles.row} key={i}>
{
row.map((col, j) => (
<td className={classes(styles.col, col.selected && styles.selected, col.notified && styles.notified)}
<td className={classes(styles.col, col.selected && styles.selected, col.patched && styles.patched)}
key={j}>
<span className={styles.value}>{this.toString(col.value)}</span>
</td>
......
......@@ -28,8 +28,8 @@
background-color: $color-selected;
}
&.notified {
background-color: $color-notified;
&.patched {
background-color: $color-patched;
}
}
}
......
......@@ -10,7 +10,7 @@ class ChartRenderer extends Array1DRenderer {
const chartData = {
labels: row.map(col => `${col.value}`),
datasets: [{
backgroundColor: row.map(col => col.notified ? styles.colorNotified : col.selected ? styles.colorSelected : styles.colorFont),
backgroundColor: row.map(col => col.patched ? styles.colorNotified : col.selected ? styles.colorSelected : styles.colorFont),
data: row.map(col => col.value),
}],
};
......
......@@ -33,8 +33,8 @@
&.visited {
.circle {
fill: $color-notified;
stroke: $color-notified;
fill: $color-patched;
stroke: $color-patched;
}
}
}
......@@ -71,7 +71,7 @@
&.visited {
.line {
stroke: $color-notified;
stroke: $color-patched;
&.directed {
marker-end: url(#markerArrowVisited);
......@@ -79,7 +79,7 @@
}
.weight {
fill: $color-notified;
fill: $color-patched;
}
}
}
......@@ -92,7 +92,7 @@
}
&.visited {
fill: $color-notified;
fill: $color-patched;
}
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册