1
0
Fork 0
mirror of https://github.com/Findus23/RPGnotes.git synced 2024-09-19 15:43:45 +02:00

link graph

This commit is contained in:
Lukas Winkler 2022-11-20 00:25:04 +01:00
parent 3eeaf581f9
commit 19aa3e0722
Signed by: lukas
GPG key ID: 54DE4D798D244853
2 changed files with 9 additions and 1 deletions

View file

@ -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 "/"
}
})

View file

@ -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')
})
}