title: How to place the rectangle in smartly
body: <p>I have an object like this which has SVG rectangles like below,</p>
  
  <pre><code> Rectangle-obj = [{ 'x' : 10, 'y' : 10, 'width' : 200, 'height' : 200}.......]
  </code></pre>
  
  <p>Those rectangles will append in a single main rectangle.. </p>
  
  <pre><code>(x:0, y: 0, width: 300, height: 300)
  </code></pre>
  
  <p>I need to check whether it has been colliding with another element, and if it collides, need to place that collided rectangle smartly.</p>
  
  <p>How to achieve this, is there any function available?</p>