Skip to content

Commit d3bb8db

Browse files
committed
Switch to LinkerLine for visualization arrows
This allows us to place the arrows inside of the visualization div instead of the body element. The arrows won't overlap any longer with the UI controls at the bottom. Also, the position of the arrows does not need to be updated any longer on every scroll event.
1 parent 85e6d6d commit d3bb8db

File tree

8 files changed

+1225
-62
lines changed

8 files changed

+1225
-62
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ Please report them in the [issue tracker](https://github.com/skogsbaer/write-you
242242
You can debug the extension from Visual Studio Code:
243243

244244
* `npm install`
245+
* `npm run build`
245246
* Open the main folder of the plugin with vscode.
246247
* Open the file `extension.ts`.
247248
* Choose "Run" from the menu, then "Start Debugging".

media/programflow-visualization/leader-line.min.js

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import LinkerLine from "linkerline";
2+
window.LinkerLine = LinkerLine;

media/programflow-visualization/webview.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ function updateVisualization(traceElem) {
6565
`;
6666
const viz = document.getElementById("viz");
6767
viz.innerHTML = data;
68-
viz.addEventListener("scroll", () => {
69-
refTags.forEach((tag) => tag.position());
70-
});
7168
viz.scrollTo(0, viz.scrollHeight);
7269
const stdoutLog = document.getElementById("stdout-log");
7370
stdoutLog.innerHTML = traceElem[4];
@@ -106,7 +103,10 @@ function updateRefArrows(traceElem) {
106103
refTags = tags
107104
.filter((tag) => tag.elem1 && tag.elem2)
108105
.map((tag) => {
109-
return new LeaderLine(tag.elem1, tag.elem2, {
106+
return new LinkerLine({
107+
parent: document.getElementById("viz"),
108+
start: tag.elem1,
109+
end: tag.elem2,
110110
size: 2,
111111
path: "magnet",
112112
startSocket: "right",

0 commit comments

Comments
 (0)