Equidistribution and variation of height functions