def METHOD_NAME(network_dir):
    """Converts full GraphML file to JSON subgraph"""
    labels = []
    nodes_list = []
    edges_list = []
    full_graph = gt.load_graph(os.path.join(network_dir, os.path.basename(network_dir) + "_cytoscape.graphml"))
    components = gt.label_components(full_graph)[0].a
    subgraph = gt.GraphView(full_graph, vfilt=(components == components[-1]))
    subgraph = gt.Graph(subgraph, prune=True)
    subgraph.save(os.path.join(network_dir,"subgraph.graphml"))
    G = nx.read_graphml(os.path.join(network_dir,"subgraph.graphml"))
    for value in G.nodes.values():
        labels.append(value['id'])
    data = json_graph.node_link_data(G)
    for k,v in data.items():
        if k == "nodes":
            for node in range(len(v)):
                node_attr = v[node]
                node_attr['label'] = labels[node]
                nodes_list.append({'data':node_attr})
        elif k == "links":
             for edge in range(len(v)):
                edge_attr = v[edge]
                edges_list.append({'data':edge_attr})
    network_dict = {'elements':{'nodes':nodes_list, 'edges':edges_list}}
    return network_dict