Graphics Reference
In-Depth Information
map. In the next step, the categories and parentage edges are added to the
new subgraph. Then, the Tufte categorizations are marked. In the last step,
a root node is added to parent the top-level categories before writing out the
graph.
gremlin> cg = new TinkerGraph()
gremlin> cmap=[:]
gremlin>
products._().out('categorization').sideEffect{nv=cmap.get(it);
cmap.put(it,nv==null?1:1+nv)}.count()
gremlin> cmap.each{k,v-> nv=cg.addVertex(k.id,
ElementHelper.
getProperties(k));
nv.setProperty('productcount',v)}
gremlin>
cmap.keySet()._().outE('parent').sideEffect{addLink(it,
cg)}
gremlin>
tufteBook.out('categorization').dedup().sideEffect{
cg.getVertex(it.id).setProperty('own',true)}
gremlin> root = cg.addVertex(0, [categoryname:'all',
productcount: 0])
gremlin> cg.V.filter{it.outE.count() == 0 && it !=
root}.sideEffect
{ cg.addEdge(null,it,root,'parent');
root.productcount+= it.
productcount}
gremlin> GraphMLWriter.outputGraph(sg, new
FileOutputStream
('topics.graphml'))
Import the topics graph into Gephi and size the nodes based on
productcount . Apply the OpenOrd layout to cluster, and then use
ForceAtlas2 with the option to prevent overlap to fine-tune. Use filtering to
Search WWH ::




Custom Search