I'm dealing with this construction, available whenever you have two categories $\cal C,D$ and a profunctor $\varphi\colon {\cal C}\leadsto{\cal D}$ between them.
Define a category ${\cal C}\boxtimes_\varphi{\cal D}$ (the gluing of $\cal C,D$) having objects the triples $(C,D,\alpha)$, with $\alpha\in \varphi(C,D)$, and morphisms the triples $(u,v,\gamma)$ such that the square
is commutative, if we denote as a dotted arrow the "fake" (or "generalized") arrow $\alpha\in \varphi(C,D)$ and $\beta\in \varphi(C', D')$; profunctors carries a natural left-right action of hom-sets, so that "$\beta \cdot u$ and $v\cdot \alpha$ have meaning. The square above "commutes" if these two elements coincide in the same $\gamma\in \varphi(C, D')$.
Now, I have shown these interesting (albeit almost tautological) properties:
- ${\cal C}\boxtimes_\varphi{\cal D}$ is isomorphic to the category of elements of $\varphi$;
- There is an isomorphism $$ {\bf Cat}(\mathcal A, {\cal C}\boxtimes_\varphi{\cal D})\cong {\bf Cat}(\mathcal A, \mathcal C)\boxtimes_{\Phi}{\bf Cat}(\mathcal A, \mathcal D) $$ where $\Phi = {\bf Cat}(\mathcal A, \varphi)$ is the profunctor $(F, G)\mapsto \int_{A\in\cal A}\varphi(FA, GA)$, so that there is the suggestive formula $$\textstyle {\bf Cat}(\mathcal A, \text{Elts }\varphi)\cong \text{Elts }{\bf Cat}(\mathcal A, \varphi) $$
- If $\varphi$ is the identity profunctor $\hom\colon \mathcal C^\text{op}\times\mathcal C\to \bf Sets$, then $\text{Elts }\varphi$ is the arrow category ${\bf Cat}(\Delta[1], \mathcal C)$.
Have you ever seen this construction in other places, exhibiting any other interesting property? Does it have a special name? Any generalization to the enriched setting (where the category of elements may fail to exist, but there the bare definition can be verbatim given)?
I wonder if there a relation between the cograph of $\varphi$ and its category of elements? In some contexts it seems the answer is yes (more on this if necessary, but it's not my priority at the moment).