Scaled grid with attractor (subdivide?)

Hi everyone,
I am pretty new on GH and I need your advices.
I try to create parametric rectangles array on a 2d surface with a scale or attractor effect.
see enclosed. it is based on Stephen Few treemap.
Other things, how could I create a constant space between each rectangles.
Hope you can help

What you want to do is similar to this?

No attractor. (17.5 KB)

Alternate way of getting a gap between the rectangles:


P.S. The Offset method produces consistent spacing but the ‘gap’ slider does not!

Would be cool to go one step further and fit the entire grid “tight packed” in any given perimeter rectangle… Not that hard.

Fixed ‘gap’ slider in this version. (24.4 KB)

And as a holed surface - without 1/2 width gap on edges!: (29.7 KB)

THY Joseph. That is exactly what I am looking for .
This day is beginning with hope…