Search code examples
arangodbarangojs

Configuring label attributes in Graph Viewer


When creating graphs for viewing in the ArangoDB Web Interface, I am having some issues with labels for Vertices and Edges:

  1. I can only set Vertex/Edge attributes to simple keys. I cannot get deeper object references working.
    e.g. a vertex label attribute of name is valid, but info.firstName or info["firstName"] are not, even though the value is on the vertex. The graph displays ATTR NOT SET if I use object references

  2. When programmatically creating a Graph, I don't know how to set:

    1. Vertices labels
    2. Vertices Coloring attributes
    3. Edge Labels

When creating a graph with Node.js and the arangojs npm package, I use the graph.create command, for example:

  var graph = db.graph('myGraph');
  graph.create({
      edgeDefinitions: [
        {
          collection: 'myEdges',
          from: [
            'myNodes'
          ],
          to: [
            'myNodes'
          ]
        }
      ]
    })

Is there a way to fully configure the graph for proper formatting in the ArangoDB Web Interface? I can't seem to find any other function in the libraries that would let me do this.

I destroy and recreate graphs all the time and it would be great to fully create a configured graph, referencing objects within the vertex (and edges) for labels.

Thanks


Solution

  • Curerntly the settings of the graph viewer are only stored to the browsers local storage. Thus they're not persisted. Changing this is on the list of feature requests for the graph viewer overhaul.

    So at the time being the answer is: its not possible. I will add the deep object selection you mention to the feature list. Once its possible, I will edit this.