 intervals_from_position_page = (fingering) ->
   canvas_gutter = 20
   header_height = 20
-  grid 3, 4, padded_fretboard_width + canvas_gutter, padded_fretboard_height + header_height, 0, (cell) ->
+  grid {cols: 3, rows: 4
+  , cell_width: padded_fretboard_width + canvas_gutter
+  , cell_height: padded_fretboard_height + header_height}
+  , (cell) ->
     for interval_name, semitones in Intervals
       cell ->
         ctx.translate 0, header_height

#
# Fretboard
#
strings = [1..6]
string_count = strings.length

frets = [0..4]  # includes nut
fret_count = frets.length - 1  # doesn't include nut

StringIntervals = [5, 5, 5, 4, 5]
StringNoteNumbers = (->


if draw_diagrams
  draw_strings = ->
    for n, i in StringNumbers
      x = i * string_spacing + h_gutter
      ctx.beginPath()
      ctx.moveTo x, v_gutter
      ctx.lineTo x, v_gutter + FretCount * fret_height + fret_overhang
      ctx.stroke()

  draw_frets = ->
    for fret_number in FretNumbers
      y = fret_number * fret_height + v_gutter
      ctx.beginPath()
      ctx.moveTo v_gutter-.5, y
      ctx.lineTo v_gutter+.5 + (StringCount - 1) * string_spacing, y
      ctx.lineWidth = 3 if fret_number == 0
      ctx.stroke()
      ctx.lineWidth = 1
