function getCoordinates(svg) {
  // getting viewBox values array
  var viewBoxAttr = svg.getAttribute('viewBox');
  var viewBox = _.map(
    (viewBoxAttr || '').split(/(?: *, *| +)/g),
    function (val) {
      return parseFloat(val);
    }
  );

  // If viewBox attr has less than 4 digits it's incorrect
  if (viewBoxAttr && viewBox.length < 4) {
    return {
      error : new Error('Svg viewbox attr has less than 4 params')
    };
  }

  // getting base parameters
  var attr = {};
  _.forEach([ 'x', 'y', 'width', 'height' ], function (key) {
    var val = svg.getAttribute(key);

    // TODO: remove and do properly
    // Quick hack - ignore values in %. There can be strange cases like
    // `width="100%" height="100%" viewbox="0 0 1000 1000"`
    if (val.length && val[val.length - 1] !== '%') {
      attr[key] = parseFloat(svg.getAttribute(key));
    }
  });

  if (viewBox[2] < 0 || viewBox[3] < 0 || attr.width < 0 || attr.height < 0) {
    return {
      error : new Error('Svg sizes can`t be negative')
    };
  }

  var result = {
    x: attr.x || 0,
    y: attr.y || 0,
    width: attr.width,
    height: attr.height,
    error: null
  };

  if (!viewBoxAttr) {
    // Only svg width & height attrs are set
    if (result.width && result.height) {
      return result;
    }

    // viewBox not set and attrs not set
    result.error = new Error('Not implemented yet. There is no width or height');
    // TODO: Need calculate BBox
    return result;
  }

  /*if ( (result.x !== 0 && viewBox[0] !== 0 && result.x !== viewBox[0]) ) {
    result.error = new Error('Not implemented yet. Svg attr x not equals viewbox x');
    // TODO: Need transform
    return result;
  }
  if ( (result.y !== 0 && viewBox[1] !== 0 && result.y !== viewBox[1]) ) {
    result.error = new Error('Not implemented yet. Svg attr y not equals viewbox y');
    // TODO: Need transform
    return result;
  }*/

  /*if (viewBox[0]) { result.x = viewBox[0]; }
  if (viewBox[1]) { result.y = viewBox[1]; }*/

  // viewBox is set and attrs not set
  if (!result.width && !result.height) {
    result.width = viewBox[2];
    result.height = viewBox[3];
    return result;
  }

  return result;

  /*// viewBox and attrs are set and values on width and height are equals
  if (viewBox[2] === result.width && viewBox[3] === result.height) {
    return result;
  }

  // viewBox is set and one attr not set
  if (!result.width || !result.height) {
    result.error = new Error('Not implemented yet. Width and height must be set');
    // TODO: Implement BBox. If width or height is setthan implement transform
    return result;
  }

  // viewBox and attrs are set, but have different sizes. Need to transform image
  result.error = new Error('Not implemented yet. Svg viewbox sizes are different with svg sizes');
  // TODO: Implement transform
  return result;*/
}
Returns coordinates for svg

@param svg
@returns {{x: (string|number),
             y: (string|number),
             width: (string),
             height: (string)}}