def load_slashdot(request): with open('slashsave') as slash_save: slashdot_graph = Graph('slashdot') slashdot_graph.load_save(slash_save.read()) global current current = slashdot_graph dump = slashdot_graph.dump_graph(degree_threshold=250) with open('dump', 'w+') as dumpfile: dumpfile.write(json.dumps(dump)) return render(request, "graph_sna/index.html", context={})
def load_enron(request): with open('enronsave') as enron_save: enron_graph = Graph('enron') enron_graph.load_save(enron_save.read()) global current current = enron_graph dump = enron_graph.dump_graph(weight_threshold=0, degree_threshold=0) with open('dump', 'w+') as dumpfile: dumpfile.write(json.dumps(dump)) return render(request, "graph_sna/index.html", context={})
def load_reddit(request): global current with open('redditsave') as reddit_save: reddit_graph = Graph('reddit') reddit_graph.load_save(reddit_save.read(),weight_threshold=2,degree_threshold=3) global current current = reddit_graph print(reddit_graph.get_threshold(10)) dump = reddit_graph.dump_graph(weight_threshold=2, degree_threshold=15) with open('dump', 'w+') as dumpfile: dumpfile.write(json.dumps(dump)) return render(request, "graph_sna/index.html", context={})