code: function(config) {
              config = config || {};
  
              var mimeType = config.mimeType || null,
                  quality = config.quality || null,
                  stage = this.getStage(),
                  x = config.x || 0,
                  y = config.y || 0,
                  canvas = new Kinetic.SceneCanvas({
                      width: config.width || this.getWidth() || (stage ? stage.getWidth() : 0),
                      height: config.height || this.getHeight() || (stage ? stage.getHeight() : 0),
                      pixelRatio: 1
                  }),
                  context = canvas.getContext();
  
              context.save();
  
              if(x || y) {
                  context.translate(-1 * x, -1 * y);
              }
  
              this.drawScene(canvas);
              context.restore();
  
              return canvas.toDataURL(mimeType, quality);
          }
docs: Creates a composite data URL. If MIME type is not
  specified, then "image/png" will result. For "image/jpeg", specify a quality
  level as quality (range 0.0 - 1.0)
  @method
  @memberof Kinetic.Node.prototype
  @param {Object} config
  @param {String} [config.mimeType] can be "image/png" or "image/jpeg".
  "image/png" is the default
  @param {Number} [config.x] x position of canvas section
  @param {Number} [config.y] y position of canvas section
  @param {Number} [config.width] width of canvas section
  @param {Number} [config.height] height of canvas section
  @param {Number} [config.quality] jpeg quality.  If using an "image/jpeg" mimeType,
  you can specify the quality from 0 to 1, where 0 is very poor quality and 1
  is very high quality
  @returns {String}