def get_viewbox(index, params):
    """Compute the SVG viewBox given the set of computed node positions"""
    positions_x, positions_y = list(), list()
    for node in index.values():
        positions_x.append(node.position.x)
        positions_y.append(node.position.y)
    min_x, max_x = min(positions_x), max(positions_x)
    min_y, max_y = min(positions_y), max(positions_y)
    return "%.2f %.2f %.2f %.2f" % (
        min_x - params["radius"] - params["hmargin"],
        min_y - params["radius"] - params["vmargin"],
        max_x - min_x + 2 * params["radius"] + 2 * params["hmargin"],
        max_y - min_y + 2 * params["radius"] + 2 * params["vmargin"]
    )