docs: function heatmap() {
    var args = mlutil.asArray.apply(null, arguments);
    var argLen = args.length;
    if (argLen < 1) {
      throw new Error('no region or divisions for heat map');
    }
  
    var hmap = {};
    switch(argLen) {
    case 3:
      var first  = args[0];
      var second = args[1];
      var third  = args[2];
      var region = null;
      if (typeof first === 'object' && first !== null) {
        region = first;
        hmap.latdivs = second;
        hmap.londivs = third;
      } else if (typeof third === 'object' && third !== null) {
        region = third;
        hmap.latdivs = first;
        hmap.londivs = second;
      } else {
        throw new Error('no first or last region for heat map');
      }
  
      var keys = ['s', 'w', 'n', 'e'];
      for (var i=0; i < keys.length; i++) {
        var key   = keys[i];
        var value = region[key];
        if (value != null) {
          hmap[key] = value;
          continue;
        } else {
          var altKey = null;
          switch(key) {
          case 's':
            altKey = 'south';
            break;
          case 'w':
            altKey = 'west';
            break;
          case 'n':
            altKey = 'north';
            break;
          case 'e':
            altKey = 'east';
            break;
          }
          value = (altKey !== null) ? region[altKey] : null;
          if (value != null) {
            hmap[key] = value;
            continue;
          }
        }
        throw new Error('heat map does not have '+key+' key');
      }
      break;
    case 6:
      hmap.latdivs = args[0];
      hmap.londivs = args[1];
      hmap.s = args[2];
      hmap.w = args[3];
      hmap.n = args[4];
      hmap.e = args[5];
      break;
    default:
      throw new Error('could not assign parameters to heat map');
    }
  
    return {'heatmap': hmap};
  }