Visualization of sorting javascript