2
votes

I have a collection 'presidents':

{"_key": "1", "name": "George Washington"},
{"_key": "2","name": "John Adams"},
{"_key": "3", "name": "Thomas Jefferson"},
{"_key": "4", "name": "James Madison"}

and an edge collection 'presidents_relations':

{"_from": "presidents/1", "_to": "presidents/4", "linkType": "likes"},
{"_from": "presidents/3", "_to": "presidents/1", "linkType": "likes"},
{"_from": "presidents/2", "_to": "presidents/4", "linkType": "hates"},
{"_from": "presidents/1", "_to": "presidents/2", "linkType": "likes"},
{"_from": "presidents/1", "_to": "presidents/3", "linkType": "hates"}

If I import these into the Graph Viewer, I get this result: Graph without labels

This is not very informative. What I would like instead is something like this: Graph with labels

Is there a way to do this in the Graph Viewer? Preferably with an AQL command?

1

1 Answers

2
votes

You can achieve this by using the graph viewer:

1.) Create a graph

Edge definition "presidents_relations" and from & to collections as "presidents"

enter image description here

2.) Modify display settings

Open the graph display settings menu (top-right menu icon) and set the node label to "name" and the edge label to "linkType". Apply those settings by pressing the "Save" button.

enter image description here

AQL only solution is currently not possible but may be included in the future.