         cell.value = 0.5 if cell.value > 0.5
         cell.value = -4*(log2(cell.value)+1)/12*zmax
     cell.value = zmax if cell.value > zmax
-  )    
-        
+  )
+
   # the pixels
   cells = svg.selectAll(".cell")
       .data(rf)


  cells.on("mouseout", ->
    d3.select(this).style("stroke","none"))
  
  # add black border
  border = svg.append("rect")
      .attr("class", "border")
      .attr("width", width)
      .attr("height", height)

  chrborder = svg.selectAll("#chr")
      .data(chr)
    .enter().append("rect")
      .attr("class", "border")
      .attr("id", "chr")
      .attr("x", (d) -> xscale(d.lo-1))
      .attr("y", (d) -> yscale(d.hi-1))
      .attr("width", (d) -> xscale.rangeBand()*d.nmar)
      .attr("height", (d) -> yscale.rangeBand()*d.nmar)
)


  # plug in -1 for nulls
  rf.forEach((cell) -> cell.value = -1 if cell.value is null)

  # threshold the values and transform recombination fractions
  rf.forEach((cell) ->
    cell.state = 0
    if cell.value is null
      cell.value = 0.5 if cell.row < cell.col
