This paper considers minimum-dimensional representations of graphs in pseudo-Euclidean spaces, where adjacency and non-adjacency relations are reflected in fixed scalar square values. A representation of a simple graph (V, E) is a mapping \(\varphi \) from the vertices to the pseudo-Euclidean space \(\mathbb {R}^{p,q}\) such that \( ||\varphi (u)-\varphi (v)||={\left\{ \begin{array}{ll} a \text { if }(u,v) \in E, \\ b \text { if }(u,v) \not \in E\text { and }u\ne v,\\ 0 \text { if }u=v\\ \end{array}\right. } \) for some \(a,b \in \mathbb {R}\) , where \(||\varvec{x}||=\langle \langle \varvec{x},\varvec{x} \rangle \rangle = \sum _{i=1}^p x_i^2- \sum _{j=1}^q x_{p+j}^2 \) is the scalar square of \(\varvec{x}\) in \(\mathbb {R}^{p,q}\) . For a finite set X in \(\mathbb {R}^{p,q}\) , we define \( A(X)=\{||\varvec{x}- \varvec{y} || :\, \varvec{x},\varvec{y} \in X, \varvec{x} \ne \varvec{y}\}. \) A finite set X in \(\mathbb {R}^{p,q}\) is called an s-indefinite-distance set if \(|A(X)|=s\) holds. An s-indefinite-distance set in \(\mathbb {R}^{p,0}=\mathbb {R}^p\) is called an s-distance set. Graphs obtained from Seidel switching of a Johnson graph sometimes admit Euclidean or pseudo-Euclidean representations in low dimensions relative to the number of vertices. For instance, Lisoněk [8] obtained a largest 2-distance set in \(\mathbb {R}^8\) and largest spherical 2-indefinite-distance sets in \(\mathbb {R}^{p,1}\) for each \(p\ge 10\) from the switching classes of Johnson graphs. In the present paper, we consider graphs in the switching classes of Johnson and Hamming graphs of diameter 2 and classify those that admit representations in \(\mathbb {R}^{p,q}\) with the smallest possible dimensionality \(p+q\) among all graphs in the same class. The method not only recovers known results, such as the largest 2-(indefinite)-distance sets constructed by Lisoněk, but also provides a unified framework for determining the minimum dimension of representations for entire switching classes of strongly regular graphs.