feat(submap): display summary overlay for submaps links (MIN-197)
Added display of submaps links. From the backend we receive objects with the same coordinates and height for a specific submap link. E.g.
width: 30,
x1: 18412,
x2: 18492,
y1: 2100.5,
y2: 2000.5,
overlayId: 12,
height: 100,
We create a submap link rectangle with a black stroke from several smaller rectangles of different colors. We need to group elements with the same coordinates for a specific overlay id.
We calculate the height of single rectangle by dividing the common height by the number of elements with the same coordinates for specific overlayId.
If they have the same color, we must group them to avoid stroke for rectangles of the same color and create one object from them, but with a height equal to the number of connected elements.
I.e. we have a submap link height of 100 px. We have 5 objects with the same coordinates and including 2 objects with the same color. We will end up with 3 objects with a height of 20px
and one with a height of 40px
.
This is added in the tests, but I also covered it here.