support horizontal and vertical view for the waterfall layout