function getPathYFromX(x, path, name, error) {
            const key = `${name}-${x}`;

            if (key in pathYCache) {
                return pathYCache[key];
            }

            error = error || 0.01;

            const maxIterations = 100;

            let lengthStart = 0;
            let lengthEnd = path.getTotalLength();
            let point;
            try {
                point = path.getPointAtLength((lengthEnd + lengthStart) / 2);
            } catch (e) {
                point = {x: 0, y: 0}
            }
            let iterations = 0;

            while (x < point.x - error || x > point.x + error) {
                const midpoint = (lengthStart + lengthEnd) / 2;

                try {
                    point = path.getPointAtLength(midpoint);
                } catch (e) {
                    point = {x: 0, y: 0}
                }

                if (x < point.x) {
                    lengthEnd = midpoint;
                } else {
                    lengthStart = midpoint;
                }

                iterations += 1;
                if (maxIterations < iterations) {
                    break;
                }
            }

            pathYCache[key] = point.y

            return pathYCache[key]
        }
Finds the y coordinate of a path given an x coordinate and the line's path node.
@param  {number} x The x coordinate
@param  {node} path The path node element
@param {*} name - The name identifier of the topic
@param  {number} error The margin of error from the actual x coordinate. Default 0.01
@private