You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Demo: Added option to hide/show main link labels
- Link: Optimised and corrected Relation link drawing algorithm
- Link: Labels are now drawn with a rounded rectangular background that
tries not to be too obtrusive
this.svgBackground = this.svg.rect(this.svgTextBbox.width, this.svgTextBbox.height).addClass("tag-element").addClass("link-text-bg").addClass(addClass).back(); // Transform the rectangle to sit nicely behind the label
40190
+
this.svgBackground = this.svg.rect(this.svgTextBbox.width, this.svgTextBbox.height - 4).addClass("tag-element").addClass("link-text-bg").addClass(addClass).radius(2).back(); // Transform the rectangle to sit nicely behind the label
40173
40191
40174
40192
this.svgBackground.transform({
40175
40193
x: -this.svgTextBbox.width / 2,
40176
-
y: -this.fontSize + 1
40177
-
}); // Click events
40194
+
y: -this.fontSize + 2
40195
+
}); // // Background (text)
40196
+
// this.svgBackground = this.svg.text(text)
40197
+
// .addClass("tag-element")
40198
+
// .addClass("link-text-bg")
40199
+
// .addClass(addClass)
40200
+
// .back();
40201
+
// // Transform the background to sit nicely behind the label
40202
+
// this.svgBackground.transform({
40203
+
// y: -this.fontSize
40204
+
// });
40205
+
// Click events
40178
40206
40179
40207
this.svgText.node.oncontextmenu = function (e) {
40180
40208
_this5.selectedLabel = text;
@@ -42308,7 +42336,8 @@ function () {
42308
42336
// Continue to display top/bottom Links when moving Words?
42309
42337
showTopLinksOnMove: true,
42310
42338
showBottomLinksOnMove: false,
42311
-
// Show argument labels on Links?
42339
+
// Show main/argument labels on Links?
42340
+
showMainLabel: true,
42312
42341
showArgLabels: true
42313
42342
}; // Initialisation
42314
42343
@@ -42474,6 +42503,12 @@ function () {
42474
42503
link.show();
42475
42504
}
42476
42505
42506
+
if (_this.options.showMainLabel) {
42507
+
link.showMainLabel();
42508
+
} else {
42509
+
link.hideMainLabel();
42510
+
}
42511
+
42477
42512
if (_this.options.showArgLabels) {
42478
42513
link.showArgLabels();
42479
42514
} else {
@@ -42717,6 +42752,26 @@ function () {
42717
42752
}
42718
42753
});
42719
42754
}
42755
+
/**
42756
+
* Shows/hides the main label on Links
42757
+
* @param {Boolean} visible - Show if true, hide if false
42758
+
*/
42759
+
42760
+
}, {
42761
+
key: "setMainLabelVisibility",
42762
+
value: function setMainLabelVisibility(visible) {
42763
+
this.setOption("showMainLabel", visible);
42764
+
42765
+
if (visible) {
42766
+
this.links.forEach(function (link) {
42767
+
return link.showMainLabel();
42768
+
});
42769
+
} else {
42770
+
this.links.forEach(function (link) {
42771
+
return link.hideMainLabel();
42772
+
});
42773
+
}
42774
+
}
42720
42775
/**
42721
42776
* Shows/hides the argument labels on Links
42722
42777
* @param {Boolean} visible - Show if true, hide if false
0 commit comments