From b4c345e6a5fa929ba20eac19183b9c777055f52d Mon Sep 17 00:00:00 2001 From: Gaspard Coulet Date: Wed, 28 Apr 2021 23:12:36 +0200 Subject: Initial commit --- javascript_network/neuron.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 javascript_network/neuron.js (limited to 'javascript_network/neuron.js') 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); + } + + } + +}; -- cgit v1.2.3