Translate the path so that it automatically fits into the plot area box
@param {Object} path
175685
function (path) {
			
			var series = this,
				even = false, // while loop reads from the end
				xAxis = series.xAxis,
				yAxis = series.yAxis,
				i;
				
			// Preserve the original
			path = [].concat(path);
				
			// Do the translation
			i = path.length;
			while (i--) {
				if (typeof path[i] === 'number') {
					if (even) { // even = x
						path[i] = Math.round(xAxis.translate(path[i]));
					} else { // odd = Y
						path[i] = Math.round(yAxis.len - yAxis.translate(path[i]));
					}
					even = !even;
				}
			}
			return path;
		}
993943
function parsePath(path) {
    if (!path) return
    if (path.indexOf(',') == -1) {
        return {
            path : path.replace(/\s/g, '')
        }
    } else {
        let segments = path.split(","),
            vars = segments.slice(1)
        return {
            path: segments[0].replace(/\s/g, ''),
            vars: vars.map(o=>o.replace(/\s/g, ''))
        }
    }
}
557796
function computePathBox(path) {
            var points = [];
            if (arguments.length === 1) {
                points = path;
            }
            else {
                for (var i = 0, l = arguments.length; i < l; i++) {
                    Array.prototype.splice.apply(points, [points.length, 0].concat(arguments[i]));
                }
            }
            return computeBoundingBox(points);
        }
1226873
function _expandNestedPaths(paths) {
  var expandedPaths = [];

  _pathsArray(paths).forEach(function (p) {
    if (p.indexOf('.') !== -1) {
      var pathsWithRoots = p.split('.').map(function (value, index, array) {
        return array.slice(0, index + 1).join('.');
      });

      expandedPaths = expandedPaths.concat(pathsWithRoots);
    } else {
      expandedPaths.push(p);
    }
  });

  return expandedPaths;
}
1067193
function (path) {
      var paths = this._paths;
      paths[path] = (paths[path] || 0) + 1;

      var key = firstKey(path);
      var tail = path.slice(key.length + 1);

      this.chain(key, tail);
    }
892421
function objPath(obj, path) {
  if (!path) {
    return obj;
  }
  path = path.split('.');
  let i = 0;
  while (obj && i < path.length) {
    obj = obj[path[i++]];
  }
  return obj;
}
869185
function normalizePath(path)
{
    if (path.indexOf("..") === -1 && path.indexOf('.') === -1)
        return path;

    var normalizedSegments = [];
    var segments = path.split("/");
    for (var i = 0; i < segments.length; i++) {
        var segment = segments[i];
        if (segment === ".")
            continue;
        else if (segment === "..")
            normalizedSegments.pop();
        else if (segment)
            normalizedSegments.push(segment);
    }
    var normalizedPath = normalizedSegments.join("/");
    if (normalizedPath[normalizedPath.length - 1] === "/")
        return normalizedPath;
    if (path[0] === "/" && normalizedPath)
        normalizedPath = "/" + normalizedPath;
    if ((path[path.length - 1] === "/") || (segments[segments.length - 1] === ".") || (segments[segments.length - 1] === ".."))
        normalizedPath = normalizedPath + "/";

    return normalizedPath;
}
622062
function setPath(obj, path, value) {
	var cur = obj;
	var parts = path.split('.');
	var i;
	for (i = 0; i < parts.length; i++) {
		if (i === parts.length - 1) {
			cur[parts[i]] = value;
		} else {
			if (isScalar(cur[parts[i]])) cur[parts[i]] = {};
			cur = cur[parts[i]];
		}
	}
	return obj;
}
18423
function scale(path, ratio) {
            for (var i = 0, l = path.length; i < l; i++) {
                var cur = path[i];
                cur.x *= ratio;
                cur.y *= ratio;
            }

            return path;
        }
1116419
function formatAsElegantPath(path, sep) {
    const packages = path.split(sep);

    // prettier-ignore
    const result = packages.map(item => item.trim()).join(' -> ');
    return result;
}
1263350
function splitPath(path) {
  const delim = /[./]/;
  const result = R.pipe(
    R.split(delim),
    R.without('')
  )(path);
  return result;
}
158983
void movePath(int geom, int before_path, int path_to_move) {
		if (path_to_move == -1)
			throw new IllegalArgumentException();

		if (before_path == path_to_move)
			return;

		int next = getNextPath(path_to_move);
		int prev = getPrevPath(path_to_move);
		int geom_src = getGeometryFromPath(path_to_move);
		if (prev == -1) {
			setFirstPath_(geom_src, next);
		} else {
			setNextPath_(prev, next);
		}

		if (next == -1) {
			setLastPath_(geom_src, prev);
		} else {
			setPrevPath_(next, prev);
		}

		setGeometryVertexCount_(geom_src, getPointCount(geom_src)
				- getPathSize(path_to_move));
		setGeometryPathCount_(geom_src, getPathCount(geom_src) - 1);

		if (before_path == -1)
			prev = getLastPath(geom);
		else
			prev = getPrevPath(before_path);

		setPrevPath_(path_to_move, prev);
		setNextPath_(path_to_move, before_path);
		if (before_path == -1)
			setLastPath_(geom, path_to_move);
		else
			setPrevPath_(before_path, path_to_move);
		if (prev == -1)
			setFirstPath_(geom, path_to_move);
		else
			setNextPath_(prev, path_to_move);
		setGeometryVertexCount_(geom, getPointCount(geom)
				+ getPathSize(path_to_move));
		setGeometryPathCount_(geom, getPathCount(geom) + 1);
		setPathGeometry_(path_to_move, geom);
	}
