summaryrefslogtreecommitdiff
path: root/frontend/views/graph
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/views/graph')
-rw-r--r--frontend/views/graph/components/graph.editor.js14
-rw-r--r--frontend/views/graph/graph.css6
2 files changed, 12 insertions, 8 deletions
diff --git a/frontend/views/graph/components/graph.editor.js b/frontend/views/graph/components/graph.editor.js
index a6d46d4..c1b3432 100644
--- a/frontend/views/graph/components/graph.editor.js
+++ b/frontend/views/graph/components/graph.editor.js
@@ -220,13 +220,17 @@ class GraphCanvas extends Component {
const targetCoord = coordsLookup[tile.page_id]
let xOffset = 16
let yOffset = 16
- // console.log(tile.page_id, tile.target_page_id, sourceCoord.backlinks, targetCoord.backlinks)
- if (targetCoord.backlinks.has(tile.target_page_id)) {
- xOffset += 10
- ctx.strokeStyle = "#88ffff"
- } else {
+ // skip duplicate links
+ if (sourceCoord.backlinks.has(tile.page_id)) {
+ return
+ }
+ // if this is the first time encountering this link...
+ if (!targetCoord.backlinks.has(tile.target_page_id)) {
sourceCoord.backlinks.add(tile.page_id)
ctx.strokeStyle = "#ff88ff"
+ } else { // otherwise this is a two-way link
+ xOffset += 10
+ ctx.strokeStyle = "#88ffff"
}
ctx.beginPath()
const x1 = targetCoord.x * width + xOffset
diff --git a/frontend/views/graph/graph.css b/frontend/views/graph/graph.css
index 52f1a7e..af29e15 100644
--- a/frontend/views/graph/graph.css
+++ b/frontend/views/graph/graph.css
@@ -7,9 +7,9 @@
height: 100%;
overflow: hidden;
background: linear-gradient(
- -45deg,
- rgba(0, 0, 64, 0.2),
- rgba(128, 0, 64, 0.2)
+ 0deg,
+ rgba(128, 0, 64, 0.5),
+ rgba(0, 0, 64, 0.5)
);
}
.graph canvas {