
var width = document.getElementById("juxtaposition").clientWidth - 10;
var elementWidth = 1; //width/alignedResidues[0].length;

var BallColors = [];

//init sequenceAlignment ball colours, juxtaZoom 
function initShit(){
  for (var i = 0; i < proteins.length; i++) {
      BallColors[i] = ['green', 'red'];
      juxtaZoom[i] = [0, ss[i].length];
  }
  globalZoom = [0, ss[0].length];
  
}

function redrawD3(){
    // sequenceAlignment.selectAll("*").remove();
    juxtaposition.selectAll("*").remove();
    //superposition.selectAll("*").remove();
    // loopDetail.selectAll("*").remove();

    for (var i = 0; i < proteins.length; i++) {
        // drawSequenceAlignment(i);
        drawJuxtaposition(i);
        //drawSuperposition(i);
    }

    drawLoopsDetails();
    // for (var i = 0; i < proteins.length; i++) {
    //     if(i!==reference)drawSuperposition(i);
    // }
    // drawSuperposition(reference);
}


  function blendColors(c0, c1, p) {
      var f=parseInt(c0.slice(1),16),t=parseInt(c1.slice(1),16),R1=f>>16,G1=f>>8&0x00FF,B1=f&0x0000FF,R2=t>>16,G2=t>>8&0x00FF,B2=t&0x0000FF;
      return "#"+(0x1000000+(Math.round((R2-R1)*p)+R1)*0x10000+(Math.round((G2-G1)*p)+G1)*0x100+(Math.round((B2-B1)*p)+B1)).toString(16).slice(1);
  }