         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")

  cells.on("mouseout", -> mouseout())

  mouseout = ->
    svg.selectAll("#tooltip").remove()
    hilit[0].remove()
    hilit[1].remove()



# create SVG element and shift it down and to right
svg = d3.select("body").selectAll("#rf").append("svg")
    .attr("width", lwidth + 2*margin.left + 2*margin.right + rwidth)
    .attr("height", height + margin.top + margin.bottom)
  .append("g")
    .attr("transform", "translate(#{margin.left},#{margin.top})")
