  Persistence diagrams are objects that play a central role in topological data
analysis. In the present article, we investigate the local and global geometric
properties of spaces of persistence diagrams. In order to do this, we construct
a family of functors $\mathcal{D}_p$, $1\leq p \leq\infty$, that assign, to
each metric pair $(X,A)$, a pointed metric space $\mathcal{D}_p(X,A)$.
Moreover, we show that $\mathcal{D}_{\infty}$ is sequentially continuous with
respect to the Gromov--Hausdorff convergence of metric pairs, and we prove that
$\mathcal{D}_p$ preserves several useful metric properties, such as
completeness and separability, for $p \in [1,\infty)$, and geodesicity and
non-negative curvature in the sense of Alexandrov, for $p=2$. We also show that
the Fr\'echet mean set of a Borel probability measure on $\mathcal{D}_p(X,A)$,
$1\leq p \leq\infty$, with finite second moment and compact support is
non-empty. As an application of our geometric framework, we prove that the
space of Euclidean persistence diagrams,
$\mathcal{D}_2(\mathbb{R}^{2n},\Delta_n)$, has infinite covering, Hausdorff,
and asymptotic dimensions.
