mirror of
https://github.com/Findus23/RPGnotes.git
synced 2024-09-19 15:43:45 +02:00
link graph
This commit is contained in:
parent
3eeaf581f9
commit
19aa3e0722
2 changed files with 9 additions and 1 deletions
|
@ -26,7 +26,8 @@ class Graph:
|
|||
"key": el.graphkey,
|
||||
"attributes": {
|
||||
"label": label,
|
||||
"size": 10
|
||||
"size": 10,
|
||||
"url": el.get_absolute_url() if hasattr(el, "get_absolute_url") else "/"
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -41,6 +41,13 @@ if (container) {
|
|||
labelSize: 20,
|
||||
edgeLabelSize: 200,
|
||||
});
|
||||
|
||||
|
||||
renderer.on("clickNode", (e) => {
|
||||
const url = graph.getNodeAttribute(e.node, "url")
|
||||
window.open(url, 'graphURL')
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue