code: function transform(animate) {
      var base = animate ? g.transition().duration(DURATION) : g;
      base.attr('transform', `translate(${panX}, ${panY}) scale(${scale})`);
    }
docs: Transform g to current panX, panY and scale.
  @param animate {Boolean} Animate the transformation in DURATION time.