summaryrefslogtreecommitdiff
path: root/javascript_network/neuron.js
blob: a3d3654d3358dc5ebde17a9ac6f24d6a89c6b8f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);
    }

  }

};