function makePath(pathData, opts, rect, layout) {
  var path = createFromString(pathData, opts);

  if (rect) {
    if (layout === 'center') {
      rect = centerGraphic(rect, path.getBoundingRect());
    }

    resizePath(path, rect);
  }

  return path;
}
Create a path element from path data string
@param pathData
@param opts
@param rect
@param layout 'center' or 'cover' default to be cover