summaryrefslogtreecommitdiff
path: root/javascript_network/neuron.js
diff options
context:
space:
mode:
authorGaspard Coulet <gaspard.coulet@mines-ales.org>2021-04-28 23:12:36 +0200
committerGaspard Coulet <gaspard.coulet@mines-ales.org>2021-04-28 23:12:36 +0200
commitb4c345e6a5fa929ba20eac19183b9c777055f52d (patch)
tree23a0232f2526c5ab7f53391609a8a0a5960865f0 /javascript_network/neuron.js
Initial commit
Diffstat (limited to 'javascript_network/neuron.js')
-rw-r--r--javascript_network/neuron.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/javascript_network/neuron.js b/javascript_network/neuron.js
new file mode 100644
index 0000000..a3d3654
--- /dev/null
+++ b/javascript_network/neuron.js
@@ -0,0 +1,28 @@
+var neuron=function(x,y,r,nbI,nbO,Bl){
+
+ this.x=x;
+ this.y=y;
+ this.radius=r;
+ this.nbrInput=nbI;
+ this.nbrOutput=nbO;
+ this.BranchLength=Bl;
+
+ this.show=function(info,cpt){
+ fill(200,0,0);
+ noStroke();
+ ellipse(this.x,this.y,r,r);
+ fill(255);
+ strokeWeight(2);
+ textSize(10);
+ if(mouseX> this.x-r/2 && mouseX< this.x+r/2 && mouseY> this.y-r/2 && mouseY< this.y+r/2){
+ stroke(0,0,150);
+ fill(20);
+ rect(mouseX+50,mouseY,60,(cpt+1)*20);
+ fill(255);
+ noStroke();
+ text(info,mouseX+60,mouseY+20);
+ }
+
+ }
+
+};