Actually, your use of the word compress is not clear to me. I am trying to understand. I think you want to circles spread throughout the triangle but scaled to fit as they go toward the top, getting smaller as they go. Or do you simply want them to fit inside the triangle, the size they are currently? I think the former . . .
The only way to do this is through transformation and that will totally distort the circles. You could make separate layers of groups of circles and resize them, but the results would not likely be what you want. Photoshop does not have the brains nor algorithms to interpret this job. At least as far as I know. Someone will come along and correct that assumption if there is a way.
I think your best bet is to recreate them, groups of the same size more or less on separate layers. If you want the triangle to be blue, you make that on the bottom layer so you have both your reference shape and your desired color.
You can easily use the shape tool set to one of the different sizes and colors. The shape tool will make its own layer. Make each of the sizes you want first. For example, make 5 sizes placed about where you want them. Now name each of these, eg: large, med-large, medium, etc.
Now go to the large circle shape. Make a layer above it, keep it selected. Ctl/cmd click on the shape thumbnail, and fill it with the next color you want.
Next, make sure you have the move tool selected (shortcut key = V), and just move it where you want it. If you want a copy of that, keep the selection active, hold the alt/opt key and move the circle again; that will make a copy. Repeat for all your colors.
Then repeat for size and color. If you need to move any of the circles you have made on a layer, enclose it with a selection tool, such as the marquee or lasso, when you move it with the move tool, the marching ants will select it.
Here is a schematic. If this isn't what you want to do, I guess I need more detailed explanation . . .
