def _render()

in graspologic/layouts/__main__.py [0:0]


def _render(arguments: argparse.Namespace) -> None:
    positions = []
    node_colors = {}
    with open(arguments.location_file, "r") as location_io:
        next(location_io)
        for line in location_io:
            node_id, x, y, size, community, color = line.strip().split(",")
            positions.append(
                NodePosition(node_id, float(x), float(y), float(size), int(community))
            )
            node_colors[node_id] = color
    if arguments.edge_list is not None:
        graph = _graph_from_file(arguments.edge_list, arguments.skip_header)
    else:
        graph = nx.Graph()
        for position in positions:
            graph.add_node(position.node_id)

    render.save_graph(
        arguments.image_file,
        graph,
        positions,
        node_colors=node_colors,
        vertex_line_width=arguments.vertex_line_width,
        vertex_alpha=arguments.vertex_alpha,
        edge_line_width=arguments.edge_line_width,
        edge_alpha=arguments.edge_alpha,
        figure_height=arguments.figure_height,
        figure_width=arguments.figure_width,
        vertex_shape=arguments.vertex_shape,
        arrows=arguments.arrows,
        dpi=arguments.dpi,
        light_background=arguments.light_background,
    )