link map visual tweaks

This commit is contained in:
zadam 2019-06-10 11:22:52 +02:00
parent 2bf2ec5a6c
commit ccbb2e2e12

View File

@ -6,22 +6,13 @@ import linkService from "../services/link.js";
const $linkMapContainer = $("#link-map-container"); const $linkMapContainer = $("#link-map-container");
const uniDirectionalOverlays = [
[ "Arrow", {
location: 1,
id: "arrow",
length: 14,
foldback: 0.8
} ],
[ "Label", { label: "", id: "label", cssClass: "connection-label" }]
];
const linkOverlays = [ const linkOverlays = [
[ "Arrow", { [ "Arrow", {
location: 1, location: 1,
id: "arrow", id: "arrow",
length: 14, length: 10,
foldback: 0.8 width: 10,
foldback: 0.7
} ] } ]
]; ];
@ -165,6 +156,10 @@ function cleanup() {
// without this we still end up with note boxes remaining in the canvas // without this we still end up with note boxes remaining in the canvas
$linkMapContainer.empty(); $linkMapContainer.empty();
// reset zoom/pan
pzInstance.zoomTo(0, 0, 1);
pzInstance.moveTo(0, 0);
} }
function initJsPlumbInstance() { function initJsPlumbInstance() {
@ -175,9 +170,9 @@ function initJsPlumbInstance() {
} }
jsPlumbInstance = jsPlumb.getInstance({ jsPlumbInstance = jsPlumb.getInstance({
Endpoint: ["Dot", {radius: 2}], ConnectionOverlays: linkOverlays,
ConnectionOverlays: uniDirectionalOverlays, PaintStyle: { stroke: "var(--muted-text-color)", strokeWidth: 1 },
HoverPaintStyle: { stroke: "#777", strokeWidth: 1 }, HoverPaintStyle: { stroke: "var(--main-text-color)", strokeWidth: 1 },
Container: $linkMapContainer.attr("id") Container: $linkMapContainer.attr("id")
}); });