User 512 | 1/21/2015, 10:39:52 PM
I created a sub-graph using the largest connected component. The codes are below:
cc = gl.connectedcomponents.create(g) ccsize = cc['componentsize'] ccsize = ccsize.sort('Count', ascending=False) tgt = ccsize['componentid'] tgtnames = ccout[ccout['componentid'] == tgt]['__id'] subgraph = gl.SGraph() subgraph = subgraph.addedges(g.getedges(srcids=tgtnames), srcfield='srcid', dstfield='dst_id')
Then I would like to show this sub-graph on the Canvas. For each id, I have another field for its label, for example,
id id_label 1 Jack 2 Mike ...
Is there any easy way to attach the idlabel field to subgraph's vertices? Basically I want to use the label instead of id as the 'vlabel', that is, subgraph.show(vlabel='idlabel')