def map
      #i=0
      map={} 
      values=[]
      @array.each_with_index {|x,j|
        m=map
        (@keys.size-1).times {|i|
          k=@keys[i].call(x)
          m[k]={} if (!m[k])
          m=m[k]
        }
        k=@keys.last.call(x)
        if(!m[k])
          a=[]
          values.push(a)
          m[k]=a
        end
        m[k].push(x)
      }
      if(self.order)
        values.each_with_index {|v,vi|
          values[vi].sort!(&self.order)
        }
      end
      map
    end
def map
      #i=0
      map={} 
      values=[]
      @array.each_with_index {|x,j|
        m=map
        (@keys.size-1).times {|i|
          k=@keys[i].call(x)
          m[k]={} if (!m[k])
          m=m[k]
        }
        k=@keys.last.call(x)
        if(!m[k])
          a=[]
          values.push(a)
          m[k]=a
        end
        m[k].push(x)
      }
      if(self.order)
        values.each_with_index {|v,vi|
          values[vi].sort!(&self.order)
        }
      end
      map
    end
Returns a hierarchical map of values. Each key adds one level to the
 hierarchy. With only a single key, the returned map will have a key for each
 distinct value of the key function; the correspond value with be an array of
 elements with that key value. If a second key is added, this will be a nested
 map. For example:

 <pre>Rubyvis.nest(yields)
     .key(function(d) d.variety)
     .key(function(d) d.site)
     .map()</pre>

 returns a map <tt>m</tt> such that <tt>m[variety][site]</tt> is an array, a subset of
 <tt>yields</tt>, with each element having the given variety and site.

 @returns a hierarchical map of values