715563
function pathToLines(path) {
    var lines = [];
    var curr = null;

    path.forEach(function(cmd) {
        if(cmd[0] == PATH_COMMAND.MOVE) {
            curr = cmd[1];
        }
        if(cmd[0] == PATH_COMMAND.LINE) {
            var pt = cmd[1];
            lines.push(new Line(curr, pt));
            curr = pt;
        }
        if(cmd[0] == PATH_COMMAND.QUADRATIC_CURVE) {
            var pts = [curr, cmd[1], cmd[2]];
            for(var t=0; t<1; t+=0.1) {
                var pt = calcQuadraticAtT(pts,t);
                lines.push(new Line(curr, pt));
                curr = pt;
            }
        }
        if(cmd[0] === PATH_COMMAND.BEZIER_CURVE) {
            var pts = [curr, cmd[1], cmd[2], cmd[3]];
            bezierToLines(pts,10).forEach(pt => {
                lines.push(new Line(curr,pt))
                curr = pt
            })
        }
    });
    return lines;
}
188233
function normalizePath(path) {
    // Separate the path into parts (delimited by slashes)
    let parts = [""];
    for (let char of path) {
        if (char === "/" || char === "\\") {
            if (parts[parts.length - 1].length) {
                parts.push("");
            }
        }
        else {
            parts[parts.length - 1] += char;
        }
    }
    // Special case for when the entire path was "."
    if (parts.length === 1 && parts[0] === ".") {
        return ".";
    }
    // Resolve "." and ".."
    let i = 0;
    while (i < parts.length) {
        if (parts[i] === ".") {
            parts.splice(i, 1);
        }
        else if (i > 0 && parts[i] === "..") {
            parts.splice(i - 1, 2);
            i--;
        }
        else {
            i++;
        }
    }
    // Build the resulting path
    let result = "";
    for (let part of parts) {
        if (part && part.length) {
            if (result.length) {
                result += "/";
            }
            result += part;
        }
    }
    // Retain a slash at the beginning of the string
    if (path[0] === "/" || path[0] === "\\") {
        result = "/" + result;
    }
    // All done!
    return result;
}
21213
function(path) {
            const { node } = path;

            if (
              !path.parentPath.parentPath.isFunction() ||
              path.getSibling(path.key + 1).node
            ) {
              return;
            }

            if (!node.argument) {
              path.remove();
              return;
            }

            if (t.isUnaryExpression(node.argument, { operator: "void" })) {
              path.replaceWith(node.argument.argument);
            }
          }
709319
function relative(path){
  var startX = 0
  var startY = 0
  var x = 0
  var y = 0

  return path.map(function(seg){
    seg = seg.slice()
    var type = seg[0]
    var command = type.toLowerCase()

    // is absolute
    if (type != command) {
      seg[0] = command
      switch (type) {
        case 'A':
          seg[6] -= x
          seg[7] -= y
          break
        case 'V':
          seg[1] -= y
          break
        case 'H':
          seg[1] -= x
          break
        default:
          for (var i = 1; i < seg.length;) {
            seg[i++] -= x
            seg[i++] -= y
          }
      }
    }

    // update cursor state
    switch (command) {
      case 'z':
        x = startX
        y = startY
        break
      case 'h':
        x += seg[1]
        break
      case 'v':
        y += seg[1]
        break
      case 'm':
        x += seg[1]
        y += seg[2]
        startX += seg[1]
        startY += seg[2]
        break
      default:
        x += seg[seg.length - 2]
        y += seg[seg.length - 1]
    }

    return seg
  })
}
1085813
function handlePathSlashes (path) {
                var cutIndex = 0;
                for (var i = 0; i < path.length - 1; i++) {
                    if (path[i] === DIR_SEPARATOR && path[i + 1] === DIR_SEPARATOR) {
                        cutIndex = i + 1;
                    } else break;
                }

                return path.substr(cutIndex);
            }