I am using ArangoDB community edition, I can query on a created graph in AQL
and get results in JSON which is graphically visualized on ArangoDB web interface tool.
AQL
Query
FOR v,e,p IN 1..3 OUTBOUND 'germanCity/Hamburg' GRAPH 'routeplanner'
OPTIONS{bfs :true}
RETURN p
JSON output
[
{
"edges": [
{
"_key": "6392826",
"_id": "germanHighway/6392826",
"_from": "germanCity/Hamburg",
"_to": "germanCity/Cologne",
"_rev": "_WmZ77pW--D",
"distance": 500
}
],
"vertices": [
{
"_key": "Hamburg",
"_id": "germanCity/Hamburg",
"_rev": "_WmZ77Z---_",
"population": 1000000,
"isCapital": false,
"loc": [
53.5653,
10.0014
]
},
{
"_key": "Cologne",
"_id": "germanCity/Cologne",
"_rev": "_WmZ77Y6--B",
"population": 1000000,
"isCapital": false,
"loc": [
50.9364,
6.9528
]
}
]
},
{
"edges": [
{
"_key": "6392840",
"_id": "internationalHighway/6392840",
"_from": "germanCity/Hamburg",
"_to": "frenchCity/Paris",
"_rev": "_WmZ77pa--_",
"distance": 900
}
],
"vertices": [
{
"_key": "Hamburg",
"_id": "germanCity/Hamburg",
"_rev": "_WmZ77Z---_",
"population": 1000000,
"isCapital": false,
"loc": [
53.5653,
10.0014
]
},
{
"_key": "Paris",
"_id": "frenchCity/Paris",
"_rev": "_WmZ77Z---D",
"population": 4000000,
"isCapital": true,
"loc": [
48.8567,
2.3508
]
}
]
},
{
"edges": [
{
"_key": "6392843",
"_id": "internationalHighway/6392843",
"_from": "germanCity/Hamburg",
"_to": "frenchCity/Lyon",
"_rev": "_WmZ77pa--B",
"distance": 1300
}
],
"vertices": [
{
"_key": "Hamburg",
"_id": "germanCity/Hamburg",
"_rev": "_WmZ77Z---_",
"population": 1000000,
"isCapital": false,
"loc": [
53.5653,
10.0014
]
},
{
"_key": "Lyon",
"_id": "frenchCity/Lyon",
"_rev": "_WmZ77Z---B",
"population": 80000,
"isCapital": false,
"loc": [
45.76,
4.84
]
}
]
}
]
Equivalent Graph
As we can get visualized graph output in web interface I would like to display the same in Language<->ArangoDB. Language here can be driver language supported : Python, Java , C# etc.
I am using pyArango
for interfacing with ArangoDB
I couldnt find an ArangoDB API for getting this graph visualization in JPG or matlibplot.
Is there any other way apart from using below two options?
- Use
networkx.draw(networkx.graph)
matplotlib.pyplot