Structural transformation from a coplanar layer to a linear chain by switchable coordination of exocyclic amino group