 
   # x and y scales for top figure
   xScale = d3.scale.linear()
-             .domain([0, data.ind.length+1])
+             .domain([-1, data.ind.length])
              .range([pad.left, w-pad.right])
+
+  # width of rectangles in top panel
+  recWidth = xScale(1) - xScale(0)
 
   yScale = d3.scale.linear()
              .domain(topylim)

#   is show below; click for it to persist; click again to make it go away.
#

d3.json("data.json", (data) ->

  # dimensions of SVG
  w = 1000

                 .text((d) -> data.ind[d])

    .on "mouseout", (d) ->
              if !clickStatus[d]
                d3.select(this).attr("opacity", "0")

    .on "click", (d) ->
              console.log("Click: #{data.ind[d]} (#{d})")
              clickStatus[d] = 1 - clickStatus[d]
              d3.select(this).attr("opacity", clickStatus[d])
              if clickStatus[d]
                curcolor = histColors.shift()
                histColors.push(curcolor)

                d3.select(this).attr("fill", curcolor)

                grp4BkgdHist.append("path")
                      .datum(data.counts[d])
