diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-06-07 19:34:54 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-06-07 19:34:54 +0200 |
| commit | adf56057ff4f56d8a3b7c1e82422a62a0b047d21 (patch) | |
| tree | 1197d2e7915fd2cdcc73e01efafe16268913ed3c /frontend/views/graph | |
| parent | 25417eea7b53f0346985e38409af209f4736b4b0 (diff) | |
tidy lines
Diffstat (limited to 'frontend/views/graph')
| -rw-r--r-- | frontend/views/graph/components/graph.editor.js | 14 | ||||
| -rw-r--r-- | frontend/views/graph/graph.css | 6 |
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 { |
