title: Fit X-axis and scaleXY to keep canvas in center after zooming out
body: <p>I would like to use Konva js to accomplish tasks below:</p>
  <p>1- Loop data from db and then draw groups on canvas, group contains circle+text</p>
  <p>2- When shapes increase, zooming out to keeping them in the middle</p>
  <p>The challenge i encountered:</p>
  <ul>
  <li>When shapes exceeds layer width i start zooming out but i can't keeping them in the middle.</li>
  </ul>
  <p>How to calcul layer x-axis depend on shapes to keep canvas centred?</p>
  <p>How can i calculate the zoom to keep place just for a new shape and not zooming out too much?</p>
  <p>Thank you in advance</p>
  <p>Please find the: <a href="https://codesandbox.io/s/stackoverflow-d7ken" rel="nofollow noreferrer">codesandbox</a></p>