With $M$, $\textbf{r}$, $\textbf{v}$, you can calculate the specific energy, $\mathcal{E}$ and specific angular momentum of the object, $\mathcal{M}$, which are constants of the orbital motion. From those you can get the semi-major axis, $a$, and the eccentricity, $e$. That is all you need in two dimensions.
That won't get you a closed form solution for $d(t)$. What you can get are parametric solutions in the form $t(\tau)$, $r(\tau)$, and $\phi(\tau)$ (or $x(\tau)$ and $y(\tau)$), which can be used for making plots. $\tau$ is the eccentric anomaly, which for an elliptical orbit is the angle of the position from the center of the ellipse (not the focus of the ellipse, where the planet is). When you run $\tau$ from $0$ to $2\pi$, you get a complete orbit. The equations are (where $r$ is the magnitude of $\textbf{r}$ (what you're calling "$d$"), and $\mu$ is $GM$:
$r(\tau)=a\left(1-e\cos{\tau}\right)$
$\phi(\tau)=\tan^{-1}\left(\cos{\tau}-e,\sqrt{1-e^2}\sin{\tau}\right)$
$t(\tau)=\sqrt{a^3\over\mu}\left(\tau-e \sin{\tau}\right)$
The argument order for the two-parameter inverse tangent above is $\tan^{-1}\left(x,y\right)$. Many programming languages have an atan2(y,x)
function with the arguments in the other order, so be careful lest you cause havoc in the heavens.
You will need to solve for $\tau_0$, e.g. using $r(\tau_0)=r_0$ to know where your starting point is in the orbit, if that matters for your plot. You may also want to add an offset to $\phi$ to get the orbit rotated to some specific starting location, again if that matters to you.
By the way, it is common to use $\mu$ instead of $M$ because we can usually measure $\mu$ to much higher accuracy than we currently know the fundamental physical constant $G$. So how well we know $M$ for a body is usually limited by how well we know $G$.