routine to get sorted rows. heatmapData does not yet have a sort rows method, though.