Skip to content

Commit

Permalink
Release v3.7.5 (#2284)
Browse files Browse the repository at this point in the history
  • Loading branch information
zbynekstara authored Aug 2, 2023
1 parent 2b82631 commit 1049447
Show file tree
Hide file tree
Showing 37 changed files with 352 additions and 148 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
02-08-2023 (v3.7.5)

* layout.PortLabel - fix passing of `label.position.args.attrs` in `inside`, `outside`, `radial` layouts
* connectors.Jumpover - fix to prevent stacked links from causing jumps
* util.breakText - fix to prevent NO_SPACE characters from appearing in the result

23-06-2023 (v3.7.4)

* dia.LinkView - fix element detection when using `snapLinkSelf: true`
Expand Down
2 changes: 1 addition & 1 deletion dist/geometry.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! JointJS v3.7.4 (2023-06-23) - JavaScript diagramming library
/*! JointJS v3.7.5 (2023-08-02) - JavaScript diagramming library
This Source Code Form is subject to the terms of the Mozilla Public
Expand Down
2 changes: 1 addition & 1 deletion dist/geometry.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/joint.core.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

140 changes: 103 additions & 37 deletions dist/joint.core.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! JointJS v3.7.4 (2023-06-23) - JavaScript diagramming library
/*! JointJS v3.7.5 (2023-08-02) - JavaScript diagramming library


This Source Code Form is subject to the terms of the Mozilla Public
Expand Down Expand Up @@ -13672,7 +13672,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.

// move last letter to the beginning of the next word
words[i] = word.substring(0, p);
words[i + 1] = word.substring(p) + (words[i + 1] === undefined ? '' : words[i + 1]);
var nextWord = words[i + 1];
words[i + 1] = word.substring(p) + (nextWord === undefined || nextWord === NO_SPACE ? '' : nextWord);

} else {

Expand Down Expand Up @@ -17101,6 +17102,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.

function labelAttributes(opt1, opt2) {

// use value from `opt2` if it is missing in `opt1`
// use value from this object if it is missing in `opt2` as well
return defaultsDeep({}, opt1, opt2, {
x: 0,
y: 0,
Expand All @@ -17109,22 +17112,38 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
});
}

function getBBoxAngles(elBBox) {

var center = elBBox.center();

var tl = center.theta(elBBox.origin());
var bl = center.theta(elBBox.bottomLeft());
var br = center.theta(elBBox.corner());
var tr = center.theta(elBBox.topRight());

return [tl, tr, br, bl];
}

function outsideLayout(portPosition, elBBox, autoOrient, opt) {

opt = defaults({}, opt, { offset: 15 });
var angle = elBBox.center().theta(portPosition);
var x = getBBoxAngles(elBBox);

var tx, ty, y, textAnchor;
var offset = opt.offset;
var orientAngle = 0;

if (angle < x[1] || angle > x[2]) {
var ref = getBBoxAngles(elBBox);
var topLeftAngle = ref[0];
var bottomLeftAngle = ref[1];
var bottomRightAngle = ref[2];
var topRightAngle = ref[3];
if ((angle < bottomLeftAngle) || (angle > bottomRightAngle)) {
y = '.3em';
tx = offset;
ty = 0;
textAnchor = 'start';
} else if (angle < x[0]) {
} else if (angle < topLeftAngle) {
tx = 0;
ty = -offset;
if (autoOrient) {
Expand All @@ -17135,7 +17154,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
textAnchor = 'middle';
y = '0';
}
} else if (angle < x[3]) {
} else if (angle < topRightAngle) {
y = '.3em';
tx = -offset;
ty = 0;
Expand All @@ -17154,43 +17173,34 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
}

var round = Math.round;
return labelAttributes({
return labelAttributes(opt, {
x: round(tx),
y: round(ty),
angle: orientAngle,
attrs: { labelText: { y: y, textAnchor: textAnchor }}
});
}

function getBBoxAngles(elBBox) {

var center = elBBox.center();

var tl = center.theta(elBBox.origin());
var bl = center.theta(elBBox.bottomLeft());
var br = center.theta(elBBox.corner());
var tr = center.theta(elBBox.topRight());

return [tl, tr, br, bl];
}

function insideLayout(portPosition, elBBox, autoOrient, opt) {

var angle = elBBox.center().theta(portPosition);
opt = defaults({}, opt, { offset: 15 });
var angle = elBBox.center().theta(portPosition);

var tx, ty, y, textAnchor;
var offset = opt.offset;
var orientAngle = 0;

var bBoxAngles = getBBoxAngles(elBBox);

if (angle < bBoxAngles[1] || angle > bBoxAngles[2]) {
var ref = getBBoxAngles(elBBox);
var topLeftAngle = ref[0];
var bottomLeftAngle = ref[1];
var bottomRightAngle = ref[2];
var topRightAngle = ref[3];
if ((angle < bottomLeftAngle) || (angle > bottomRightAngle)) {
y = '.3em';
tx = -offset;
ty = 0;
textAnchor = 'end';
} else if (angle < bBoxAngles[0]) {
} else if (angle < topLeftAngle) {
tx = 0;
ty = offset;
if (autoOrient) {
Expand All @@ -17201,7 +17211,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
textAnchor = 'middle';
y = '.6em';
}
} else if (angle < bBoxAngles[3]) {
} else if (angle < topRightAngle) {
y = '.3em';
tx = offset;
ty = 0;
Expand All @@ -17220,7 +17230,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
}

var round = Math.round;
return labelAttributes({
return labelAttributes(opt, {
x: round(tx),
y: round(ty),
angle: orientAngle,
Expand Down Expand Up @@ -17256,16 +17266,11 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
}

var round = Math.round;
return labelAttributes({
return labelAttributes(opt, {
x: round(offset.x),
y: round(offset.y),
angle: autoOrient ? orientAngle : 0,
attrs: {
labelText: {
y: y,
textAnchor: textAnchor
}
}
angle: ((autoOrient) ? orientAngle : 0),
attrs: { labelText: { y: y, textAnchor: textAnchor }}
});
}

Expand Down Expand Up @@ -23600,6 +23605,60 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
var _13 = 1 / 3;
var _23 = 2 / 3;

function sortPointsAscending(p1, p2) {

var x1 = p1.x;
var y1 = p1.y;
var x2 = p2.x;
var y2 = p2.y;

if (x1 > x2) {

var swap = x1;
x1 = x2;
x2 = swap;

swap = y1;
y1 = y2;
y2 = swap;
}

if (y1 > y2) {
var swap$1 = x1;
x1 = x2;
x2 = swap$1;

swap$1 = y1;
y1 = y2;
y2 = swap$1;
}

return [new Point(x1, y1), new Point(x2, y2)];
}

function overlapExists(line1, line2) {

var ref = sortPointsAscending(line1.start, line1.end);
var ref_0 = ref[0];
var x1 = ref_0.x;
var y1 = ref_0.y;
var ref_1 = ref[1];
var x2 = ref_1.x;
var y2 = ref_1.y;
var ref$1 = sortPointsAscending(line2.start, line2.end);
var ref$1_0 = ref$1[0];
var x3 = ref$1_0.x;
var y3 = ref$1_0.y;
var ref$1_1 = ref$1[1];
var x4 = ref$1_1.x;
var y4 = ref$1_1.y;

var xMatch = x1 <= x4 && x3 <= x2;
var yMatch = y1 <= y4 && y3 <= y2;

return xMatch && yMatch;
}

/**
* Transform start/end and route into series of lines
* @param {g.point} sourcePoint start point
Expand Down Expand Up @@ -23956,12 +24015,19 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
var jumpingLines = thisLines.reduce(function(resultLines, thisLine) {
// iterate all links and grab the intersections with this line
// these are then sorted by distance so the line can be split more easily

var intersections = links.reduce(function(res, link, i) {
// don't intersection with itself
if (link !== thisModel) {

var lineIntersections = findLineIntersections(thisLine, linkLines[i]);
var linkLinesToTest = linkLines[i].slice();
var overlapIndex = linkLinesToTest.findIndex(function (line) { return overlapExists(thisLine, line); });

// Overlap occurs and the end point of one segment lies on thisLine
if (overlapIndex > -1 && thisLine.containsPoint(linkLinesToTest[overlapIndex].end)) {
// Remove the next segment because there will never be a jump
linkLinesToTest.splice(overlapIndex + 1, 1);
}
var lineIntersections = findLineIntersections(thisLine, linkLinesToTest);
res.push.apply(res, lineIntersections);
}
return res;
Expand Down Expand Up @@ -36700,7 +36766,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
Control: Control
});

var version = "3.7.4";
var version = "3.7.5";

var Vectorizer = V;
var layout = { PortLabel: PortLabel, Port: Port };
Expand Down
2 changes: 1 addition & 1 deletion dist/joint.core.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/joint.core.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/joint.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/joint.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! JointJS v3.7.4 (2023-06-23) - JavaScript diagramming library
/*! JointJS v3.7.5 (2023-08-02) - JavaScript diagramming library
This Source Code Form is subject to the terms of the Mozilla Public
Expand Down
Loading

0 comments on commit 1049447

Please sign in to comment.