Graphene under spatially varying external potentials: Landau levels, magnetotransport, and topological modes