Mapping dynamical systems onto complex networks