Skip to content

Commit

Permalink
Preparing to publish 3.2.17
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkfranz committed Sep 28, 2018
1 parent 017cd60 commit 7992872
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 45 deletions.
62 changes: 43 additions & 19 deletions dist/cytoscape.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -21772,6 +21772,33 @@ BRp.recalculateNodeLabelProjection = function (node) {
this.applyLabelDimensions(node);
};

var lineAngleFromDelta = function lineAngleFromDelta(dx, dy) {
var angle = Math.atan(dy / dx);

if (dx === 0 && angle < 0) {
angle = angle * -1;
}

return angle;
};

var lineAngle = function lineAngle(p0, p1) {
var dx = p1.x - p0.x;
var dy = p1.y - p0.y;

return lineAngleFromDelta(dx, dy);
};

var bezierAngle = function bezierAngle(p0, p1, p2, t) {
var t0 = math.bound(0, t - 0.001, 1);
var t1 = math.bound(0, t + 0.001, 1);

var lp0 = math.qbezierPtAt(p0, p1, p2, t0);
var lp1 = math.qbezierPtAt(p0, p1, p2, t1);

return lineAngle(lp0, lp1);
};

BRp.recalculateEdgeLabelProjections = function (edge) {
var p;
var _p = edge._private;
Expand Down Expand Up @@ -21804,6 +21831,9 @@ BRp.recalculateEdgeLabelProjections = function (edge) {
setRs('labelX', null, p.x);
setRs('labelY', null, p.y);

var midAngle = lineAngleFromDelta(rs.midDispX, rs.midDispY);
setRs('labelAutoAngle', null, midAngle);

var createControlPointInfo = function createControlPointInfo() {
if (createControlPointInfo.cache) {
return createControlPointInfo.cache;
Expand Down Expand Up @@ -21878,23 +21908,6 @@ BRp.recalculateEdgeLabelProjections = function (edge) {

var offset = edge.pstyle(prefix + '-text-offset').pfValue;

var lineAngle = function lineAngle(p0, p1) {
var dx = p1.x - p0.x;
var dy = p1.y - p0.y;

return Math.atan(dy / dx);
};

var bezierAngle = function bezierAngle(p0, p1, p2, t) {
var t0 = math.bound(0, t - 0.001, 1);
var t1 = math.bound(0, t + 0.001, 1);

var lp0 = math.qbezierPtAt(p0, p1, p2, t0);
var lp1 = math.qbezierPtAt(p0, p1, p2, t1);

return lineAngle(lp0, lp1);
};

switch (rs.edgeType) {
case 'self':
case 'compound':
Expand Down Expand Up @@ -22198,7 +22211,7 @@ BRp.calculateLabelAngles = function (ele) {
if (rotStr === 'none') {
rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = 0;
} else if (isEdge && rotStr === 'autorotate') {
rs.labelAngle = Math.atan(rs.midDispY / rs.midDispX);
rs.labelAngle = rs.labelAutoAngle;
rs.sourceLabelAngle = rs.sourceLabelAutoAngle;
rs.targetLabelAngle = rs.targetLabelAutoAngle;
} else if (rotStr === 'autorotate') {
Expand Down Expand Up @@ -22844,6 +22857,12 @@ BRp.load = function () {
}
};

var blurActiveDomElement = function blurActiveDomElement() {
if (document.activeElement != null && document.activeElement.blur != null) {
document.activeElement.blur();
}
};

var haveMutationsApi = typeof MutationObserver !== 'undefined';

// watch for when the cy container is removed from the dom
Expand Down Expand Up @@ -22968,6 +22987,9 @@ BRp.load = function () {
}

e.preventDefault();

blurActiveDomElement();

r.hoverData.capture = true;
r.hoverData.which = e.which;

Expand Down Expand Up @@ -23694,6 +23716,8 @@ BRp.load = function () {
return;
}

blurActiveDomElement();

r.touchData.capture = true;
r.data.bgActivePosistion = undefined;

Expand Down Expand Up @@ -29103,7 +29127,7 @@ module.exports = Stylesheet;
"use strict";


module.exports = "3.2.16";
module.exports = "3.2.17";

/***/ })
/******/ ]);
Expand Down
62 changes: 43 additions & 19 deletions dist/cytoscape.js
Original file line number Diff line number Diff line change
Expand Up @@ -22534,6 +22534,33 @@ BRp.recalculateNodeLabelProjection = function (node) {
this.applyLabelDimensions(node);
};

var lineAngleFromDelta = function lineAngleFromDelta(dx, dy) {
var angle = Math.atan(dy / dx);

if (dx === 0 && angle < 0) {
angle = angle * -1;
}

return angle;
};

var lineAngle = function lineAngle(p0, p1) {
var dx = p1.x - p0.x;
var dy = p1.y - p0.y;

return lineAngleFromDelta(dx, dy);
};

var bezierAngle = function bezierAngle(p0, p1, p2, t) {
var t0 = math.bound(0, t - 0.001, 1);
var t1 = math.bound(0, t + 0.001, 1);

var lp0 = math.qbezierPtAt(p0, p1, p2, t0);
var lp1 = math.qbezierPtAt(p0, p1, p2, t1);

return lineAngle(lp0, lp1);
};

BRp.recalculateEdgeLabelProjections = function (edge) {
var p;
var _p = edge._private;
Expand Down Expand Up @@ -22566,6 +22593,9 @@ BRp.recalculateEdgeLabelProjections = function (edge) {
setRs('labelX', null, p.x);
setRs('labelY', null, p.y);

var midAngle = lineAngleFromDelta(rs.midDispX, rs.midDispY);
setRs('labelAutoAngle', null, midAngle);

var createControlPointInfo = function createControlPointInfo() {
if (createControlPointInfo.cache) {
return createControlPointInfo.cache;
Expand Down Expand Up @@ -22640,23 +22670,6 @@ BRp.recalculateEdgeLabelProjections = function (edge) {

var offset = edge.pstyle(prefix + '-text-offset').pfValue;

var lineAngle = function lineAngle(p0, p1) {
var dx = p1.x - p0.x;
var dy = p1.y - p0.y;

return Math.atan(dy / dx);
};

var bezierAngle = function bezierAngle(p0, p1, p2, t) {
var t0 = math.bound(0, t - 0.001, 1);
var t1 = math.bound(0, t + 0.001, 1);

var lp0 = math.qbezierPtAt(p0, p1, p2, t0);
var lp1 = math.qbezierPtAt(p0, p1, p2, t1);

return lineAngle(lp0, lp1);
};

switch (rs.edgeType) {
case 'self':
case 'compound':
Expand Down Expand Up @@ -22960,7 +22973,7 @@ BRp.calculateLabelAngles = function (ele) {
if (rotStr === 'none') {
rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = 0;
} else if (isEdge && rotStr === 'autorotate') {
rs.labelAngle = Math.atan(rs.midDispY / rs.midDispX);
rs.labelAngle = rs.labelAutoAngle;
rs.sourceLabelAngle = rs.sourceLabelAutoAngle;
rs.targetLabelAngle = rs.targetLabelAutoAngle;
} else if (rotStr === 'autorotate') {
Expand Down Expand Up @@ -23606,6 +23619,12 @@ BRp.load = function () {
}
};

var blurActiveDomElement = function blurActiveDomElement() {
if (document.activeElement != null && document.activeElement.blur != null) {
document.activeElement.blur();
}
};

var haveMutationsApi = typeof MutationObserver !== 'undefined';

// watch for when the cy container is removed from the dom
Expand Down Expand Up @@ -23730,6 +23749,9 @@ BRp.load = function () {
}

e.preventDefault();

blurActiveDomElement();

r.hoverData.capture = true;
r.hoverData.which = e.which;

Expand Down Expand Up @@ -24456,6 +24478,8 @@ BRp.load = function () {
return;
}

blurActiveDomElement();

r.touchData.capture = true;
r.data.bgActivePosistion = undefined;

Expand Down Expand Up @@ -29865,7 +29889,7 @@ module.exports = Stylesheet;
"use strict";


module.exports = "3.2.16";
module.exports = "3.2.17";

/***/ })
/******/ ]);
Expand Down
2 changes: 1 addition & 1 deletion dist/cytoscape.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion documentation/docmaker.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.2.16",
"version": "3.2.17",

"fnArgLinks": {
"selector": "#selectors",
Expand Down
4 changes: 2 additions & 2 deletions documentation/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion documentation/js/cytoscape.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cytoscape",
"version": "3.2.16",
"version": "3.2.17",
"license": "MIT",
"description": "Graph theory (a.k.a. network) library for analysis and visualisation",
"homepage": "http://js.cytoscape.org",
Expand Down
2 changes: 1 addition & 1 deletion src/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = "3.2.16";
module.exports = "3.2.17";

0 comments on commit 7992872

Please sign in to comment.