Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
saliherdemk committed Sep 20, 2024
1 parent 1422289 commit ef67934
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 65 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
python/.venv
Data/new.json
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ <h3>Grada</h3>
<script src="js/MLP/Layer.js"></script>
<script src="js/MLP/MLP.js"></script>

<script src="js/pressable.js"></script>
<script src="js/draggable.js"></script>

<script src="js/Draw/Minors/LoadingIndicator.js"></script>
Expand Down
6 changes: 6 additions & 0 deletions js/Draw/Layer/BaseLayers/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ class Component extends FunctionalLayerView {
this.connected = null;
}

// FIXME: determinate if isLoading exists. if is merge the function with mlpview
// handlePressed() {
// this.getPressables().forEach((p) => p.handlePressed());
// iManager.checkRollout(this);
// }

handleRemove() {
if (this.connected) {
this.clearLines();
Expand Down
1 change: 0 additions & 1 deletion js/Draw/Layer/BaseLayers/FunctionalLayerView.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class FunctionalLayerView extends LayerView {
}

destroy() {
this.removeButton.destroy();
this.removeButton = null;

this.getDots().forEach((dot) => dot.destroy());
Expand Down
7 changes: 4 additions & 3 deletions js/Draw/Minors/Buttons/CanvasButton.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
class CanvasButton extends Pressable {
class CanvasButton {
constructor(onClick) {
super();
this.x = 0;
this.y = 0;
this.w = 25;
this.h = 25;
this.disabled = false;
this.hidden = false;
this.loading = false;
this.setOnClick(() => !this.isDisabled() && onClick());
this.handlePressed = () => {
!this.isDisabled() && iManager.checkRollout(this) && onClick();
};
}

isHidden() {
Expand Down
9 changes: 3 additions & 6 deletions js/Draw/Minors/Dot.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
class Dot extends Pressable {
class Dot {
constructor(parent) {
super();
this.parent = parent;
this.rollover = false;
this.occupied = false;
Expand All @@ -10,7 +9,6 @@ class Dot extends Pressable {
this.theme = "red";
this.setColor();
this.updateCoordinates();
this.setOnClick(this.pressed);
}

isHidden() {
Expand Down Expand Up @@ -48,7 +46,6 @@ class Dot extends Pressable {

destroy() {
this.parent = null;
super.destroy();
}

updateCoordinates() {
Expand All @@ -61,8 +58,8 @@ class Dot extends Pressable {
this.rollover = iManager.isHovered(this);
}

pressed() {
if (this.isHidden() || !this.rollover) return;
handlePressed() {
if (this.isHidden() || !iManager.checkRollout(this)) return;

const activeLine = mainOrganizer.getActiveLine();

Expand Down
11 changes: 0 additions & 11 deletions js/Workers/DataProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,4 @@ class DataProcessor {
processChunk();
});
}

jsonStringify(data) {
const jsonWorker = new Worker("../../../js/Workers/jsonStringifyWorker.js");
return new Promise((resolve) => {
jsonWorker.postMessage(data);
jsonWorker.onmessage = function (e) {
jsonWorker.terminate();
resolve(e.data);
};
});
}
}
13 changes: 0 additions & 13 deletions js/Workers/connectNeuronsWorker.js

This file was deleted.

6 changes: 0 additions & 6 deletions js/Workers/initializeMlpWorker.js

This file was deleted.

5 changes: 0 additions & 5 deletions js/Workers/jsonStringifyWorker.js

This file was deleted.

7 changes: 5 additions & 2 deletions js/draggable.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
class Draggable extends Pressable {
class Draggable {
constructor(x, y, w, h) {
super();
this.x = x;
this.y = y;
this.w = w;
this.h = h;
}

handlePressed() {
iManager.checkRollout(this);
}

setCoordinates(x, y) {
this.x = x;
this.y = y;
Expand Down
17 changes: 0 additions & 17 deletions js/pressable.js

This file was deleted.

0 comments on commit ef67934

Please sign in to comment.