def func(): print(request.method) if request.method == 'GET': return render_template('indexD3.html') else: query = json.loads(request.data) G = mod.parse(query) # newG = nx.convert_node_labels_to_integers(G,label_attribute='label') temp = nx.node_link_data(G) print("hiy") pprint(json.dumps(temp)) return json.dumps(temp)
import json import networkx as nx import matplotlib.pyplot as plt import mod with open("query1.json") as f: query = json.load(f) G = mod.parse(query) nx.draw(G, with_labels=True) plt.show() x = nx.node_link_data(G) print(x) print('done')
def test1(): mod.parse("hjhwr") assert_true(True)
def test2(): mod.parse("hjhwr")