Bubble Diagrams with Kangaroo

Hi All,
I’m trying to create a bubble diagram with Kangaroo and Grasshopper (new to both). Each polygon should represent a room and its area is a function of the polygon radius. Currently I have three problems.

A) How to make the line connecting the two rooms move as I grab and collide the polygons.

B) How to prevent the line from stretching beyond a certain limit. That means if the original length of that line is 4 I would want it to stay the same length as I move the polygons around. In further iterations I would assign different lengths to different connection lines according to the type of adjacency between the squares.

B) How to prevent the squares from rotating around the corner as I grab and move them in Rhino ? I’m trying to keep the square’s rotation to 0 relative to the global XY plane as shown in the picture.


Collide2D_Matrix.gh (24.8 KB)