我正在使用 ArangoDB 社区版,我可以查询创建的图形AQL
并以 JSON 格式获取结果,该结果在 ArangoDB Web 界面工具上以图形方式可视化。
AQL
询问
FOR v,e,p IN 1..3 OUTBOUND 'germanCity/Hamburg' GRAPH 'routeplanner'
OPTIONS{bfs :true}
RETURN p
JSON 输出
[
{
"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
]
}
]
}
]
等效图
因为我们可以在 Web 界面中获得可视化的图形输出,所以我想在 Language<->ArangoDB 中显示相同的输出。这里的语言可以是支持的驱动语言:Python、Java、C#等。
我pyArango
用于与 ArangoDB 交互
我找不到用于在 JPG 或 matlibplot 中获取此图形可视化的 ArangoDB API。
除了使用以下两个选项之外,还有其他方法吗?
- 采用
networkx.draw(networkx.graph)
matplotlib.pyplot