force-graph 1.49.1 → 1.49.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/force-graph.js +8 -10
- package/dist/force-graph.js.map +1 -1
- package/dist/force-graph.min.js +3 -3
- package/dist/force-graph.mjs +7 -9
- package/package.json +1 -1
- package/src/force-graph.js +7 -8
package/dist/force-graph.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Version 1.49.
|
|
1
|
+
// Version 1.49.2 force-graph - https://github.com/vasturiano/force-graph
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -12444,9 +12444,7 @@
|
|
|
12444
12444
|
x: obj.x,
|
|
12445
12445
|
y: obj.y,
|
|
12446
12446
|
fx: obj.fx,
|
|
12447
|
-
fy: obj.fy
|
|
12448
|
-
clientX: ev.sourceEvent.clientX,
|
|
12449
|
-
clientY: ev.sourceEvent.clientY
|
|
12447
|
+
fy: obj.fy
|
|
12450
12448
|
};
|
|
12451
12449
|
|
|
12452
12450
|
// keep engine running at low intensity throughout drag
|
|
@@ -12462,10 +12460,6 @@
|
|
|
12462
12460
|
var initPos = obj.__initialDragPos;
|
|
12463
12461
|
var dragPos = ev;
|
|
12464
12462
|
var k = transform(state.canvas).k;
|
|
12465
|
-
var translate = {
|
|
12466
|
-
x: initPos.x + (dragPos.x - initPos.x) / k - obj.x,
|
|
12467
|
-
y: initPos.y + (dragPos.y - initPos.y) / k - obj.y
|
|
12468
|
-
};
|
|
12469
12463
|
|
|
12470
12464
|
// Move fx/fy (and x/y) of nodes based on the scaled drag distance since the drag start
|
|
12471
12465
|
['x', 'y'].forEach(function (c) {
|
|
@@ -12473,9 +12467,13 @@
|
|
|
12473
12467
|
});
|
|
12474
12468
|
|
|
12475
12469
|
// Only engage full drag if distance reaches above threshold
|
|
12476
|
-
if (!obj.__dragged && DRAG_CLICK_TOLERANCE_PX >= Math.sqrt(sum(['
|
|
12477
|
-
return Math.pow(ev
|
|
12470
|
+
if (!obj.__dragged && DRAG_CLICK_TOLERANCE_PX >= Math.sqrt(sum(['x', 'y'].map(function (k) {
|
|
12471
|
+
return Math.pow(ev[k] - initPos[k], 2);
|
|
12478
12472
|
})))) return;
|
|
12473
|
+
var translate = {
|
|
12474
|
+
x: initPos.x + (dragPos.x - initPos.x) / k - obj.x,
|
|
12475
|
+
y: initPos.y + (dragPos.y - initPos.y) / k - obj.y
|
|
12476
|
+
};
|
|
12479
12477
|
state.forceGraph.d3AlphaTarget(0.3) // keep engine running at low intensity throughout drag
|
|
12480
12478
|
.resetCountdown(); // prevent freeze while dragging
|
|
12481
12479
|
|