Help with visualizing in the graph-notebook

I am trying to visualize a graph in the graph-notebook but no matter what I do I cannot get it to be correct. So I have a very simple graph that has like 6 vertices, connected with maybe 8 edges, and I want to just visualize that graph with the labels of the vertices and edges on the visualization and the properties available if you select the details. I have tried may variations of g.V().out().path / g.V().outE().inV().path() with elementMap() before path, using path().by(elementMap()), as well as trying from g.E() and other things. Nothing seems to work, randomly edges are missing labels, or an exta edge is added to each vertex that just goes to itself. Anyone know how to do this?
Solution:
Found this https://github.com/aws/graph-notebook/blob/c357870d2a5bce88c986fa114b613ec72ce065f7/src/graph_notebook/notebooks/02-Visualization/Grouping-and-Appearance-Customization-Gremlin.ipynb#L23 and ended up getting a solution with ``` %%gremlin -p v,oute,inv -l 30 g.V().outE().inV().path().by(elementMap())...
GitHub
graph-notebook/src/graph_notebook/notebooks/02-Visualization/Groupi...
Library extending Jupyter notebooks to integrate with Apache TinkerPop, openCypher, and RDF SPARQL. - aws/graph-notebook
Jump to solution
2 Replies
Solution
Lyndon
Lyndon10mo ago
Found this https://github.com/aws/graph-notebook/blob/c357870d2a5bce88c986fa114b613ec72ce065f7/src/graph_notebook/notebooks/02-Visualization/Grouping-and-Appearance-Customization-Gremlin.ipynb#L23 and ended up getting a solution with
%%gremlin -p v,oute,inv -l 30
g.V().outE().inV().path().by(elementMap())
%%gremlin -p v,oute,inv -l 30
g.V().outE().inV().path().by(elementMap())
GitHub
graph-notebook/src/graph_notebook/notebooks/02-Visualization/Groupi...
Library extending Jupyter notebooks to integrate with Apache TinkerPop, openCypher, and RDF SPARQL. - aws/graph-notebook
Lyndon
Lyndon9mo ago
By changing to
%%gremlin --edge-label-max-length 30 --label-max-length 30 -p v,oute,inv
g.V().emit(__.or(__.and(
__.out().count().is(P.eq(0)),
__.in().count().is(P.eq(0))),loops().is(P.eq(1)))).
repeat(outE().inV()).
path().by(elementMap())
%%gremlin --edge-label-max-length 30 --label-max-length 30 -p v,oute,inv
g.V().emit(__.or(__.and(
__.out().count().is(P.eq(0)),
__.in().count().is(P.eq(0))),loops().is(P.eq(1)))).
repeat(outE().inV()).
path().by(elementMap())
I was able to also visualize the non-connected vertices in the graph.