code: function () {
              var wrapper = this,
                translateX = wrapper.translateX || 0,
                translateY = wrapper.translateY || 0,
                scaleX = wrapper.scaleX,
                scaleY = wrapper.scaleY,
                inverted = wrapper.inverted,
                rotation = wrapper.rotation,
                element = wrapper.element,
                transform;
  
              // flipping affects translate as adjustment for flipping around the group's axis
              if (inverted) {
                  translateX += wrapper.attr('width');
                  translateY += wrapper.attr('height');
              }
  
              // Apply translate. Nearly all transformed elements have translation, so instead
              // of checking for translate = 0, do it always (#1767, #1846).
              transform = ['translate(' + translateX + ',' + translateY + ')'];
  
              // apply rotation
              if (inverted) {
                  transform.push('rotate(90) scale(-1,1)');
              } else if (rotation) { // text rotation
                  transform.push('rotate(' + rotation + ' ' + (element.getAttribute('x') || 0) + ' ' + (element.getAttribute('y') || 0) + ')');
              }
  
              // apply scale
              if (defined(scaleX) || defined(scaleY)) {
                  transform.push('scale(' + pick(scaleX, 1) + ' ' + pick(scaleY, 1) + ')');
              }
  
              if (transform.length) {
                  element.setAttribute('transform', transform.join(' '));
              }
          }
docs: Private method to update the transform attribute based on internal
  properties