show(scale = this.scale) {
    for (let i = 0; i < this.arr.length; i++) {
      let j = (barInterval * i + 1) * barWidth;
      stroke(colors[this.states[i]]);
      strokeWeight(barWidth);
      line(j, height / scale - barWidth, j, (height - this.arr[i]) / scale - barWidth);
      if (this.hasOwnProperty('auxilaryArray')) {
        stroke(colors[this.auxilaryStates[i]]);
        line(j, height - barWidth, j, height - this.auxilaryArray[i] / scale - barWidth);
      }
    }
  }
/* Draw bars on canvas, using p5.js */
Draw bars on canvas, using p5.js
Draw bars on canvas using p5 . js
show(scale = this.scale) {
    for (let i = 0; i < this.arr.length; i++) {
      let j = (barInterval * i + 1) * barWidth;
      stroke(colors[this.states[i]]);
      strokeWeight(barWidth);
      line(j, height / scale - barWidth, j, (height - this.arr[i]) / scale - barWidth);
      if (this.hasOwnProperty('auxilaryArray')) {
        stroke(colors[this.auxilaryStates[i]]);
        line(j, height - barWidth, j, height - this.auxilaryArray[i] / scale - barWidth);
      }
    }
  }
show ( scale = this . scale ) { for ( let i = 0 ; i < this . arr . length ; i ++ ) { let j = ( barInterval * i + 1 ) * barWidth ; stroke ( colors [ this . states [ i ] ] ) ; strokeWeight ( barWidth ) ; line ( j , height / scale - barWidth , j , ( height - this . arr [ i ] ) / scale - barWidth ) ; if ( this . hasOwnProperty ( 'auxilaryArray' ) ) { stroke ( colors [ this . auxilaryStates [ i ] ] ) ; line ( j , height - barWidth , j , height - this . auxilaryArray [ i ] / scale - barWidth ) ; } } }
Draw bars on canvas, using p5.js
Draw bars on canvas using p5 . js