Let's design a digit mosaic Challenge

Given a positive integer \$N\$, repeat each of its digits \$d_1, d_2, d_3, \cdots, d_n\$ a number of times corresponding to its position in \$N\$. In other words, each digit \$d_k\$ should be repeated \$k\$ times (for each \$1\le k\le n\$, 1-indexed), thus creating the new number:

$$\overline{d_1d_2d_2d_3d_3d_3\cdots\underbrace{d_nd_nd_n\cdots d_n}_{n\text { times}}}$$

Then, write it down both horizontally and vertically and fill in the blanks with copies of the digit that corresponds to the greater index between the column index and the row index of the blank space. The final output should look like this:

$$\begin{bmatrix}
 \color{red}{d_1}  \color{green}{d_2  d_2}  \color{blue}{d_3  d_3  d_3} \cdots \\ 
 \color{green}{d_2  d_2  d_2}  \color{blue}{d_3  d_3  d_3} \cdots \\ 
 \color{green}{d_2  d_2  d_2}  \color{blue}{d_3  d_3  d_3} \cdots \\ 
 \color{blue}{d_3  d_3  d_3  d_3  d_3  d_3} \cdots \\ 
 \color{blue}{d_3  d_3  d_3  d_3  d_3  d_3} \cdots \\ 
 \color{blue}{d_3  d_3  d_3  d_3  d_3  d_3} \cdots \\ 
 \vdots 
\end{bmatrix}$$



Specs

You may take  \$N\$ as an integer, a string, a list of digits or a list of characters representing the digits. The output can be a newline-separated string, a list of strings / integers or a list of lists of characters / digits, but please include a pretty-print version too, if possible. If the output is a newline-separated string, it is also acceptable to:


have leading / trailing whitespace, as long as the visual appearance of the output doesn't change
separate the columns using a consistent amount spaces or the rows with a consistent (non-zero) amount of newlines


You can take input and provide output through any standard method, while taking note that these loopholes are forbidden by default. This is code-golf, so try  to complete the task in the least bytes you can manage in your language of choice.

Test cases

65:

655
555
555

---------------

203:

200333
000333
000333
333333
333333
333333

--------------

233:

233333
333333
333333
333333
333333
333333

---------------

5202:

5220002222
2220002222
2220002222
0000002222
0000002222
0000002222
2222222222
2222222222
2222222222
2222222222

---------------

12345:

122333444455555
222333444455555
222333444455555
333333444455555
333333444455555
333333444455555
444444444455555
444444444455555
444444444455555
444444444455555
555555555555555
555555555555555
555555555555555
555555555555555
555555555555555
JavaScript (ES7), 70 bytes

Takes input as a string. Returns a string with a trailing linefeed.

s=&gt;(g=x=&gt;(c=s[(x&gt;y?x:y)**.5-1&gt;&gt;1])?c+g(x+8):x&gt;y?`
`+g(1,y+=8):'')(y=1)


Try it online!

How?

Method

We build the output character by character by walking through a square matrix and converting each cell into an index \$i_{x,y}\$ into the input string.

Coordinates to string index

The upper bound \$u_{n}\$ of the \$n^{th}\$ digit area (0-indexed) along each axis is given by A000096:

$$u_{n} = \frac{n(n+3)}{2}$$
$$u_{0}=0,u_{1}=2,u_{2}=5,u_{3}=9,u_{4}=14,u_{5}=20,\dots$$

Given an integer \$k\$, we can find out in which area \$n=\lfloor{x}\rfloor+1\$ it is located by solving:

$$x²+3x-2k=0$$

Leading to:

$$x = \frac{\sqrt{1+8k}-3}{2}$$
$$n = \left\lfloor\frac{\sqrt{1+8k}-3}{2}\right\rfloor+1=\left\lfloor\frac{\sqrt{1+8k}-1}{2}\right\rfloor$$

For each cell \$(x, y)\$, we define:

$$v_{x,y} = \max(1+8x,1+8y)$$

These values \$v_{x,y}\$ are converted into indices \$i_{x,y}\$ into the input string by doing:

$$i_{x,y} = \left\lfloor\frac{\sqrt{v_{x,y}}-1}{2}\right\rfloor$$

 v(x,y) |  0  1  2  3  4  5  6  7  8  9        i(x,y) |  0  1  2  3  4  5  6  7  8  9
--------+-------------------------------      --------+-------------------------------
    0   |  1  9 17 25 33 41 49 57 65 73           0   |  0  1  1  2  2  2  3  3  3  3
    1   |  9  9 17 25 33 41 49 57 65 73           1   |  1  1  1  2  2  2  3  3  3  3
    2   | 17 17 17 25 33 41 49 57 65 73           2   |  1  1  1  2  2  2  3  3  3  3
    3   | 25 25 25 25 33 41 49 57 65 73           3   |  2  2  2  2  2  2  3  3  3  3
    4   | 33 33 33 33 33 41 49 57 65 73   --&gt;     4   |  2  2  2  2  2  2  3  3  3  3
    5   | 41 41 41 41 41 41 49 57 65 73           5   |  2  2  2  2  2  2  3  3  3  3
    6   | 49 49 49 49 49 49 49 57 65 73           6   |  3  3  3  3  3  3  3  3  3  3
    7   | 57 57 57 57 57 57 57 57 65 73           7   |  3  3  3  3  3  3  3  3  3  3
    8   | 65 65 65 65 65 65 65 65 65 73           8   |  3  3  3  3  3  3  3  3  3  3
    9   | 73 73 73 73 73 73 73 73 73 73           9   |  3  3  3  3  3  3  3  3  3  3


Halting conditions

We know that we've reached:


the right boundary of the matrix when the character at \$i_{x,y}\$ does not exist and we have \$x &gt; y\$
the bottom boundary of the matrix when the character does not exist and we have \$x \le y\$