I'm guessing that the answer to this question is well-known, but I'm struggling to find anything to help me.

Let $X,Y$ be compact manifolds of dimension $n,m$ respectively. Let $f:X \to Y$ be a smooth map. Then one can consider the graph $\Delta_f$ of $f$ as a cycle in $X \times Y$.

Firstly what is "known" about $\Delta_f$ considered as a homology class? (I appreciate that this is a little vague). There might need to be some extra conditions placed of $f$, as clearly if for example $f$ maps everything to a point then there is nothing to be said.

Secondly (and related to the first question), suppose that $n=m$, and $f$ is an immersion. Then the self intersection $\Delta_f^2$of $\Delta_f$ with itself is well-defined. Is there a simple expression for this in terms of the basic properties of $f$?

Thanks!