def METHOD_NAME(
    graph: ig.Graph,
    component_layout: str = "fr_size_aware",
    arrange_boxes: Literal["size", "rpack", "squarify"] = "squarify",
    pad_x: float = 1.0,
    pad_y: float = 1.0,
    layout_kwargs: Optional[dict] = None,
) -> np.ndarray:
    """
    Compute a graph layout by layouting all connected components individually.
    Adapted from https://stackoverflow.com/questions/53120739/lots-of-edges-on-a-graph-plot-in-python
    Parameters
    ----------
    graph
        The igraph object to plot.
        Requires the vertex attribute "size", corresponding to the node size.
    component_layout
        Layout function used to layout individual components.
        Can be anything that can be passed to `igraph.Graph.layout` or
        `fr_size_aware` for a modified Fruchterman-Rheingold layouting
        algorithm that respects node sizes. See
        :func:`scirpy.util.graph.layout_fr_size_aware` for more details.
    arrange_boxes
        How to arrange the individual components. Can be "size"
        to arange them by the component size, or "rpack" to pack them as densly
        as possible, or "squarify" to arrange them using a treemap algorithm.
    pad_x
        Padding between subgraphs in the x dimension.
    pad_y
        Padding between subgraphs in the y dimension.
    layout_kwargs
        Additional arguments passed to the layouting algorithm used for each component.
    Returns
    -------
    pos
        n_nodes x dim array containing the layout coordinates
    """
    if layout_kwargs is None:
        layout_kwargs = {}
    # assign the original vertex id, it will otherwise get lost by decomposition
    for i, v in enumerate(graph.vs):
        v["id"] = i
    components = np.array(graph.decompose(mode="weak"))
    try:
        component_sizes = np.array([sum(component.vs["size"]) for component in components])
    except KeyError:
        component_sizes = np.array([len(component.vs) for component in components])
    order = np.argsort(component_sizes)
    components = components[order]
    component_sizes = component_sizes[order]
    vertex_ids = [v["id"] for comp in components for v in comp.vs]
    vertex_sorter = np.argsort(vertex_ids)
    bbox_fun = {"rpack": _bbox_rpack, "size": _bbox_sorted, "squarify": _bbox_squarify}[arrange_boxes]
    bboxes = bbox_fun(component_sizes, pad_x, pad_y)
    component_layouts = [
        _layout_component(component, bbox, component_layout, layout_kwargs)
        for component, bbox in zip(components, bboxes)
    ]
    # get vertexes back into their original order
    coords = np.vstack(component_layouts)[vertex_sorter, :]
    return coords