Commit 76ee1598 authored by Yannick Chudy's avatar Yannick Chudy

limit 300 nodes when import viz

parent 43a1e8cd
...@@ -377,25 +377,26 @@ def botimport(repo, padurl, gid, content_type): ...@@ -377,25 +377,26 @@ def botimport(repo, padurl, gid, content_type):
if graph.vcount() > 300 : full = args.get("full" , "" ) == 1
if graph.vcount() > 300 and not full:
LENMIN = graph.vcount() / 100 - 5 LENMIN = graph.vcount() / 100 - 5
LENMIN = 10 LENMIN = 10
vfilter = lambda v : False vfilter = lambda v : False
subgraph = ProxSubgraph() | RemoveNotConnected() | GenericVertexFilter(vfilter) # | composable() subgraph = ProxSubgraph() | GenericVertexFilter(vfilter)
#for v in graph.vs : print vfilter(v)
length = int(args.get("length" , 3 ) ) length = int(args.get("length" , 3 ) )
cut = int(args.get("cut" , 50 ) ) cut = int(args.get("cut" , 50 ) )
mode = int(args.get("mode" , ALL )) mode = int(args.get("mode" , ALL ))
addloops = int(args.get("addloops" , 1 )) == 1 addloops = int(args.get("addloops" , 1 )) == 1
pzeros = args.get("pz" , "" ) pzeros = args.get("pz" , "" )
pzeros = [] if not len(pzeros) else [int(e) for e in pzeros.split(',')] pzeros = [] if not len(pzeros) else [int(e) for e in pzeros.split(',')]
print pzeros , graph.summary() print pzeros , graph.summary()
graph = subgraph(graph, length=length, cut=cut, pzeros=pzeros, add_loops=addloops, mode=mode) graph = subgraph(graph, length=length, cut=cut, pzeros=pzeros, add_loops=addloops, mode=mode)
print LENMIN , graph.summary() print LENMIN , graph.summary()
graph = prepare_graph(graph) graph = prepare_graph(graph)
data = export_graph(graph, id_attribute='uuid') data = export_graph(graph, id_attribute='uuid')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment