@opentrace/components 0.1.1-rc.30 → 0.1.1-rc.44
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/components.css +1584 -0
- package/dist/indexing.cjs +8 -0
- package/dist/indexing.cjs.map +1 -0
- package/dist/indexing.js +8 -0
- package/dist/indexing.js.map +1 -0
- package/dist/opentrace-components.cjs +200 -2
- package/dist/opentrace-components.cjs.map +1 -1
- package/dist/opentrace-components.js +484 -286
- package/dist/opentrace-components.js.map +1 -1
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/indexing/AddRepoModal.d.ts +6 -0
- package/dist/src/indexing/AddRepoModal.d.ts.map +1 -0
- package/dist/src/indexing/IndexingProgress.d.ts +11 -0
- package/dist/src/indexing/IndexingProgress.d.ts.map +1 -0
- package/dist/src/indexing/index.d.ts +6 -0
- package/dist/src/indexing/index.d.ts.map +1 -0
- package/dist/src/indexing/types.d.ts +54 -0
- package/dist/src/indexing/types.d.ts.map +1 -0
- package/dist/src/indexing/urlNormalize.d.ts +16 -0
- package/dist/src/indexing/urlNormalize.d.ts.map +1 -0
- package/dist/src/panels/GraphToolbar.d.ts +4 -0
- package/dist/src/panels/GraphToolbar.d.ts.map +1 -0
- package/dist/src/panels/index.d.ts +2 -1
- package/dist/src/panels/index.d.ts.map +1 -1
- package/dist/src/panels/types.d.ts +46 -0
- package/dist/src/panels/types.d.ts.map +1 -1
- package/dist/urlNormalize-DL0SAEQS.cjs +989 -0
- package/dist/urlNormalize-DL0SAEQS.cjs.map +1 -0
- package/dist/urlNormalize-KY4ngwCQ.js +990 -0
- package/dist/urlNormalize-KY4ngwCQ.js.map +1 -0
- package/package.json +6 -1
|
@@ -2,6 +2,7 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import t, { forwardRef, useRef, useState, useEffect, useImperativeHandle, useMemo, useContext, createContext, useCallback, memo, createElement as createElement$1, useLayoutEffect } from "react";
|
|
3
3
|
import { f as eventsExports, h as getDefaultExportFromCjs, r as requireIsGraph, G as Graph, g as getCommunityColor, a as buildCommunityNames, b as buildCommunityColorMap, c as getLinkColor, d as getNodeColor, i as requireGetters, u as useCommunities, j as useGraphFilters, e as useHighlights } from "./useHighlights-DbMfb0-p.js";
|
|
4
4
|
import { s } from "./useHighlights-DbMfb0-p.js";
|
|
5
|
+
import { A, I, d, n } from "./urlNormalize-KY4ngwCQ.js";
|
|
5
6
|
function _toPrimitive$1(t2, r) {
|
|
6
7
|
if ("object" != typeof t2 || !t2) return t2;
|
|
7
8
|
var e2 = t2[Symbol.toPrimitive];
|
|
@@ -16,8 +17,8 @@ function _toPropertyKey$1(t2) {
|
|
|
16
17
|
var i = _toPrimitive$1(t2, "string");
|
|
17
18
|
return "symbol" == typeof i ? i : i + "";
|
|
18
19
|
}
|
|
19
|
-
function _classCallCheck$1(a,
|
|
20
|
-
if (!(a instanceof
|
|
20
|
+
function _classCallCheck$1(a, n3) {
|
|
21
|
+
if (!(a instanceof n3)) throw new TypeError("Cannot call a class as a function");
|
|
21
22
|
}
|
|
22
23
|
function _defineProperties$1(e2, r) {
|
|
23
24
|
for (var t2 = 0; t2 < r.length; t2++) {
|
|
@@ -80,19 +81,19 @@ function _arrayWithHoles(r) {
|
|
|
80
81
|
function _iterableToArrayLimit(r, l) {
|
|
81
82
|
var t2 = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
82
83
|
if (null != t2) {
|
|
83
|
-
var e2,
|
|
84
|
+
var e2, n3, i, u, a = [], f2 = true, o = false;
|
|
84
85
|
try {
|
|
85
86
|
if (i = (t2 = t2.call(r)).next, 0 === l) {
|
|
86
87
|
if (Object(t2) !== t2) return;
|
|
87
88
|
f2 = false;
|
|
88
89
|
} else for (; !(f2 = (e2 = i.call(t2)).done) && (a.push(e2.value), a.length !== l); f2 = true) ;
|
|
89
90
|
} catch (r2) {
|
|
90
|
-
o = true,
|
|
91
|
+
o = true, n3 = r2;
|
|
91
92
|
} finally {
|
|
92
93
|
try {
|
|
93
94
|
if (!f2 && null != t2.return && (u = t2.return(), Object(u) !== u)) return;
|
|
94
95
|
} finally {
|
|
95
|
-
if (o) throw
|
|
96
|
+
if (o) throw n3;
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
return a;
|
|
@@ -100,8 +101,8 @@ function _iterableToArrayLimit(r, l) {
|
|
|
100
101
|
}
|
|
101
102
|
function _arrayLikeToArray$1(r, a) {
|
|
102
103
|
(null == a || a > r.length) && (a = r.length);
|
|
103
|
-
for (var e2 = 0,
|
|
104
|
-
return
|
|
104
|
+
for (var e2 = 0, n3 = Array(a); e2 < a; e2++) n3[e2] = r[e2];
|
|
105
|
+
return n3;
|
|
105
106
|
}
|
|
106
107
|
function _unsupportedIterableToArray$1(r, a) {
|
|
107
108
|
if (r) {
|
|
@@ -386,8 +387,8 @@ function _get() {
|
|
|
386
387
|
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e2, t2, r) {
|
|
387
388
|
var p = _superPropBase(e2, t2);
|
|
388
389
|
if (p) {
|
|
389
|
-
var
|
|
390
|
-
return
|
|
390
|
+
var n3 = Object.getOwnPropertyDescriptor(p, t2);
|
|
391
|
+
return n3.get ? n3.get.call(arguments.length < 3 ? e2 : r) : n3.value;
|
|
391
392
|
}
|
|
392
393
|
}, _get.apply(null, arguments);
|
|
393
394
|
}
|
|
@@ -790,23 +791,23 @@ function drawStraightEdgeLabel(context, edgeData, sourceData, targetData, settin
|
|
|
790
791
|
var cy = (sy + ty) / 2;
|
|
791
792
|
var dx = tx - sx;
|
|
792
793
|
var dy = ty - sy;
|
|
793
|
-
var
|
|
794
|
-
if (
|
|
795
|
-
sx += dx * sSize /
|
|
796
|
-
sy += dy * sSize /
|
|
797
|
-
tx -= dx * tSize /
|
|
798
|
-
ty -= dy * tSize /
|
|
794
|
+
var d3 = Math.sqrt(dx * dx + dy * dy);
|
|
795
|
+
if (d3 < sSize + tSize) return;
|
|
796
|
+
sx += dx * sSize / d3;
|
|
797
|
+
sy += dy * sSize / d3;
|
|
798
|
+
tx -= dx * tSize / d3;
|
|
799
|
+
ty -= dy * tSize / d3;
|
|
799
800
|
cx = (sx + tx) / 2;
|
|
800
801
|
cy = (sy + ty) / 2;
|
|
801
802
|
dx = tx - sx;
|
|
802
803
|
dy = ty - sy;
|
|
803
|
-
|
|
804
|
+
d3 = Math.sqrt(dx * dx + dy * dy);
|
|
804
805
|
var textLength = context.measureText(label).width;
|
|
805
|
-
if (textLength >
|
|
806
|
+
if (textLength > d3) {
|
|
806
807
|
var ellipsis = "…";
|
|
807
808
|
label = label + ellipsis;
|
|
808
809
|
textLength = context.measureText(label).width;
|
|
809
|
-
while (textLength >
|
|
810
|
+
while (textLength > d3 && label.length > 1) {
|
|
810
811
|
label = label.slice(0, -2) + ellipsis;
|
|
811
812
|
textLength = context.measureText(label).width;
|
|
812
813
|
}
|
|
@@ -814,11 +815,11 @@ function drawStraightEdgeLabel(context, edgeData, sourceData, targetData, settin
|
|
|
814
815
|
}
|
|
815
816
|
var angle;
|
|
816
817
|
if (dx > 0) {
|
|
817
|
-
if (dy > 0) angle = Math.acos(dx /
|
|
818
|
-
else angle = Math.asin(dy /
|
|
818
|
+
if (dy > 0) angle = Math.acos(dx / d3);
|
|
819
|
+
else angle = Math.asin(dy / d3);
|
|
819
820
|
} else {
|
|
820
|
-
if (dy > 0) angle = Math.acos(dx /
|
|
821
|
-
else angle = Math.asin(dx /
|
|
821
|
+
if (dy > 0) angle = Math.acos(dx / d3) + Math.PI;
|
|
822
|
+
else angle = Math.asin(dx / d3) + Math.PI / 2;
|
|
822
823
|
}
|
|
823
824
|
context.save();
|
|
824
825
|
context.translate(cx, cy);
|
|
@@ -1028,17 +1029,17 @@ function createEdgeArrowHeadProgram(inputOptions) {
|
|
|
1028
1029
|
var dy = y2 - y1;
|
|
1029
1030
|
var len = dx * dx + dy * dy;
|
|
1030
1031
|
var n1 = 0;
|
|
1031
|
-
var
|
|
1032
|
+
var n22 = 0;
|
|
1032
1033
|
if (len) {
|
|
1033
1034
|
len = 1 / Math.sqrt(len);
|
|
1034
1035
|
n1 = -dy * len * thickness;
|
|
1035
|
-
|
|
1036
|
+
n22 = dx * len * thickness;
|
|
1036
1037
|
}
|
|
1037
1038
|
var array = this.array;
|
|
1038
1039
|
array[startIndex++] = x2;
|
|
1039
1040
|
array[startIndex++] = y2;
|
|
1040
1041
|
array[startIndex++] = -n1;
|
|
1041
|
-
array[startIndex++] = -
|
|
1042
|
+
array[startIndex++] = -n22;
|
|
1042
1043
|
array[startIndex++] = radius;
|
|
1043
1044
|
array[startIndex++] = color;
|
|
1044
1045
|
array[startIndex++] = edgeIndex;
|
|
@@ -1154,11 +1155,11 @@ function createEdgeClampedProgram(inputOptions) {
|
|
|
1154
1155
|
var radius = targetData.size || 1;
|
|
1155
1156
|
var len = dx * dx + dy * dy;
|
|
1156
1157
|
var n1 = 0;
|
|
1157
|
-
var
|
|
1158
|
+
var n22 = 0;
|
|
1158
1159
|
if (len) {
|
|
1159
1160
|
len = 1 / Math.sqrt(len);
|
|
1160
1161
|
n1 = -dy * len * thickness;
|
|
1161
|
-
|
|
1162
|
+
n22 = dx * len * thickness;
|
|
1162
1163
|
}
|
|
1163
1164
|
var array = this.array;
|
|
1164
1165
|
array[startIndex++] = x1;
|
|
@@ -1166,7 +1167,7 @@ function createEdgeClampedProgram(inputOptions) {
|
|
|
1166
1167
|
array[startIndex++] = x2;
|
|
1167
1168
|
array[startIndex++] = y2;
|
|
1168
1169
|
array[startIndex++] = n1;
|
|
1169
|
-
array[startIndex++] =
|
|
1170
|
+
array[startIndex++] = n22;
|
|
1170
1171
|
array[startIndex++] = color;
|
|
1171
1172
|
array[startIndex++] = edgeIndex;
|
|
1172
1173
|
array[startIndex++] = radius;
|
|
@@ -1334,11 +1335,11 @@ var EdgeRectangleProgram = /* @__PURE__ */ (function(_EdgeProgram) {
|
|
|
1334
1335
|
var dy = y2 - y1;
|
|
1335
1336
|
var len = dx * dx + dy * dy;
|
|
1336
1337
|
var n1 = 0;
|
|
1337
|
-
var
|
|
1338
|
+
var n22 = 0;
|
|
1338
1339
|
if (len) {
|
|
1339
1340
|
len = 1 / Math.sqrt(len);
|
|
1340
1341
|
n1 = -dy * len * thickness;
|
|
1341
|
-
|
|
1342
|
+
n22 = dx * len * thickness;
|
|
1342
1343
|
}
|
|
1343
1344
|
var array = this.array;
|
|
1344
1345
|
array[startIndex++] = x1;
|
|
@@ -1346,7 +1347,7 @@ var EdgeRectangleProgram = /* @__PURE__ */ (function(_EdgeProgram) {
|
|
|
1346
1347
|
array[startIndex++] = x2;
|
|
1347
1348
|
array[startIndex++] = y2;
|
|
1348
1349
|
array[startIndex++] = n1;
|
|
1349
|
-
array[startIndex++] =
|
|
1350
|
+
array[startIndex++] = n22;
|
|
1350
1351
|
array[startIndex++] = color;
|
|
1351
1352
|
array[startIndex++] = edgeIndex;
|
|
1352
1353
|
}
|
|
@@ -2518,9 +2519,9 @@ function _toConsumableArray$1(r) {
|
|
|
2518
2519
|
function _objectWithoutPropertiesLoose(r, e2) {
|
|
2519
2520
|
if (null == r) return {};
|
|
2520
2521
|
var t2 = {};
|
|
2521
|
-
for (var
|
|
2522
|
-
if (-1 !== e2.indexOf(
|
|
2523
|
-
t2[
|
|
2522
|
+
for (var n3 in r) if ({}.hasOwnProperty.call(r, n3)) {
|
|
2523
|
+
if (-1 !== e2.indexOf(n3)) continue;
|
|
2524
|
+
t2[n3] = r[n3];
|
|
2524
2525
|
}
|
|
2525
2526
|
return t2;
|
|
2526
2527
|
}
|
|
@@ -2528,8 +2529,8 @@ function _objectWithoutProperties(e2, t2) {
|
|
|
2528
2529
|
if (null == e2) return {};
|
|
2529
2530
|
var o, r, i = _objectWithoutPropertiesLoose(e2, t2);
|
|
2530
2531
|
if (Object.getOwnPropertySymbols) {
|
|
2531
|
-
var
|
|
2532
|
-
for (r = 0; r <
|
|
2532
|
+
var n3 = Object.getOwnPropertySymbols(e2);
|
|
2533
|
+
for (r = 0; r < n3.length; r++) o = n3[r], -1 === t2.indexOf(o) && {}.propertyIsEnumerable.call(e2, o) && (i[o] = e2[o]);
|
|
2533
2534
|
}
|
|
2534
2535
|
return i;
|
|
2535
2536
|
}
|
|
@@ -4598,9 +4599,9 @@ var Sigma$1 = /* @__PURE__ */ (function(_TypedEventEmitter) {
|
|
|
4598
4599
|
}
|
|
4599
4600
|
}]);
|
|
4600
4601
|
})(TypedEventEmitter);
|
|
4601
|
-
const
|
|
4602
|
+
const d2 = createContext(null), f = d2.Provider;
|
|
4602
4603
|
function h() {
|
|
4603
|
-
const e2 = useContext(
|
|
4604
|
+
const e2 = useContext(d2);
|
|
4604
4605
|
if (null == e2) throw new Error("No context provided: useSigmaContext() can only be used in a descendant of <SigmaContainer>");
|
|
4605
4606
|
return e2;
|
|
4606
4607
|
}
|
|
@@ -4618,32 +4619,32 @@ function j(e2, t2) {
|
|
|
4618
4619
|
if (e2 === t2) return true;
|
|
4619
4620
|
if ("object" == typeof e2 && null != e2 && "object" == typeof t2 && null != t2) {
|
|
4620
4621
|
if (Object.keys(e2).length != Object.keys(t2).length) return false;
|
|
4621
|
-
for (const
|
|
4622
|
-
if (!Object.hasOwn(t2,
|
|
4623
|
-
if (!j(e2[
|
|
4622
|
+
for (const n3 in e2) {
|
|
4623
|
+
if (!Object.hasOwn(t2, n3)) return false;
|
|
4624
|
+
if (!j(e2[n3], t2[n3])) return false;
|
|
4624
4625
|
}
|
|
4625
4626
|
return true;
|
|
4626
4627
|
}
|
|
4627
4628
|
return false;
|
|
4628
4629
|
}
|
|
4629
|
-
const S = forwardRef((({ graph: e2, id:
|
|
4630
|
-
const v2 = useRef(null), p = useRef(null), w2 = { className: `react-sigma ${r || ""}`, id:
|
|
4630
|
+
const S = forwardRef((({ graph: e2, id: n3, className: r, style: a, settings: s2 = {}, children: d3 }, h2) => {
|
|
4631
|
+
const v2 = useRef(null), p = useRef(null), w2 = { className: `react-sigma ${r || ""}`, id: n3, style: a }, [b, E] = useState(null), [_, O] = useState(s2);
|
|
4631
4632
|
useEffect((() => {
|
|
4632
4633
|
O(((e3) => j(e3, s2) ? e3 : s2));
|
|
4633
4634
|
}), [s2]), useEffect((() => {
|
|
4634
4635
|
let t2 = null;
|
|
4635
4636
|
if (null !== p.current) {
|
|
4636
|
-
let
|
|
4637
|
-
e2 && (
|
|
4638
|
-
let
|
|
4639
|
-
return e3 && (
|
|
4637
|
+
let n4 = new Graph();
|
|
4638
|
+
e2 && (n4 = "function" == typeof e2 ? new e2() : e2), t2 = new Sigma$1(n4, p.current, _), E(((e3) => {
|
|
4639
|
+
let n5 = null;
|
|
4640
|
+
return e3 && (n5 = e3.getCamera().getState()), n5 && t2.getCamera().setState(n5), t2;
|
|
4640
4641
|
}));
|
|
4641
4642
|
}
|
|
4642
4643
|
return () => {
|
|
4643
4644
|
t2 && t2.kill();
|
|
4644
4645
|
};
|
|
4645
4646
|
}), [p, e2, _]), useImperativeHandle(h2, (() => b), [b]);
|
|
4646
|
-
const y = useMemo((() => b && v2.current ? { sigma: b, container: v2.current } : null), [b, v2]), C = null !== y ? t.createElement(f, { value: y },
|
|
4647
|
+
const y = useMemo((() => b && v2.current ? { sigma: b, container: v2.current } : null), [b, v2]), C = null !== y ? t.createElement(f, { value: y }, d3) : null;
|
|
4647
4648
|
return t.createElement("div", Object.assign({}, w2, { ref: v2 }), t.createElement("div", { className: "sigma-container", ref: p }), C);
|
|
4648
4649
|
}));
|
|
4649
4650
|
var SHADER_SOURCE$4 = (
|
|
@@ -4746,11 +4747,11 @@ function createEdgeDoubleClampedProgram(inputOptions) {
|
|
|
4746
4747
|
var targetRadius = targetData.size || 1;
|
|
4747
4748
|
var len = dx * dx + dy * dy;
|
|
4748
4749
|
var n1 = 0;
|
|
4749
|
-
var
|
|
4750
|
+
var n22 = 0;
|
|
4750
4751
|
if (len) {
|
|
4751
4752
|
len = 1 / Math.sqrt(len);
|
|
4752
4753
|
n1 = -dy * len * thickness;
|
|
4753
|
-
|
|
4754
|
+
n22 = dx * len * thickness;
|
|
4754
4755
|
}
|
|
4755
4756
|
var array = this.array;
|
|
4756
4757
|
array[startIndex++] = x1;
|
|
@@ -4758,7 +4759,7 @@ function createEdgeDoubleClampedProgram(inputOptions) {
|
|
|
4758
4759
|
array[startIndex++] = x2;
|
|
4759
4760
|
array[startIndex++] = y2;
|
|
4760
4761
|
array[startIndex++] = n1;
|
|
4761
|
-
array[startIndex++] =
|
|
4762
|
+
array[startIndex++] = n22;
|
|
4762
4763
|
array[startIndex++] = color;
|
|
4763
4764
|
array[startIndex++] = edgeIndex;
|
|
4764
4765
|
array[startIndex++] = sourceRadius;
|
|
@@ -4902,8 +4903,8 @@ function _objectSpread2(e2) {
|
|
|
4902
4903
|
}
|
|
4903
4904
|
return e2;
|
|
4904
4905
|
}
|
|
4905
|
-
function _classCallCheck(a,
|
|
4906
|
-
if (!(a instanceof
|
|
4906
|
+
function _classCallCheck(a, n3) {
|
|
4907
|
+
if (!(a instanceof n3)) throw new TypeError("Cannot call a class as a function");
|
|
4907
4908
|
}
|
|
4908
4909
|
function _defineProperties(e2, r) {
|
|
4909
4910
|
for (var t2 = 0; t2 < r.length; t2++) {
|
|
@@ -4962,8 +4963,8 @@ function _inherits(t2, e2) {
|
|
|
4962
4963
|
}
|
|
4963
4964
|
function _arrayLikeToArray(r, a) {
|
|
4964
4965
|
(null == a || a > r.length) && (a = r.length);
|
|
4965
|
-
for (var e2 = 0,
|
|
4966
|
-
return
|
|
4966
|
+
for (var e2 = 0, n3 = Array(a); e2 < a; e2++) n3[e2] = r[e2];
|
|
4967
|
+
return n3;
|
|
4967
4968
|
}
|
|
4968
4969
|
function _arrayWithoutHoles(r) {
|
|
4969
4970
|
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
@@ -5428,7 +5429,7 @@ function useGraphInstance({
|
|
|
5428
5429
|
nodes: serializedNodes,
|
|
5429
5430
|
edges: serializedEdges
|
|
5430
5431
|
});
|
|
5431
|
-
const nodeIds = allNodes.map((
|
|
5432
|
+
const nodeIds = allNodes.map((n3) => n3.id);
|
|
5432
5433
|
const simLinks = [];
|
|
5433
5434
|
for (const link of allLinks) {
|
|
5434
5435
|
if (link.label !== layoutConfig.layoutEdgeType) continue;
|
|
@@ -5578,9 +5579,9 @@ function useGraphVisuals(graph, layoutReady, visualState, layoutConfig, _degreeM
|
|
|
5578
5579
|
);
|
|
5579
5580
|
}, [graph, layoutReady, visualState, layoutConfig, isLargeGraph]);
|
|
5580
5581
|
}
|
|
5581
|
-
function c(r,
|
|
5582
|
-
const o = v(), [c2, u] = useState(false), [p, g] = useState(null), m = useRef(
|
|
5583
|
-
j(m.current,
|
|
5582
|
+
function c(r, n3) {
|
|
5583
|
+
const o = v(), [c2, u] = useState(false), [p, g] = useState(null), m = useRef(n3);
|
|
5584
|
+
j(m.current, n3) || (m.current = n3), useEffect((() => {
|
|
5584
5585
|
u(false);
|
|
5585
5586
|
let t2 = null;
|
|
5586
5587
|
return m.current && (t2 = new r(o.getGraph(), m.current)), g(t2), () => {
|
|
@@ -5628,32 +5629,32 @@ function requireIterate() {
|
|
|
5628
5629
|
var PPR = 9;
|
|
5629
5630
|
var MAX_FORCE = 10;
|
|
5630
5631
|
iterate = function iterate2(options, NodeMatrix, EdgeMatrix) {
|
|
5631
|
-
var l, r,
|
|
5632
|
+
var l, r, n3, n1, n22, rn, e2, w2, g, s2;
|
|
5632
5633
|
var order = NodeMatrix.length, size = EdgeMatrix.length;
|
|
5633
5634
|
var adjustSizes = options.adjustSizes;
|
|
5634
5635
|
var thetaSquared = options.barnesHutTheta * options.barnesHutTheta;
|
|
5635
5636
|
var outboundAttCompensation, coefficient, xDist, yDist, ewc, distance, factor;
|
|
5636
5637
|
var RegionMatrix = [];
|
|
5637
|
-
for (
|
|
5638
|
-
NodeMatrix[
|
|
5639
|
-
NodeMatrix[
|
|
5640
|
-
NodeMatrix[
|
|
5641
|
-
NodeMatrix[
|
|
5638
|
+
for (n3 = 0; n3 < order; n3 += PPN) {
|
|
5639
|
+
NodeMatrix[n3 + NODE_OLD_DX] = NodeMatrix[n3 + NODE_DX];
|
|
5640
|
+
NodeMatrix[n3 + NODE_OLD_DY] = NodeMatrix[n3 + NODE_DY];
|
|
5641
|
+
NodeMatrix[n3 + NODE_DX] = 0;
|
|
5642
|
+
NodeMatrix[n3 + NODE_DY] = 0;
|
|
5642
5643
|
}
|
|
5643
5644
|
if (options.outboundAttractionDistribution) {
|
|
5644
5645
|
outboundAttCompensation = 0;
|
|
5645
|
-
for (
|
|
5646
|
-
outboundAttCompensation += NodeMatrix[
|
|
5646
|
+
for (n3 = 0; n3 < order; n3 += PPN) {
|
|
5647
|
+
outboundAttCompensation += NodeMatrix[n3 + NODE_MASS];
|
|
5647
5648
|
}
|
|
5648
5649
|
outboundAttCompensation /= order / PPN;
|
|
5649
5650
|
}
|
|
5650
5651
|
if (options.barnesHutOptimize) {
|
|
5651
5652
|
var minX = Infinity, maxX = -Infinity, minY = Infinity, maxY = -Infinity, q2, q22, subdivisionAttempts;
|
|
5652
|
-
for (
|
|
5653
|
-
minX = Math.min(minX, NodeMatrix[
|
|
5654
|
-
maxX = Math.max(maxX, NodeMatrix[
|
|
5655
|
-
minY = Math.min(minY, NodeMatrix[
|
|
5656
|
-
maxY = Math.max(maxY, NodeMatrix[
|
|
5653
|
+
for (n3 = 0; n3 < order; n3 += PPN) {
|
|
5654
|
+
minX = Math.min(minX, NodeMatrix[n3 + NODE_X]);
|
|
5655
|
+
maxX = Math.max(maxX, NodeMatrix[n3 + NODE_X]);
|
|
5656
|
+
minY = Math.min(minY, NodeMatrix[n3 + NODE_Y]);
|
|
5657
|
+
maxY = Math.max(maxY, NodeMatrix[n3 + NODE_Y]);
|
|
5657
5658
|
}
|
|
5658
5659
|
var dx = maxX - minX, dy = maxY - minY;
|
|
5659
5660
|
if (dx > dy) {
|
|
@@ -5673,32 +5674,32 @@ function requireIterate() {
|
|
|
5673
5674
|
RegionMatrix[0 + REGION_MASS_CENTER_X] = 0;
|
|
5674
5675
|
RegionMatrix[0 + REGION_MASS_CENTER_Y] = 0;
|
|
5675
5676
|
l = 1;
|
|
5676
|
-
for (
|
|
5677
|
+
for (n3 = 0; n3 < order; n3 += PPN) {
|
|
5677
5678
|
r = 0;
|
|
5678
5679
|
subdivisionAttempts = SUBDIVISION_ATTEMPTS;
|
|
5679
5680
|
while (true) {
|
|
5680
5681
|
if (RegionMatrix[r + REGION_FIRST_CHILD] >= 0) {
|
|
5681
|
-
if (NodeMatrix[
|
|
5682
|
-
if (NodeMatrix[
|
|
5682
|
+
if (NodeMatrix[n3 + NODE_X] < RegionMatrix[r + REGION_CENTER_X]) {
|
|
5683
|
+
if (NodeMatrix[n3 + NODE_Y] < RegionMatrix[r + REGION_CENTER_Y]) {
|
|
5683
5684
|
q2 = RegionMatrix[r + REGION_FIRST_CHILD];
|
|
5684
5685
|
} else {
|
|
5685
5686
|
q2 = RegionMatrix[r + REGION_FIRST_CHILD] + PPR;
|
|
5686
5687
|
}
|
|
5687
5688
|
} else {
|
|
5688
|
-
if (NodeMatrix[
|
|
5689
|
+
if (NodeMatrix[n3 + NODE_Y] < RegionMatrix[r + REGION_CENTER_Y]) {
|
|
5689
5690
|
q2 = RegionMatrix[r + REGION_FIRST_CHILD] + PPR * 2;
|
|
5690
5691
|
} else {
|
|
5691
5692
|
q2 = RegionMatrix[r + REGION_FIRST_CHILD] + PPR * 3;
|
|
5692
5693
|
}
|
|
5693
5694
|
}
|
|
5694
|
-
RegionMatrix[r + REGION_MASS_CENTER_X] = (RegionMatrix[r + REGION_MASS_CENTER_X] * RegionMatrix[r + REGION_MASS] + NodeMatrix[
|
|
5695
|
-
RegionMatrix[r + REGION_MASS_CENTER_Y] = (RegionMatrix[r + REGION_MASS_CENTER_Y] * RegionMatrix[r + REGION_MASS] + NodeMatrix[
|
|
5696
|
-
RegionMatrix[r + REGION_MASS] += NodeMatrix[
|
|
5695
|
+
RegionMatrix[r + REGION_MASS_CENTER_X] = (RegionMatrix[r + REGION_MASS_CENTER_X] * RegionMatrix[r + REGION_MASS] + NodeMatrix[n3 + NODE_X] * NodeMatrix[n3 + NODE_MASS]) / (RegionMatrix[r + REGION_MASS] + NodeMatrix[n3 + NODE_MASS]);
|
|
5696
|
+
RegionMatrix[r + REGION_MASS_CENTER_Y] = (RegionMatrix[r + REGION_MASS_CENTER_Y] * RegionMatrix[r + REGION_MASS] + NodeMatrix[n3 + NODE_Y] * NodeMatrix[n3 + NODE_MASS]) / (RegionMatrix[r + REGION_MASS] + NodeMatrix[n3 + NODE_MASS]);
|
|
5697
|
+
RegionMatrix[r + REGION_MASS] += NodeMatrix[n3 + NODE_MASS];
|
|
5697
5698
|
r = q2;
|
|
5698
5699
|
continue;
|
|
5699
5700
|
} else {
|
|
5700
5701
|
if (RegionMatrix[r + REGION_NODE] < 0) {
|
|
5701
|
-
RegionMatrix[r + REGION_NODE] =
|
|
5702
|
+
RegionMatrix[r + REGION_NODE] = n3;
|
|
5702
5703
|
break;
|
|
5703
5704
|
} else {
|
|
5704
5705
|
RegionMatrix[r + REGION_FIRST_CHILD] = l * PPR;
|
|
@@ -5762,14 +5763,14 @@ function requireIterate() {
|
|
|
5762
5763
|
RegionMatrix[r + REGION_MASS_CENTER_Y] = NodeMatrix[RegionMatrix[r + REGION_NODE] + NODE_Y];
|
|
5763
5764
|
RegionMatrix[q2 + REGION_NODE] = RegionMatrix[r + REGION_NODE];
|
|
5764
5765
|
RegionMatrix[r + REGION_NODE] = -1;
|
|
5765
|
-
if (NodeMatrix[
|
|
5766
|
-
if (NodeMatrix[
|
|
5766
|
+
if (NodeMatrix[n3 + NODE_X] < RegionMatrix[r + REGION_CENTER_X]) {
|
|
5767
|
+
if (NodeMatrix[n3 + NODE_Y] < RegionMatrix[r + REGION_CENTER_Y]) {
|
|
5767
5768
|
q22 = RegionMatrix[r + REGION_FIRST_CHILD];
|
|
5768
5769
|
} else {
|
|
5769
5770
|
q22 = RegionMatrix[r + REGION_FIRST_CHILD] + PPR;
|
|
5770
5771
|
}
|
|
5771
5772
|
} else {
|
|
5772
|
-
if (NodeMatrix[
|
|
5773
|
+
if (NodeMatrix[n3 + NODE_Y] < RegionMatrix[r + REGION_CENTER_Y]) {
|
|
5773
5774
|
q22 = RegionMatrix[r + REGION_FIRST_CHILD] + PPR * 2;
|
|
5774
5775
|
} else {
|
|
5775
5776
|
q22 = RegionMatrix[r + REGION_FIRST_CHILD] + PPR * 3;
|
|
@@ -5784,7 +5785,7 @@ function requireIterate() {
|
|
|
5784
5785
|
break;
|
|
5785
5786
|
}
|
|
5786
5787
|
}
|
|
5787
|
-
RegionMatrix[q22 + REGION_NODE] =
|
|
5788
|
+
RegionMatrix[q22 + REGION_NODE] = n3;
|
|
5788
5789
|
break;
|
|
5789
5790
|
}
|
|
5790
5791
|
}
|
|
@@ -5793,36 +5794,36 @@ function requireIterate() {
|
|
|
5793
5794
|
}
|
|
5794
5795
|
if (options.barnesHutOptimize) {
|
|
5795
5796
|
coefficient = options.scalingRatio;
|
|
5796
|
-
for (
|
|
5797
|
+
for (n3 = 0; n3 < order; n3 += PPN) {
|
|
5797
5798
|
r = 0;
|
|
5798
5799
|
while (true) {
|
|
5799
5800
|
if (RegionMatrix[r + REGION_FIRST_CHILD] >= 0) {
|
|
5800
5801
|
distance = Math.pow(
|
|
5801
|
-
NodeMatrix[
|
|
5802
|
+
NodeMatrix[n3 + NODE_X] - RegionMatrix[r + REGION_MASS_CENTER_X],
|
|
5802
5803
|
2
|
|
5803
5804
|
) + Math.pow(
|
|
5804
|
-
NodeMatrix[
|
|
5805
|
+
NodeMatrix[n3 + NODE_Y] - RegionMatrix[r + REGION_MASS_CENTER_Y],
|
|
5805
5806
|
2
|
|
5806
5807
|
);
|
|
5807
5808
|
s2 = RegionMatrix[r + REGION_SIZE];
|
|
5808
5809
|
if (4 * s2 * s2 / distance < thetaSquared) {
|
|
5809
|
-
xDist = NodeMatrix[
|
|
5810
|
-
yDist = NodeMatrix[
|
|
5810
|
+
xDist = NodeMatrix[n3 + NODE_X] - RegionMatrix[r + REGION_MASS_CENTER_X];
|
|
5811
|
+
yDist = NodeMatrix[n3 + NODE_Y] - RegionMatrix[r + REGION_MASS_CENTER_Y];
|
|
5811
5812
|
if (adjustSizes === true) {
|
|
5812
5813
|
if (distance > 0) {
|
|
5813
|
-
factor = coefficient * NodeMatrix[
|
|
5814
|
-
NodeMatrix[
|
|
5815
|
-
NodeMatrix[
|
|
5814
|
+
factor = coefficient * NodeMatrix[n3 + NODE_MASS] * RegionMatrix[r + REGION_MASS] / distance;
|
|
5815
|
+
NodeMatrix[n3 + NODE_DX] += xDist * factor;
|
|
5816
|
+
NodeMatrix[n3 + NODE_DY] += yDist * factor;
|
|
5816
5817
|
} else if (distance < 0) {
|
|
5817
|
-
factor = -coefficient * NodeMatrix[
|
|
5818
|
-
NodeMatrix[
|
|
5819
|
-
NodeMatrix[
|
|
5818
|
+
factor = -coefficient * NodeMatrix[n3 + NODE_MASS] * RegionMatrix[r + REGION_MASS] / Math.sqrt(distance);
|
|
5819
|
+
NodeMatrix[n3 + NODE_DX] += xDist * factor;
|
|
5820
|
+
NodeMatrix[n3 + NODE_DY] += yDist * factor;
|
|
5820
5821
|
}
|
|
5821
5822
|
} else {
|
|
5822
5823
|
if (distance > 0) {
|
|
5823
|
-
factor = coefficient * NodeMatrix[
|
|
5824
|
-
NodeMatrix[
|
|
5825
|
-
NodeMatrix[
|
|
5824
|
+
factor = coefficient * NodeMatrix[n3 + NODE_MASS] * RegionMatrix[r + REGION_MASS] / distance;
|
|
5825
|
+
NodeMatrix[n3 + NODE_DX] += xDist * factor;
|
|
5826
|
+
NodeMatrix[n3 + NODE_DY] += yDist * factor;
|
|
5826
5827
|
}
|
|
5827
5828
|
}
|
|
5828
5829
|
r = RegionMatrix[r + REGION_NEXT_SIBLING];
|
|
@@ -5834,25 +5835,25 @@ function requireIterate() {
|
|
|
5834
5835
|
}
|
|
5835
5836
|
} else {
|
|
5836
5837
|
rn = RegionMatrix[r + REGION_NODE];
|
|
5837
|
-
if (rn >= 0 && rn !==
|
|
5838
|
-
xDist = NodeMatrix[
|
|
5839
|
-
yDist = NodeMatrix[
|
|
5838
|
+
if (rn >= 0 && rn !== n3) {
|
|
5839
|
+
xDist = NodeMatrix[n3 + NODE_X] - NodeMatrix[rn + NODE_X];
|
|
5840
|
+
yDist = NodeMatrix[n3 + NODE_Y] - NodeMatrix[rn + NODE_Y];
|
|
5840
5841
|
distance = xDist * xDist + yDist * yDist;
|
|
5841
5842
|
if (adjustSizes === true) {
|
|
5842
5843
|
if (distance > 0) {
|
|
5843
|
-
factor = coefficient * NodeMatrix[
|
|
5844
|
-
NodeMatrix[
|
|
5845
|
-
NodeMatrix[
|
|
5844
|
+
factor = coefficient * NodeMatrix[n3 + NODE_MASS] * NodeMatrix[rn + NODE_MASS] / distance;
|
|
5845
|
+
NodeMatrix[n3 + NODE_DX] += xDist * factor;
|
|
5846
|
+
NodeMatrix[n3 + NODE_DY] += yDist * factor;
|
|
5846
5847
|
} else if (distance < 0) {
|
|
5847
|
-
factor = -coefficient * NodeMatrix[
|
|
5848
|
-
NodeMatrix[
|
|
5849
|
-
NodeMatrix[
|
|
5848
|
+
factor = -coefficient * NodeMatrix[n3 + NODE_MASS] * NodeMatrix[rn + NODE_MASS] / Math.sqrt(distance);
|
|
5849
|
+
NodeMatrix[n3 + NODE_DX] += xDist * factor;
|
|
5850
|
+
NodeMatrix[n3 + NODE_DY] += yDist * factor;
|
|
5850
5851
|
}
|
|
5851
5852
|
} else {
|
|
5852
5853
|
if (distance > 0) {
|
|
5853
|
-
factor = coefficient * NodeMatrix[
|
|
5854
|
-
NodeMatrix[
|
|
5855
|
-
NodeMatrix[
|
|
5854
|
+
factor = coefficient * NodeMatrix[n3 + NODE_MASS] * NodeMatrix[rn + NODE_MASS] / distance;
|
|
5855
|
+
NodeMatrix[n3 + NODE_DX] += xDist * factor;
|
|
5856
|
+
NodeMatrix[n3 + NODE_DY] += yDist * factor;
|
|
5856
5857
|
}
|
|
5857
5858
|
}
|
|
5858
5859
|
}
|
|
@@ -5898,19 +5899,19 @@ function requireIterate() {
|
|
|
5898
5899
|
}
|
|
5899
5900
|
g = options.gravity / options.scalingRatio;
|
|
5900
5901
|
coefficient = options.scalingRatio;
|
|
5901
|
-
for (
|
|
5902
|
+
for (n3 = 0; n3 < order; n3 += PPN) {
|
|
5902
5903
|
factor = 0;
|
|
5903
|
-
xDist = NodeMatrix[
|
|
5904
|
-
yDist = NodeMatrix[
|
|
5904
|
+
xDist = NodeMatrix[n3 + NODE_X];
|
|
5905
|
+
yDist = NodeMatrix[n3 + NODE_Y];
|
|
5905
5906
|
distance = Math.sqrt(Math.pow(xDist, 2) + Math.pow(yDist, 2));
|
|
5906
5907
|
if (options.strongGravityMode) {
|
|
5907
|
-
if (distance > 0) factor = coefficient * NodeMatrix[
|
|
5908
|
+
if (distance > 0) factor = coefficient * NodeMatrix[n3 + NODE_MASS] * g;
|
|
5908
5909
|
} else {
|
|
5909
5910
|
if (distance > 0)
|
|
5910
|
-
factor = coefficient * NodeMatrix[
|
|
5911
|
+
factor = coefficient * NodeMatrix[n3 + NODE_MASS] * g / distance;
|
|
5911
5912
|
}
|
|
5912
|
-
NodeMatrix[
|
|
5913
|
-
NodeMatrix[
|
|
5913
|
+
NodeMatrix[n3 + NODE_DX] -= xDist * factor;
|
|
5914
|
+
NodeMatrix[n3 + NODE_DY] -= yDist * factor;
|
|
5914
5915
|
}
|
|
5915
5916
|
coefficient = 1 * (options.outboundAttractionDistribution ? outboundAttCompensation : 1);
|
|
5916
5917
|
for (e2 = 0; e2 < size; e2 += PPE) {
|
|
@@ -5973,48 +5974,48 @@ function requireIterate() {
|
|
|
5973
5974
|
}
|
|
5974
5975
|
var force, swinging, traction, nodespeed, newX, newY;
|
|
5975
5976
|
if (adjustSizes === true) {
|
|
5976
|
-
for (
|
|
5977
|
-
if (NodeMatrix[
|
|
5977
|
+
for (n3 = 0; n3 < order; n3 += PPN) {
|
|
5978
|
+
if (NodeMatrix[n3 + NODE_FIXED] !== 1) {
|
|
5978
5979
|
force = Math.sqrt(
|
|
5979
|
-
Math.pow(NodeMatrix[
|
|
5980
|
+
Math.pow(NodeMatrix[n3 + NODE_DX], 2) + Math.pow(NodeMatrix[n3 + NODE_DY], 2)
|
|
5980
5981
|
);
|
|
5981
5982
|
if (force > MAX_FORCE) {
|
|
5982
|
-
NodeMatrix[
|
|
5983
|
-
NodeMatrix[
|
|
5983
|
+
NodeMatrix[n3 + NODE_DX] = NodeMatrix[n3 + NODE_DX] * MAX_FORCE / force;
|
|
5984
|
+
NodeMatrix[n3 + NODE_DY] = NodeMatrix[n3 + NODE_DY] * MAX_FORCE / force;
|
|
5984
5985
|
}
|
|
5985
|
-
swinging = NodeMatrix[
|
|
5986
|
-
(NodeMatrix[
|
|
5986
|
+
swinging = NodeMatrix[n3 + NODE_MASS] * Math.sqrt(
|
|
5987
|
+
(NodeMatrix[n3 + NODE_OLD_DX] - NodeMatrix[n3 + NODE_DX]) * (NodeMatrix[n3 + NODE_OLD_DX] - NodeMatrix[n3 + NODE_DX]) + (NodeMatrix[n3 + NODE_OLD_DY] - NodeMatrix[n3 + NODE_DY]) * (NodeMatrix[n3 + NODE_OLD_DY] - NodeMatrix[n3 + NODE_DY])
|
|
5987
5988
|
);
|
|
5988
5989
|
traction = Math.sqrt(
|
|
5989
|
-
(NodeMatrix[
|
|
5990
|
+
(NodeMatrix[n3 + NODE_OLD_DX] + NodeMatrix[n3 + NODE_DX]) * (NodeMatrix[n3 + NODE_OLD_DX] + NodeMatrix[n3 + NODE_DX]) + (NodeMatrix[n3 + NODE_OLD_DY] + NodeMatrix[n3 + NODE_DY]) * (NodeMatrix[n3 + NODE_OLD_DY] + NodeMatrix[n3 + NODE_DY])
|
|
5990
5991
|
) / 2;
|
|
5991
5992
|
nodespeed = 0.1 * Math.log(1 + traction) / (1 + Math.sqrt(swinging));
|
|
5992
|
-
newX = NodeMatrix[
|
|
5993
|
-
NodeMatrix[
|
|
5994
|
-
newY = NodeMatrix[
|
|
5995
|
-
NodeMatrix[
|
|
5993
|
+
newX = NodeMatrix[n3 + NODE_X] + NodeMatrix[n3 + NODE_DX] * (nodespeed / options.slowDown);
|
|
5994
|
+
NodeMatrix[n3 + NODE_X] = newX;
|
|
5995
|
+
newY = NodeMatrix[n3 + NODE_Y] + NodeMatrix[n3 + NODE_DY] * (nodespeed / options.slowDown);
|
|
5996
|
+
NodeMatrix[n3 + NODE_Y] = newY;
|
|
5996
5997
|
}
|
|
5997
5998
|
}
|
|
5998
5999
|
} else {
|
|
5999
|
-
for (
|
|
6000
|
-
if (NodeMatrix[
|
|
6001
|
-
swinging = NodeMatrix[
|
|
6002
|
-
(NodeMatrix[
|
|
6000
|
+
for (n3 = 0; n3 < order; n3 += PPN) {
|
|
6001
|
+
if (NodeMatrix[n3 + NODE_FIXED] !== 1) {
|
|
6002
|
+
swinging = NodeMatrix[n3 + NODE_MASS] * Math.sqrt(
|
|
6003
|
+
(NodeMatrix[n3 + NODE_OLD_DX] - NodeMatrix[n3 + NODE_DX]) * (NodeMatrix[n3 + NODE_OLD_DX] - NodeMatrix[n3 + NODE_DX]) + (NodeMatrix[n3 + NODE_OLD_DY] - NodeMatrix[n3 + NODE_DY]) * (NodeMatrix[n3 + NODE_OLD_DY] - NodeMatrix[n3 + NODE_DY])
|
|
6003
6004
|
);
|
|
6004
6005
|
traction = Math.sqrt(
|
|
6005
|
-
(NodeMatrix[
|
|
6006
|
+
(NodeMatrix[n3 + NODE_OLD_DX] + NodeMatrix[n3 + NODE_DX]) * (NodeMatrix[n3 + NODE_OLD_DX] + NodeMatrix[n3 + NODE_DX]) + (NodeMatrix[n3 + NODE_OLD_DY] + NodeMatrix[n3 + NODE_DY]) * (NodeMatrix[n3 + NODE_OLD_DY] + NodeMatrix[n3 + NODE_DY])
|
|
6006
6007
|
) / 2;
|
|
6007
|
-
nodespeed = NodeMatrix[
|
|
6008
|
-
NodeMatrix[
|
|
6008
|
+
nodespeed = NodeMatrix[n3 + NODE_CONVERGENCE] * Math.log(1 + traction) / (1 + Math.sqrt(swinging));
|
|
6009
|
+
NodeMatrix[n3 + NODE_CONVERGENCE] = Math.min(
|
|
6009
6010
|
1,
|
|
6010
6011
|
Math.sqrt(
|
|
6011
|
-
nodespeed * (Math.pow(NodeMatrix[
|
|
6012
|
+
nodespeed * (Math.pow(NodeMatrix[n3 + NODE_DX], 2) + Math.pow(NodeMatrix[n3 + NODE_DY], 2)) / (1 + Math.sqrt(swinging))
|
|
6012
6013
|
)
|
|
6013
6014
|
);
|
|
6014
|
-
newX = NodeMatrix[
|
|
6015
|
-
NodeMatrix[
|
|
6016
|
-
newY = NodeMatrix[
|
|
6017
|
-
NodeMatrix[
|
|
6015
|
+
newX = NodeMatrix[n3 + NODE_X] + NodeMatrix[n3 + NODE_DX] * (nodespeed / options.slowDown);
|
|
6016
|
+
NodeMatrix[n3 + NODE_X] = newX;
|
|
6017
|
+
newY = NodeMatrix[n3 + NODE_Y] + NodeMatrix[n3 + NODE_DY] * (nodespeed / options.slowDown);
|
|
6018
|
+
NodeMatrix[n3 + NODE_Y] = newY;
|
|
6018
6019
|
}
|
|
6019
6020
|
}
|
|
6020
6021
|
}
|
|
@@ -6273,32 +6274,32 @@ function requireWebworker() {
|
|
|
6273
6274
|
var PPR = 9;
|
|
6274
6275
|
var MAX_FORCE = 10;
|
|
6275
6276
|
moduleShim.exports = function iterate3(options, NodeMatrix, EdgeMatrix) {
|
|
6276
|
-
var l, r,
|
|
6277
|
+
var l, r, n3, n1, n22, rn, e2, w2, g, s2;
|
|
6277
6278
|
var order = NodeMatrix.length, size = EdgeMatrix.length;
|
|
6278
6279
|
var adjustSizes = options.adjustSizes;
|
|
6279
6280
|
var thetaSquared = options.barnesHutTheta * options.barnesHutTheta;
|
|
6280
6281
|
var outboundAttCompensation, coefficient, xDist, yDist, ewc, distance, factor;
|
|
6281
6282
|
var RegionMatrix = [];
|
|
6282
|
-
for (
|
|
6283
|
-
NodeMatrix[
|
|
6284
|
-
NodeMatrix[
|
|
6285
|
-
NodeMatrix[
|
|
6286
|
-
NodeMatrix[
|
|
6283
|
+
for (n3 = 0; n3 < order; n3 += PPN) {
|
|
6284
|
+
NodeMatrix[n3 + NODE_OLD_DX] = NodeMatrix[n3 + NODE_DX];
|
|
6285
|
+
NodeMatrix[n3 + NODE_OLD_DY] = NodeMatrix[n3 + NODE_DY];
|
|
6286
|
+
NodeMatrix[n3 + NODE_DX] = 0;
|
|
6287
|
+
NodeMatrix[n3 + NODE_DY] = 0;
|
|
6287
6288
|
}
|
|
6288
6289
|
if (options.outboundAttractionDistribution) {
|
|
6289
6290
|
outboundAttCompensation = 0;
|
|
6290
|
-
for (
|
|
6291
|
-
outboundAttCompensation += NodeMatrix[
|
|
6291
|
+
for (n3 = 0; n3 < order; n3 += PPN) {
|
|
6292
|
+
outboundAttCompensation += NodeMatrix[n3 + NODE_MASS];
|
|
6292
6293
|
}
|
|
6293
6294
|
outboundAttCompensation /= order / PPN;
|
|
6294
6295
|
}
|
|
6295
6296
|
if (options.barnesHutOptimize) {
|
|
6296
6297
|
var minX = Infinity, maxX = -Infinity, minY = Infinity, maxY = -Infinity, q2, q22, subdivisionAttempts;
|
|
6297
|
-
for (
|
|
6298
|
-
minX = Math.min(minX, NodeMatrix[
|
|
6299
|
-
maxX = Math.max(maxX, NodeMatrix[
|
|
6300
|
-
minY = Math.min(minY, NodeMatrix[
|
|
6301
|
-
maxY = Math.max(maxY, NodeMatrix[
|
|
6298
|
+
for (n3 = 0; n3 < order; n3 += PPN) {
|
|
6299
|
+
minX = Math.min(minX, NodeMatrix[n3 + NODE_X]);
|
|
6300
|
+
maxX = Math.max(maxX, NodeMatrix[n3 + NODE_X]);
|
|
6301
|
+
minY = Math.min(minY, NodeMatrix[n3 + NODE_Y]);
|
|
6302
|
+
maxY = Math.max(maxY, NodeMatrix[n3 + NODE_Y]);
|
|
6302
6303
|
}
|
|
6303
6304
|
var dx = maxX - minX, dy = maxY - minY;
|
|
6304
6305
|
if (dx > dy) {
|
|
@@ -6318,32 +6319,32 @@ function requireWebworker() {
|
|
|
6318
6319
|
RegionMatrix[0 + REGION_MASS_CENTER_X] = 0;
|
|
6319
6320
|
RegionMatrix[0 + REGION_MASS_CENTER_Y] = 0;
|
|
6320
6321
|
l = 1;
|
|
6321
|
-
for (
|
|
6322
|
+
for (n3 = 0; n3 < order; n3 += PPN) {
|
|
6322
6323
|
r = 0;
|
|
6323
6324
|
subdivisionAttempts = SUBDIVISION_ATTEMPTS;
|
|
6324
6325
|
while (true) {
|
|
6325
6326
|
if (RegionMatrix[r + REGION_FIRST_CHILD] >= 0) {
|
|
6326
|
-
if (NodeMatrix[
|
|
6327
|
-
if (NodeMatrix[
|
|
6327
|
+
if (NodeMatrix[n3 + NODE_X] < RegionMatrix[r + REGION_CENTER_X]) {
|
|
6328
|
+
if (NodeMatrix[n3 + NODE_Y] < RegionMatrix[r + REGION_CENTER_Y]) {
|
|
6328
6329
|
q2 = RegionMatrix[r + REGION_FIRST_CHILD];
|
|
6329
6330
|
} else {
|
|
6330
6331
|
q2 = RegionMatrix[r + REGION_FIRST_CHILD] + PPR;
|
|
6331
6332
|
}
|
|
6332
6333
|
} else {
|
|
6333
|
-
if (NodeMatrix[
|
|
6334
|
+
if (NodeMatrix[n3 + NODE_Y] < RegionMatrix[r + REGION_CENTER_Y]) {
|
|
6334
6335
|
q2 = RegionMatrix[r + REGION_FIRST_CHILD] + PPR * 2;
|
|
6335
6336
|
} else {
|
|
6336
6337
|
q2 = RegionMatrix[r + REGION_FIRST_CHILD] + PPR * 3;
|
|
6337
6338
|
}
|
|
6338
6339
|
}
|
|
6339
|
-
RegionMatrix[r + REGION_MASS_CENTER_X] = (RegionMatrix[r + REGION_MASS_CENTER_X] * RegionMatrix[r + REGION_MASS] + NodeMatrix[
|
|
6340
|
-
RegionMatrix[r + REGION_MASS_CENTER_Y] = (RegionMatrix[r + REGION_MASS_CENTER_Y] * RegionMatrix[r + REGION_MASS] + NodeMatrix[
|
|
6341
|
-
RegionMatrix[r + REGION_MASS] += NodeMatrix[
|
|
6340
|
+
RegionMatrix[r + REGION_MASS_CENTER_X] = (RegionMatrix[r + REGION_MASS_CENTER_X] * RegionMatrix[r + REGION_MASS] + NodeMatrix[n3 + NODE_X] * NodeMatrix[n3 + NODE_MASS]) / (RegionMatrix[r + REGION_MASS] + NodeMatrix[n3 + NODE_MASS]);
|
|
6341
|
+
RegionMatrix[r + REGION_MASS_CENTER_Y] = (RegionMatrix[r + REGION_MASS_CENTER_Y] * RegionMatrix[r + REGION_MASS] + NodeMatrix[n3 + NODE_Y] * NodeMatrix[n3 + NODE_MASS]) / (RegionMatrix[r + REGION_MASS] + NodeMatrix[n3 + NODE_MASS]);
|
|
6342
|
+
RegionMatrix[r + REGION_MASS] += NodeMatrix[n3 + NODE_MASS];
|
|
6342
6343
|
r = q2;
|
|
6343
6344
|
continue;
|
|
6344
6345
|
} else {
|
|
6345
6346
|
if (RegionMatrix[r + REGION_NODE] < 0) {
|
|
6346
|
-
RegionMatrix[r + REGION_NODE] =
|
|
6347
|
+
RegionMatrix[r + REGION_NODE] = n3;
|
|
6347
6348
|
break;
|
|
6348
6349
|
} else {
|
|
6349
6350
|
RegionMatrix[r + REGION_FIRST_CHILD] = l * PPR;
|
|
@@ -6407,14 +6408,14 @@ function requireWebworker() {
|
|
|
6407
6408
|
RegionMatrix[r + REGION_MASS_CENTER_Y] = NodeMatrix[RegionMatrix[r + REGION_NODE] + NODE_Y];
|
|
6408
6409
|
RegionMatrix[q2 + REGION_NODE] = RegionMatrix[r + REGION_NODE];
|
|
6409
6410
|
RegionMatrix[r + REGION_NODE] = -1;
|
|
6410
|
-
if (NodeMatrix[
|
|
6411
|
-
if (NodeMatrix[
|
|
6411
|
+
if (NodeMatrix[n3 + NODE_X] < RegionMatrix[r + REGION_CENTER_X]) {
|
|
6412
|
+
if (NodeMatrix[n3 + NODE_Y] < RegionMatrix[r + REGION_CENTER_Y]) {
|
|
6412
6413
|
q22 = RegionMatrix[r + REGION_FIRST_CHILD];
|
|
6413
6414
|
} else {
|
|
6414
6415
|
q22 = RegionMatrix[r + REGION_FIRST_CHILD] + PPR;
|
|
6415
6416
|
}
|
|
6416
6417
|
} else {
|
|
6417
|
-
if (NodeMatrix[
|
|
6418
|
+
if (NodeMatrix[n3 + NODE_Y] < RegionMatrix[r + REGION_CENTER_Y]) {
|
|
6418
6419
|
q22 = RegionMatrix[r + REGION_FIRST_CHILD] + PPR * 2;
|
|
6419
6420
|
} else {
|
|
6420
6421
|
q22 = RegionMatrix[r + REGION_FIRST_CHILD] + PPR * 3;
|
|
@@ -6429,7 +6430,7 @@ function requireWebworker() {
|
|
|
6429
6430
|
break;
|
|
6430
6431
|
}
|
|
6431
6432
|
}
|
|
6432
|
-
RegionMatrix[q22 + REGION_NODE] =
|
|
6433
|
+
RegionMatrix[q22 + REGION_NODE] = n3;
|
|
6433
6434
|
break;
|
|
6434
6435
|
}
|
|
6435
6436
|
}
|
|
@@ -6438,36 +6439,36 @@ function requireWebworker() {
|
|
|
6438
6439
|
}
|
|
6439
6440
|
if (options.barnesHutOptimize) {
|
|
6440
6441
|
coefficient = options.scalingRatio;
|
|
6441
|
-
for (
|
|
6442
|
+
for (n3 = 0; n3 < order; n3 += PPN) {
|
|
6442
6443
|
r = 0;
|
|
6443
6444
|
while (true) {
|
|
6444
6445
|
if (RegionMatrix[r + REGION_FIRST_CHILD] >= 0) {
|
|
6445
6446
|
distance = Math.pow(
|
|
6446
|
-
NodeMatrix[
|
|
6447
|
+
NodeMatrix[n3 + NODE_X] - RegionMatrix[r + REGION_MASS_CENTER_X],
|
|
6447
6448
|
2
|
|
6448
6449
|
) + Math.pow(
|
|
6449
|
-
NodeMatrix[
|
|
6450
|
+
NodeMatrix[n3 + NODE_Y] - RegionMatrix[r + REGION_MASS_CENTER_Y],
|
|
6450
6451
|
2
|
|
6451
6452
|
);
|
|
6452
6453
|
s2 = RegionMatrix[r + REGION_SIZE];
|
|
6453
6454
|
if (4 * s2 * s2 / distance < thetaSquared) {
|
|
6454
|
-
xDist = NodeMatrix[
|
|
6455
|
-
yDist = NodeMatrix[
|
|
6455
|
+
xDist = NodeMatrix[n3 + NODE_X] - RegionMatrix[r + REGION_MASS_CENTER_X];
|
|
6456
|
+
yDist = NodeMatrix[n3 + NODE_Y] - RegionMatrix[r + REGION_MASS_CENTER_Y];
|
|
6456
6457
|
if (adjustSizes === true) {
|
|
6457
6458
|
if (distance > 0) {
|
|
6458
|
-
factor = coefficient * NodeMatrix[
|
|
6459
|
-
NodeMatrix[
|
|
6460
|
-
NodeMatrix[
|
|
6459
|
+
factor = coefficient * NodeMatrix[n3 + NODE_MASS] * RegionMatrix[r + REGION_MASS] / distance;
|
|
6460
|
+
NodeMatrix[n3 + NODE_DX] += xDist * factor;
|
|
6461
|
+
NodeMatrix[n3 + NODE_DY] += yDist * factor;
|
|
6461
6462
|
} else if (distance < 0) {
|
|
6462
|
-
factor = -coefficient * NodeMatrix[
|
|
6463
|
-
NodeMatrix[
|
|
6464
|
-
NodeMatrix[
|
|
6463
|
+
factor = -coefficient * NodeMatrix[n3 + NODE_MASS] * RegionMatrix[r + REGION_MASS] / Math.sqrt(distance);
|
|
6464
|
+
NodeMatrix[n3 + NODE_DX] += xDist * factor;
|
|
6465
|
+
NodeMatrix[n3 + NODE_DY] += yDist * factor;
|
|
6465
6466
|
}
|
|
6466
6467
|
} else {
|
|
6467
6468
|
if (distance > 0) {
|
|
6468
|
-
factor = coefficient * NodeMatrix[
|
|
6469
|
-
NodeMatrix[
|
|
6470
|
-
NodeMatrix[
|
|
6469
|
+
factor = coefficient * NodeMatrix[n3 + NODE_MASS] * RegionMatrix[r + REGION_MASS] / distance;
|
|
6470
|
+
NodeMatrix[n3 + NODE_DX] += xDist * factor;
|
|
6471
|
+
NodeMatrix[n3 + NODE_DY] += yDist * factor;
|
|
6471
6472
|
}
|
|
6472
6473
|
}
|
|
6473
6474
|
r = RegionMatrix[r + REGION_NEXT_SIBLING];
|
|
@@ -6479,25 +6480,25 @@ function requireWebworker() {
|
|
|
6479
6480
|
}
|
|
6480
6481
|
} else {
|
|
6481
6482
|
rn = RegionMatrix[r + REGION_NODE];
|
|
6482
|
-
if (rn >= 0 && rn !==
|
|
6483
|
-
xDist = NodeMatrix[
|
|
6484
|
-
yDist = NodeMatrix[
|
|
6483
|
+
if (rn >= 0 && rn !== n3) {
|
|
6484
|
+
xDist = NodeMatrix[n3 + NODE_X] - NodeMatrix[rn + NODE_X];
|
|
6485
|
+
yDist = NodeMatrix[n3 + NODE_Y] - NodeMatrix[rn + NODE_Y];
|
|
6485
6486
|
distance = xDist * xDist + yDist * yDist;
|
|
6486
6487
|
if (adjustSizes === true) {
|
|
6487
6488
|
if (distance > 0) {
|
|
6488
|
-
factor = coefficient * NodeMatrix[
|
|
6489
|
-
NodeMatrix[
|
|
6490
|
-
NodeMatrix[
|
|
6489
|
+
factor = coefficient * NodeMatrix[n3 + NODE_MASS] * NodeMatrix[rn + NODE_MASS] / distance;
|
|
6490
|
+
NodeMatrix[n3 + NODE_DX] += xDist * factor;
|
|
6491
|
+
NodeMatrix[n3 + NODE_DY] += yDist * factor;
|
|
6491
6492
|
} else if (distance < 0) {
|
|
6492
|
-
factor = -coefficient * NodeMatrix[
|
|
6493
|
-
NodeMatrix[
|
|
6494
|
-
NodeMatrix[
|
|
6493
|
+
factor = -coefficient * NodeMatrix[n3 + NODE_MASS] * NodeMatrix[rn + NODE_MASS] / Math.sqrt(distance);
|
|
6494
|
+
NodeMatrix[n3 + NODE_DX] += xDist * factor;
|
|
6495
|
+
NodeMatrix[n3 + NODE_DY] += yDist * factor;
|
|
6495
6496
|
}
|
|
6496
6497
|
} else {
|
|
6497
6498
|
if (distance > 0) {
|
|
6498
|
-
factor = coefficient * NodeMatrix[
|
|
6499
|
-
NodeMatrix[
|
|
6500
|
-
NodeMatrix[
|
|
6499
|
+
factor = coefficient * NodeMatrix[n3 + NODE_MASS] * NodeMatrix[rn + NODE_MASS] / distance;
|
|
6500
|
+
NodeMatrix[n3 + NODE_DX] += xDist * factor;
|
|
6501
|
+
NodeMatrix[n3 + NODE_DY] += yDist * factor;
|
|
6501
6502
|
}
|
|
6502
6503
|
}
|
|
6503
6504
|
}
|
|
@@ -6543,19 +6544,19 @@ function requireWebworker() {
|
|
|
6543
6544
|
}
|
|
6544
6545
|
g = options.gravity / options.scalingRatio;
|
|
6545
6546
|
coefficient = options.scalingRatio;
|
|
6546
|
-
for (
|
|
6547
|
+
for (n3 = 0; n3 < order; n3 += PPN) {
|
|
6547
6548
|
factor = 0;
|
|
6548
|
-
xDist = NodeMatrix[
|
|
6549
|
-
yDist = NodeMatrix[
|
|
6549
|
+
xDist = NodeMatrix[n3 + NODE_X];
|
|
6550
|
+
yDist = NodeMatrix[n3 + NODE_Y];
|
|
6550
6551
|
distance = Math.sqrt(Math.pow(xDist, 2) + Math.pow(yDist, 2));
|
|
6551
6552
|
if (options.strongGravityMode) {
|
|
6552
|
-
if (distance > 0) factor = coefficient * NodeMatrix[
|
|
6553
|
+
if (distance > 0) factor = coefficient * NodeMatrix[n3 + NODE_MASS] * g;
|
|
6553
6554
|
} else {
|
|
6554
6555
|
if (distance > 0)
|
|
6555
|
-
factor = coefficient * NodeMatrix[
|
|
6556
|
+
factor = coefficient * NodeMatrix[n3 + NODE_MASS] * g / distance;
|
|
6556
6557
|
}
|
|
6557
|
-
NodeMatrix[
|
|
6558
|
-
NodeMatrix[
|
|
6558
|
+
NodeMatrix[n3 + NODE_DX] -= xDist * factor;
|
|
6559
|
+
NodeMatrix[n3 + NODE_DY] -= yDist * factor;
|
|
6559
6560
|
}
|
|
6560
6561
|
coefficient = 1 * (options.outboundAttractionDistribution ? outboundAttCompensation : 1);
|
|
6561
6562
|
for (e2 = 0; e2 < size; e2 += PPE) {
|
|
@@ -6618,48 +6619,48 @@ function requireWebworker() {
|
|
|
6618
6619
|
}
|
|
6619
6620
|
var force, swinging, traction, nodespeed, newX, newY;
|
|
6620
6621
|
if (adjustSizes === true) {
|
|
6621
|
-
for (
|
|
6622
|
-
if (NodeMatrix[
|
|
6622
|
+
for (n3 = 0; n3 < order; n3 += PPN) {
|
|
6623
|
+
if (NodeMatrix[n3 + NODE_FIXED] !== 1) {
|
|
6623
6624
|
force = Math.sqrt(
|
|
6624
|
-
Math.pow(NodeMatrix[
|
|
6625
|
+
Math.pow(NodeMatrix[n3 + NODE_DX], 2) + Math.pow(NodeMatrix[n3 + NODE_DY], 2)
|
|
6625
6626
|
);
|
|
6626
6627
|
if (force > MAX_FORCE) {
|
|
6627
|
-
NodeMatrix[
|
|
6628
|
-
NodeMatrix[
|
|
6628
|
+
NodeMatrix[n3 + NODE_DX] = NodeMatrix[n3 + NODE_DX] * MAX_FORCE / force;
|
|
6629
|
+
NodeMatrix[n3 + NODE_DY] = NodeMatrix[n3 + NODE_DY] * MAX_FORCE / force;
|
|
6629
6630
|
}
|
|
6630
|
-
swinging = NodeMatrix[
|
|
6631
|
-
(NodeMatrix[
|
|
6631
|
+
swinging = NodeMatrix[n3 + NODE_MASS] * Math.sqrt(
|
|
6632
|
+
(NodeMatrix[n3 + NODE_OLD_DX] - NodeMatrix[n3 + NODE_DX]) * (NodeMatrix[n3 + NODE_OLD_DX] - NodeMatrix[n3 + NODE_DX]) + (NodeMatrix[n3 + NODE_OLD_DY] - NodeMatrix[n3 + NODE_DY]) * (NodeMatrix[n3 + NODE_OLD_DY] - NodeMatrix[n3 + NODE_DY])
|
|
6632
6633
|
);
|
|
6633
6634
|
traction = Math.sqrt(
|
|
6634
|
-
(NodeMatrix[
|
|
6635
|
+
(NodeMatrix[n3 + NODE_OLD_DX] + NodeMatrix[n3 + NODE_DX]) * (NodeMatrix[n3 + NODE_OLD_DX] + NodeMatrix[n3 + NODE_DX]) + (NodeMatrix[n3 + NODE_OLD_DY] + NodeMatrix[n3 + NODE_DY]) * (NodeMatrix[n3 + NODE_OLD_DY] + NodeMatrix[n3 + NODE_DY])
|
|
6635
6636
|
) / 2;
|
|
6636
6637
|
nodespeed = 0.1 * Math.log(1 + traction) / (1 + Math.sqrt(swinging));
|
|
6637
|
-
newX = NodeMatrix[
|
|
6638
|
-
NodeMatrix[
|
|
6639
|
-
newY = NodeMatrix[
|
|
6640
|
-
NodeMatrix[
|
|
6638
|
+
newX = NodeMatrix[n3 + NODE_X] + NodeMatrix[n3 + NODE_DX] * (nodespeed / options.slowDown);
|
|
6639
|
+
NodeMatrix[n3 + NODE_X] = newX;
|
|
6640
|
+
newY = NodeMatrix[n3 + NODE_Y] + NodeMatrix[n3 + NODE_DY] * (nodespeed / options.slowDown);
|
|
6641
|
+
NodeMatrix[n3 + NODE_Y] = newY;
|
|
6641
6642
|
}
|
|
6642
6643
|
}
|
|
6643
6644
|
} else {
|
|
6644
|
-
for (
|
|
6645
|
-
if (NodeMatrix[
|
|
6646
|
-
swinging = NodeMatrix[
|
|
6647
|
-
(NodeMatrix[
|
|
6645
|
+
for (n3 = 0; n3 < order; n3 += PPN) {
|
|
6646
|
+
if (NodeMatrix[n3 + NODE_FIXED] !== 1) {
|
|
6647
|
+
swinging = NodeMatrix[n3 + NODE_MASS] * Math.sqrt(
|
|
6648
|
+
(NodeMatrix[n3 + NODE_OLD_DX] - NodeMatrix[n3 + NODE_DX]) * (NodeMatrix[n3 + NODE_OLD_DX] - NodeMatrix[n3 + NODE_DX]) + (NodeMatrix[n3 + NODE_OLD_DY] - NodeMatrix[n3 + NODE_DY]) * (NodeMatrix[n3 + NODE_OLD_DY] - NodeMatrix[n3 + NODE_DY])
|
|
6648
6649
|
);
|
|
6649
6650
|
traction = Math.sqrt(
|
|
6650
|
-
(NodeMatrix[
|
|
6651
|
+
(NodeMatrix[n3 + NODE_OLD_DX] + NodeMatrix[n3 + NODE_DX]) * (NodeMatrix[n3 + NODE_OLD_DX] + NodeMatrix[n3 + NODE_DX]) + (NodeMatrix[n3 + NODE_OLD_DY] + NodeMatrix[n3 + NODE_DY]) * (NodeMatrix[n3 + NODE_OLD_DY] + NodeMatrix[n3 + NODE_DY])
|
|
6651
6652
|
) / 2;
|
|
6652
|
-
nodespeed = NodeMatrix[
|
|
6653
|
-
NodeMatrix[
|
|
6653
|
+
nodespeed = NodeMatrix[n3 + NODE_CONVERGENCE] * Math.log(1 + traction) / (1 + Math.sqrt(swinging));
|
|
6654
|
+
NodeMatrix[n3 + NODE_CONVERGENCE] = Math.min(
|
|
6654
6655
|
1,
|
|
6655
6656
|
Math.sqrt(
|
|
6656
|
-
nodespeed * (Math.pow(NodeMatrix[
|
|
6657
|
+
nodespeed * (Math.pow(NodeMatrix[n3 + NODE_DX], 2) + Math.pow(NodeMatrix[n3 + NODE_DY], 2)) / (1 + Math.sqrt(swinging))
|
|
6657
6658
|
)
|
|
6658
6659
|
);
|
|
6659
|
-
newX = NodeMatrix[
|
|
6660
|
-
NodeMatrix[
|
|
6661
|
-
newY = NodeMatrix[
|
|
6662
|
-
NodeMatrix[
|
|
6660
|
+
newX = NodeMatrix[n3 + NODE_X] + NodeMatrix[n3 + NODE_DX] * (nodespeed / options.slowDown);
|
|
6661
|
+
NodeMatrix[n3 + NODE_X] = newX;
|
|
6662
|
+
newY = NodeMatrix[n3 + NODE_Y] + NodeMatrix[n3 + NODE_DY] * (nodespeed / options.slowDown);
|
|
6663
|
+
NodeMatrix[n3 + NODE_Y] = newY;
|
|
6663
6664
|
}
|
|
6664
6665
|
}
|
|
6665
6666
|
}
|
|
@@ -6797,7 +6798,7 @@ function requireWorker() {
|
|
|
6797
6798
|
}
|
|
6798
6799
|
var workerExports = requireWorker();
|
|
6799
6800
|
const e = /* @__PURE__ */ getDefaultExportFromCjs(workerExports);
|
|
6800
|
-
function
|
|
6801
|
+
function n2(t2 = {}) {
|
|
6801
6802
|
return c(e, t2);
|
|
6802
6803
|
}
|
|
6803
6804
|
function zoomToNodes(sigma, nodeIds, duration = 600, padding = 0.2) {
|
|
@@ -6857,7 +6858,7 @@ function LayoutPipeline({
|
|
|
6857
6858
|
const timerRef = useRef(null);
|
|
6858
6859
|
const spacingWorkerRef = useRef(null);
|
|
6859
6860
|
const perCommunityNoverlapCancel = useRef(null);
|
|
6860
|
-
const { start, stop } =
|
|
6861
|
+
const { start, stop } = n2({
|
|
6861
6862
|
settings: {
|
|
6862
6863
|
gravity: layoutConfig.fa2Gravity,
|
|
6863
6864
|
scalingRatio: layoutConfig.fa2ScalingRatio,
|
|
@@ -7481,7 +7482,7 @@ const GraphCanvas = memo(
|
|
|
7481
7482
|
ref,
|
|
7482
7483
|
() => ({
|
|
7483
7484
|
selectNode: (nodeId, nodeHops) => {
|
|
7484
|
-
const node = nodes.find((
|
|
7485
|
+
const node = nodes.find((n3) => n3.id === nodeId);
|
|
7485
7486
|
if (node) {
|
|
7486
7487
|
onNodeClick?.(node);
|
|
7487
7488
|
if (sigmaRef.current) {
|
|
@@ -7497,7 +7498,7 @@ const GraphCanvas = memo(
|
|
|
7497
7498
|
adj.get(s2).push(t2);
|
|
7498
7499
|
adj.get(t2).push(s2);
|
|
7499
7500
|
}
|
|
7500
|
-
for (let
|
|
7501
|
+
for (let d3 = 0; d3 < h2 && frontier.size > 0; d3++) {
|
|
7501
7502
|
const next = /* @__PURE__ */ new Set();
|
|
7502
7503
|
frontier.forEach((id) => {
|
|
7503
7504
|
adj.get(id)?.forEach((nb) => {
|
|
@@ -7796,7 +7797,7 @@ function GraphBadge({
|
|
|
7796
7797
|
totalNodes,
|
|
7797
7798
|
")"
|
|
7798
7799
|
] }),
|
|
7799
|
-
/* @__PURE__ */ jsx("span", { children: "nodes" }),
|
|
7800
|
+
/* @__PURE__ */ jsx("span", { className: "graph-badge-label", children: "nodes" }),
|
|
7800
7801
|
/* @__PURE__ */ jsx("span", { className: "graph-badge-sep", children: "·" }),
|
|
7801
7802
|
/* @__PURE__ */ jsx("span", { className: "graph-badge-rendered", children: edgeCount }),
|
|
7802
7803
|
totalEdges != null && /* @__PURE__ */ jsxs("span", { className: "graph-badge-total", children: [
|
|
@@ -7804,7 +7805,7 @@ function GraphBadge({
|
|
|
7804
7805
|
totalEdges,
|
|
7805
7806
|
")"
|
|
7806
7807
|
] }),
|
|
7807
|
-
/* @__PURE__ */ jsx("span", { children: "edges" })
|
|
7808
|
+
/* @__PURE__ */ jsx("span", { className: "graph-badge-label", children: "edges" })
|
|
7808
7809
|
] });
|
|
7809
7810
|
}
|
|
7810
7811
|
const DEFAULT_MAX_VISIBLE = 5;
|
|
@@ -7874,6 +7875,198 @@ function GraphLegend({
|
|
|
7874
7875
|
] })
|
|
7875
7876
|
] });
|
|
7876
7877
|
}
|
|
7878
|
+
function GraphToolbar({
|
|
7879
|
+
logo,
|
|
7880
|
+
searchQuery,
|
|
7881
|
+
onSearchQueryChange,
|
|
7882
|
+
onSearch,
|
|
7883
|
+
onReset,
|
|
7884
|
+
searchDisabled,
|
|
7885
|
+
showResetButton,
|
|
7886
|
+
hops,
|
|
7887
|
+
onHopsChange,
|
|
7888
|
+
maxHops = 5,
|
|
7889
|
+
nodeCount,
|
|
7890
|
+
edgeCount,
|
|
7891
|
+
totalNodes,
|
|
7892
|
+
totalEdges,
|
|
7893
|
+
mobilePanelTabs,
|
|
7894
|
+
onMobilePanelTab,
|
|
7895
|
+
actions,
|
|
7896
|
+
persistentActions,
|
|
7897
|
+
className
|
|
7898
|
+
}) {
|
|
7899
|
+
const [menuOpen, setMenuOpen] = useState(false);
|
|
7900
|
+
const navRef = useRef(null);
|
|
7901
|
+
const burgerRef = useRef(null);
|
|
7902
|
+
useEffect(() => {
|
|
7903
|
+
if (!menuOpen) return;
|
|
7904
|
+
const onClickOutside = (e2) => {
|
|
7905
|
+
if (navRef.current?.contains(e2.target)) return;
|
|
7906
|
+
if (burgerRef.current?.contains(e2.target)) return;
|
|
7907
|
+
setMenuOpen(false);
|
|
7908
|
+
};
|
|
7909
|
+
const onEscape = (e2) => {
|
|
7910
|
+
if (e2.key === "Escape") setMenuOpen(false);
|
|
7911
|
+
};
|
|
7912
|
+
document.addEventListener("mousedown", onClickOutside);
|
|
7913
|
+
document.addEventListener("keydown", onEscape);
|
|
7914
|
+
return () => {
|
|
7915
|
+
document.removeEventListener("mousedown", onClickOutside);
|
|
7916
|
+
document.removeEventListener("keydown", onEscape);
|
|
7917
|
+
};
|
|
7918
|
+
}, [menuOpen]);
|
|
7919
|
+
const handleNavClick = useCallback((e2) => {
|
|
7920
|
+
const target = e2.target;
|
|
7921
|
+
const clickable = target.closest("button, a");
|
|
7922
|
+
if (clickable && !clickable.classList.contains("ot-clear-search") && !clickable.classList.contains("ot-search-btn")) {
|
|
7923
|
+
setMenuOpen(false);
|
|
7924
|
+
}
|
|
7925
|
+
}, []);
|
|
7926
|
+
const visibleTabs = mobilePanelTabs?.filter((t2) => t2.visible !== false);
|
|
7927
|
+
const searchMarkup = (id) => /* @__PURE__ */ jsxs("div", { className: "ot-search-container", children: [
|
|
7928
|
+
/* @__PURE__ */ jsx(
|
|
7929
|
+
"input",
|
|
7930
|
+
{
|
|
7931
|
+
type: "text",
|
|
7932
|
+
placeholder: "Search nodes...",
|
|
7933
|
+
value: searchQuery,
|
|
7934
|
+
onChange: (e2) => onSearchQueryChange(e2.target.value),
|
|
7935
|
+
onKeyDown: (e2) => e2.key === "Enter" && onSearch(),
|
|
7936
|
+
className: "ot-search-input"
|
|
7937
|
+
}
|
|
7938
|
+
),
|
|
7939
|
+
/* @__PURE__ */ jsxs("div", { className: "ot-search-params", children: [
|
|
7940
|
+
/* @__PURE__ */ jsx("label", { htmlFor: `ot-hops-input-${id}`, children: "Hops:" }),
|
|
7941
|
+
/* @__PURE__ */ jsx(
|
|
7942
|
+
"input",
|
|
7943
|
+
{
|
|
7944
|
+
id: `ot-hops-input-${id}`,
|
|
7945
|
+
type: "number",
|
|
7946
|
+
min: "0",
|
|
7947
|
+
max: maxHops,
|
|
7948
|
+
value: hops,
|
|
7949
|
+
onChange: (e2) => onHopsChange(
|
|
7950
|
+
Math.min(maxHops, Math.max(0, parseInt(e2.target.value) || 0))
|
|
7951
|
+
),
|
|
7952
|
+
className: "ot-hops-input",
|
|
7953
|
+
title: `Number of connection hops to include (max ${maxHops})`
|
|
7954
|
+
}
|
|
7955
|
+
)
|
|
7956
|
+
] }),
|
|
7957
|
+
/* @__PURE__ */ jsxs("div", { className: "ot-search-actions", children: [
|
|
7958
|
+
searchQuery && /* @__PURE__ */ jsx(
|
|
7959
|
+
"button",
|
|
7960
|
+
{
|
|
7961
|
+
className: "ot-clear-search",
|
|
7962
|
+
onClick: onReset,
|
|
7963
|
+
title: "Clear search",
|
|
7964
|
+
children: "×"
|
|
7965
|
+
}
|
|
7966
|
+
),
|
|
7967
|
+
/* @__PURE__ */ jsx(
|
|
7968
|
+
"button",
|
|
7969
|
+
{
|
|
7970
|
+
className: "ot-search-btn",
|
|
7971
|
+
onClick: onSearch,
|
|
7972
|
+
title: "Query API and rerender",
|
|
7973
|
+
disabled: searchDisabled,
|
|
7974
|
+
children: /* @__PURE__ */ jsxs(
|
|
7975
|
+
"svg",
|
|
7976
|
+
{
|
|
7977
|
+
width: "14",
|
|
7978
|
+
height: "14",
|
|
7979
|
+
viewBox: "0 0 24 24",
|
|
7980
|
+
fill: "none",
|
|
7981
|
+
stroke: "currentColor",
|
|
7982
|
+
strokeWidth: "2.5",
|
|
7983
|
+
strokeLinecap: "round",
|
|
7984
|
+
strokeLinejoin: "round",
|
|
7985
|
+
children: [
|
|
7986
|
+
/* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
7987
|
+
/* @__PURE__ */ jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
|
7988
|
+
]
|
|
7989
|
+
}
|
|
7990
|
+
)
|
|
7991
|
+
}
|
|
7992
|
+
)
|
|
7993
|
+
] })
|
|
7994
|
+
] });
|
|
7995
|
+
return /* @__PURE__ */ jsxs("header", { className: `ot-toolbar${className ? ` ${className}` : ""}`, children: [
|
|
7996
|
+
logo,
|
|
7997
|
+
/* @__PURE__ */ jsx("div", { className: "ot-search-tablet", children: searchMarkup("tablet") }),
|
|
7998
|
+
persistentActions && /* @__PURE__ */ jsx("div", { className: "ot-persistent-mobile", children: persistentActions }),
|
|
7999
|
+
/* @__PURE__ */ jsx(
|
|
8000
|
+
"button",
|
|
8001
|
+
{
|
|
8002
|
+
type: "button",
|
|
8003
|
+
className: "ot-burger-btn",
|
|
8004
|
+
ref: burgerRef,
|
|
8005
|
+
onClick: () => setMenuOpen((v2) => !v2),
|
|
8006
|
+
"aria-label": "Toggle menu",
|
|
8007
|
+
"aria-expanded": menuOpen,
|
|
8008
|
+
children: /* @__PURE__ */ jsx(
|
|
8009
|
+
"svg",
|
|
8010
|
+
{
|
|
8011
|
+
width: "22",
|
|
8012
|
+
height: "22",
|
|
8013
|
+
viewBox: "0 0 24 24",
|
|
8014
|
+
fill: "none",
|
|
8015
|
+
stroke: "currentColor",
|
|
8016
|
+
strokeWidth: "2",
|
|
8017
|
+
strokeLinecap: "round",
|
|
8018
|
+
strokeLinejoin: "round",
|
|
8019
|
+
children: menuOpen ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8020
|
+
/* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
8021
|
+
/* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
8022
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8023
|
+
/* @__PURE__ */ jsx("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
|
|
8024
|
+
/* @__PURE__ */ jsx("line", { x1: "3", y1: "12", x2: "21", y2: "12" }),
|
|
8025
|
+
/* @__PURE__ */ jsx("line", { x1: "3", y1: "18", x2: "21", y2: "18" })
|
|
8026
|
+
] })
|
|
8027
|
+
}
|
|
8028
|
+
)
|
|
8029
|
+
}
|
|
8030
|
+
),
|
|
8031
|
+
/* @__PURE__ */ jsxs(
|
|
8032
|
+
"nav",
|
|
8033
|
+
{
|
|
8034
|
+
className: `ot-toolbar-nav${menuOpen ? " open" : ""}`,
|
|
8035
|
+
ref: navRef,
|
|
8036
|
+
onClick: handleNavClick,
|
|
8037
|
+
children: [
|
|
8038
|
+
visibleTabs?.map((tab) => /* @__PURE__ */ jsxs(
|
|
8039
|
+
"button",
|
|
8040
|
+
{
|
|
8041
|
+
type: "button",
|
|
8042
|
+
className: "ot-mobile-panel-btn",
|
|
8043
|
+
onClick: () => onMobilePanelTab?.(tab.key),
|
|
8044
|
+
children: [
|
|
8045
|
+
tab.icon,
|
|
8046
|
+
/* @__PURE__ */ jsx("span", { className: "ot-menu-label", children: tab.label })
|
|
8047
|
+
]
|
|
8048
|
+
},
|
|
8049
|
+
tab.key
|
|
8050
|
+
)),
|
|
8051
|
+
visibleTabs && visibleTabs.length > 0 && /* @__PURE__ */ jsx("div", { className: "ot-menu-divider" }),
|
|
8052
|
+
/* @__PURE__ */ jsx("div", { className: "ot-search-nav", children: searchMarkup("nav") }),
|
|
8053
|
+
showResetButton && /* @__PURE__ */ jsx("button", { className: "ot-reset-btn", onClick: onReset, children: "Show All" }),
|
|
8054
|
+
/* @__PURE__ */ jsx(
|
|
8055
|
+
GraphBadge,
|
|
8056
|
+
{
|
|
8057
|
+
nodeCount,
|
|
8058
|
+
edgeCount,
|
|
8059
|
+
totalNodes,
|
|
8060
|
+
totalEdges
|
|
8061
|
+
}
|
|
8062
|
+
),
|
|
8063
|
+
persistentActions && /* @__PURE__ */ jsx("div", { className: "ot-persistent-desktop", children: persistentActions }),
|
|
8064
|
+
actions
|
|
8065
|
+
]
|
|
8066
|
+
}
|
|
8067
|
+
)
|
|
8068
|
+
] });
|
|
8069
|
+
}
|
|
7877
8070
|
const q = typeof window < "u" ? useLayoutEffect : useEffect;
|
|
7878
8071
|
function ie(e2) {
|
|
7879
8072
|
if (e2 !== void 0)
|
|
@@ -7892,7 +8085,7 @@ function be({
|
|
|
7892
8085
|
defaultHeight: t2,
|
|
7893
8086
|
defaultWidth: s2,
|
|
7894
8087
|
disabled: r,
|
|
7895
|
-
element:
|
|
8088
|
+
element: n3,
|
|
7896
8089
|
mode: o,
|
|
7897
8090
|
style: i
|
|
7898
8091
|
}) {
|
|
@@ -7902,26 +8095,26 @@ function be({
|
|
|
7902
8095
|
styleWidth: ie(i?.width)
|
|
7903
8096
|
}),
|
|
7904
8097
|
[i?.height, i?.width]
|
|
7905
|
-
), [c2,
|
|
8098
|
+
), [c2, d3] = useState({
|
|
7906
8099
|
height: t2,
|
|
7907
8100
|
width: s2
|
|
7908
8101
|
}), a = r || f2 !== void 0 || o === "only-width" || f2 !== void 0 && l !== void 0;
|
|
7909
8102
|
return q(() => {
|
|
7910
|
-
if (
|
|
8103
|
+
if (n3 === null || a)
|
|
7911
8104
|
return;
|
|
7912
8105
|
const h2 = new ResizeObserver((p) => {
|
|
7913
|
-
for (const
|
|
7914
|
-
const { contentRect: u, target: w2 } =
|
|
7915
|
-
|
|
8106
|
+
for (const I2 of p) {
|
|
8107
|
+
const { contentRect: u, target: w2 } = I2;
|
|
8108
|
+
n3 === w2 && d3((m) => m.height === u.height && m.width === u.width ? m : {
|
|
7916
8109
|
height: u.height,
|
|
7917
8110
|
width: u.width
|
|
7918
8111
|
});
|
|
7919
8112
|
}
|
|
7920
8113
|
});
|
|
7921
|
-
return h2.observe(
|
|
7922
|
-
h2?.unobserve(
|
|
8114
|
+
return h2.observe(n3, { box: e2 }), () => {
|
|
8115
|
+
h2?.unobserve(n3);
|
|
7923
8116
|
};
|
|
7924
|
-
}, [e2, a,
|
|
8117
|
+
}, [e2, a, n3, f2, l]), useMemo(
|
|
7925
8118
|
() => ({
|
|
7926
8119
|
height: f2 ?? c2.height,
|
|
7927
8120
|
width: l ?? c2.width
|
|
@@ -7973,8 +8166,8 @@ function fe({
|
|
|
7973
8166
|
e2.size === 0 ? 0 : e2.size - 1
|
|
7974
8167
|
);
|
|
7975
8168
|
L(r !== void 0, "Unexpected bounds cache miss");
|
|
7976
|
-
const
|
|
7977
|
-
return t2 *
|
|
8169
|
+
const n3 = (r.scrollOffset + r.size) / e2.size;
|
|
8170
|
+
return t2 * n3;
|
|
7978
8171
|
}
|
|
7979
8172
|
}
|
|
7980
8173
|
function we({
|
|
@@ -7982,7 +8175,7 @@ function we({
|
|
|
7982
8175
|
cachedBounds: t2,
|
|
7983
8176
|
index: s2,
|
|
7984
8177
|
itemCount: r,
|
|
7985
|
-
itemSize:
|
|
8178
|
+
itemSize: n3,
|
|
7986
8179
|
containerScrollOffset: o,
|
|
7987
8180
|
containerSize: i
|
|
7988
8181
|
}) {
|
|
@@ -7993,24 +8186,24 @@ function we({
|
|
|
7993
8186
|
const f2 = fe({
|
|
7994
8187
|
cachedBounds: t2,
|
|
7995
8188
|
itemCount: r,
|
|
7996
|
-
itemSize:
|
|
8189
|
+
itemSize: n3
|
|
7997
8190
|
}), l = t2.get(s2), c2 = Math.max(
|
|
7998
8191
|
0,
|
|
7999
8192
|
Math.min(f2 - i, l.scrollOffset)
|
|
8000
|
-
),
|
|
8193
|
+
), d3 = Math.max(
|
|
8001
8194
|
0,
|
|
8002
8195
|
l.scrollOffset - i + l.size
|
|
8003
8196
|
);
|
|
8004
|
-
switch (e2 === "smart" && (o >=
|
|
8197
|
+
switch (e2 === "smart" && (o >= d3 && o <= c2 ? e2 = "auto" : e2 = "center"), e2) {
|
|
8005
8198
|
case "start":
|
|
8006
8199
|
return c2;
|
|
8007
8200
|
case "end":
|
|
8008
|
-
return
|
|
8201
|
+
return d3;
|
|
8009
8202
|
case "center":
|
|
8010
8203
|
return l.scrollOffset <= i / 2 ? 0 : l.scrollOffset + l.size / 2 >= f2 - i / 2 ? f2 - i : l.scrollOffset + l.size / 2 - i / 2;
|
|
8011
8204
|
case "auto":
|
|
8012
8205
|
default:
|
|
8013
|
-
return o >=
|
|
8206
|
+
return o >= d3 && o <= c2 ? o : o < d3 ? d3 : c2;
|
|
8014
8207
|
}
|
|
8015
8208
|
}
|
|
8016
8209
|
function P({
|
|
@@ -8018,23 +8211,23 @@ function P({
|
|
|
8018
8211
|
containerScrollOffset: t2,
|
|
8019
8212
|
containerSize: s2,
|
|
8020
8213
|
itemCount: r,
|
|
8021
|
-
overscanCount:
|
|
8214
|
+
overscanCount: n3
|
|
8022
8215
|
}) {
|
|
8023
8216
|
const o = r - 1;
|
|
8024
|
-
let i = 0, f2 = -1, l = 0, c2 = -1,
|
|
8025
|
-
for (;
|
|
8026
|
-
const a = e2.get(
|
|
8217
|
+
let i = 0, f2 = -1, l = 0, c2 = -1, d3 = 0;
|
|
8218
|
+
for (; d3 < o; ) {
|
|
8219
|
+
const a = e2.get(d3);
|
|
8027
8220
|
if (a.scrollOffset + a.size > t2)
|
|
8028
8221
|
break;
|
|
8029
|
-
|
|
8222
|
+
d3++;
|
|
8030
8223
|
}
|
|
8031
|
-
for (i =
|
|
8032
|
-
const a = e2.get(
|
|
8224
|
+
for (i = d3, l = Math.max(0, i - n3); d3 < o; ) {
|
|
8225
|
+
const a = e2.get(d3);
|
|
8033
8226
|
if (a.scrollOffset + a.size >= t2 + s2)
|
|
8034
8227
|
break;
|
|
8035
|
-
|
|
8228
|
+
d3++;
|
|
8036
8229
|
}
|
|
8037
|
-
return f2 = Math.min(o,
|
|
8230
|
+
return f2 = Math.min(o, d3), c2 = Math.min(r - 1, f2 + n3), i < 0 && (i = 0, f2 = -1, l = 0, c2 = -1), {
|
|
8038
8231
|
startIndexVisible: i,
|
|
8039
8232
|
stopIndexVisible: f2,
|
|
8040
8233
|
startIndexOverscan: l,
|
|
@@ -8048,8 +8241,8 @@ function me({
|
|
|
8048
8241
|
}) {
|
|
8049
8242
|
const r = /* @__PURE__ */ new Map();
|
|
8050
8243
|
return {
|
|
8051
|
-
get(
|
|
8052
|
-
for (L(
|
|
8244
|
+
get(n3) {
|
|
8245
|
+
for (L(n3 < e2, `Invalid index ${n3}`); r.size - 1 < n3; ) {
|
|
8053
8246
|
const i = r.size;
|
|
8054
8247
|
let f2;
|
|
8055
8248
|
switch (typeof s2) {
|
|
@@ -8071,21 +8264,21 @@ function me({
|
|
|
8071
8264
|
const l = r.get(i - 1);
|
|
8072
8265
|
L(
|
|
8073
8266
|
l !== void 0,
|
|
8074
|
-
`Unexpected bounds cache miss for index ${
|
|
8267
|
+
`Unexpected bounds cache miss for index ${n3}`
|
|
8075
8268
|
), r.set(i, {
|
|
8076
8269
|
scrollOffset: l.scrollOffset + l.size,
|
|
8077
8270
|
size: f2
|
|
8078
8271
|
});
|
|
8079
8272
|
}
|
|
8080
8273
|
}
|
|
8081
|
-
const o = r.get(
|
|
8274
|
+
const o = r.get(n3);
|
|
8082
8275
|
return L(
|
|
8083
8276
|
o !== void 0,
|
|
8084
|
-
`Unexpected bounds cache miss for index ${
|
|
8277
|
+
`Unexpected bounds cache miss for index ${n3}`
|
|
8085
8278
|
), o;
|
|
8086
8279
|
},
|
|
8087
|
-
set(
|
|
8088
|
-
r.set(
|
|
8280
|
+
set(n3, o) {
|
|
8281
|
+
r.set(n3, o);
|
|
8089
8282
|
},
|
|
8090
8283
|
get size() {
|
|
8091
8284
|
return r.size;
|
|
@@ -8134,14 +8327,14 @@ function te({
|
|
|
8134
8327
|
containerStyle: t2,
|
|
8135
8328
|
defaultContainerSize: s2 = 0,
|
|
8136
8329
|
direction: r,
|
|
8137
|
-
isRtl:
|
|
8330
|
+
isRtl: n3 = false,
|
|
8138
8331
|
itemCount: o,
|
|
8139
8332
|
itemProps: i,
|
|
8140
8333
|
itemSize: f2,
|
|
8141
8334
|
onResize: l,
|
|
8142
8335
|
overscanCount: c2
|
|
8143
8336
|
}) {
|
|
8144
|
-
const { height:
|
|
8337
|
+
const { height: d3 = s2, width: a = s2 } = be({
|
|
8145
8338
|
defaultHeight: s2,
|
|
8146
8339
|
defaultWidth: void 0,
|
|
8147
8340
|
element: e2,
|
|
@@ -8150,17 +8343,17 @@ function te({
|
|
|
8150
8343
|
}), h2 = useRef({
|
|
8151
8344
|
height: 0,
|
|
8152
8345
|
width: 0
|
|
8153
|
-
}), p =
|
|
8346
|
+
}), p = d3, I2 = ye({ containerSize: p, itemSize: f2 });
|
|
8154
8347
|
useLayoutEffect(() => {
|
|
8155
8348
|
if (typeof l == "function") {
|
|
8156
8349
|
const g = h2.current;
|
|
8157
|
-
(g.height !==
|
|
8350
|
+
(g.height !== d3 || g.width !== a) && (l({ height: d3, width: a }, { ...g }), g.height = d3, g.width = a);
|
|
8158
8351
|
}
|
|
8159
|
-
}, [
|
|
8352
|
+
}, [d3, l, a]);
|
|
8160
8353
|
const u = Oe({
|
|
8161
8354
|
itemCount: o,
|
|
8162
8355
|
itemProps: i,
|
|
8163
|
-
itemSize:
|
|
8356
|
+
itemSize: I2
|
|
8164
8357
|
}), w2 = useCallback(
|
|
8165
8358
|
(g) => u.get(g),
|
|
8166
8359
|
[u]
|
|
@@ -8187,15 +8380,15 @@ function te({
|
|
|
8187
8380
|
() => fe({
|
|
8188
8381
|
cachedBounds: u,
|
|
8189
8382
|
itemCount: o,
|
|
8190
|
-
itemSize:
|
|
8383
|
+
itemSize: I2
|
|
8191
8384
|
}),
|
|
8192
|
-
[u, o,
|
|
8385
|
+
[u, o, I2]
|
|
8193
8386
|
), $ = useCallback(
|
|
8194
8387
|
(g) => {
|
|
8195
8388
|
const S2 = Z({
|
|
8196
8389
|
containerElement: e2,
|
|
8197
8390
|
direction: r,
|
|
8198
|
-
isRtl:
|
|
8391
|
+
isRtl: n3,
|
|
8199
8392
|
scrollOffset: g
|
|
8200
8393
|
});
|
|
8201
8394
|
return P({
|
|
@@ -8211,7 +8404,7 @@ function te({
|
|
|
8211
8404
|
e2,
|
|
8212
8405
|
p,
|
|
8213
8406
|
r,
|
|
8214
|
-
|
|
8407
|
+
n3,
|
|
8215
8408
|
o,
|
|
8216
8409
|
c2
|
|
8217
8410
|
]
|
|
@@ -8227,7 +8420,7 @@ function te({
|
|
|
8227
8420
|
const { scrollLeft: E, scrollTop: b } = e2, v2 = Z({
|
|
8228
8421
|
containerElement: e2,
|
|
8229
8422
|
direction: r,
|
|
8230
|
-
isRtl:
|
|
8423
|
+
isRtl: n3,
|
|
8231
8424
|
scrollOffset: b
|
|
8232
8425
|
}), R = P({
|
|
8233
8426
|
cachedBounds: u,
|
|
@@ -8263,13 +8456,13 @@ function te({
|
|
|
8263
8456
|
containerSize: p,
|
|
8264
8457
|
index: E,
|
|
8265
8458
|
itemCount: o,
|
|
8266
|
-
itemSize:
|
|
8459
|
+
itemSize: I2
|
|
8267
8460
|
});
|
|
8268
8461
|
if (e2) {
|
|
8269
8462
|
if (b = Z({
|
|
8270
8463
|
containerElement: e2,
|
|
8271
8464
|
direction: r,
|
|
8272
|
-
isRtl:
|
|
8465
|
+
isRtl: n3,
|
|
8273
8466
|
scrollOffset: b
|
|
8274
8467
|
}), typeof e2.scrollTo != "function") {
|
|
8275
8468
|
const v2 = $(b);
|
|
@@ -8296,13 +8489,13 @@ function ue(e2, t2) {
|
|
|
8296
8489
|
const {
|
|
8297
8490
|
ariaAttributes: s2,
|
|
8298
8491
|
style: r,
|
|
8299
|
-
...
|
|
8492
|
+
...n3
|
|
8300
8493
|
} = e2, {
|
|
8301
8494
|
ariaAttributes: o,
|
|
8302
8495
|
style: i,
|
|
8303
8496
|
...f2
|
|
8304
8497
|
} = t2;
|
|
8305
|
-
return Y(s2, o) && Y(r, i) && Y(
|
|
8498
|
+
return Y(s2, o) && Y(r, i) && Y(n3, f2);
|
|
8306
8499
|
}
|
|
8307
8500
|
function ze(e2) {
|
|
8308
8501
|
return e2 != null && typeof e2 == "object" && "getAverageRowHeight" in e2 && typeof e2.getAverageRowHeight == "function";
|
|
@@ -8313,18 +8506,18 @@ function Ae({
|
|
|
8313
8506
|
className: t2,
|
|
8314
8507
|
defaultHeight: s2 = 0,
|
|
8315
8508
|
listRef: r,
|
|
8316
|
-
onResize:
|
|
8509
|
+
onResize: n3,
|
|
8317
8510
|
onRowsRendered: o,
|
|
8318
8511
|
overscanCount: i = 3,
|
|
8319
8512
|
rowComponent: f2,
|
|
8320
8513
|
rowCount: l,
|
|
8321
8514
|
rowHeight: c2,
|
|
8322
|
-
rowProps:
|
|
8515
|
+
rowProps: d3,
|
|
8323
8516
|
tagName: a = "div",
|
|
8324
8517
|
style: h2,
|
|
8325
8518
|
...p
|
|
8326
8519
|
}) {
|
|
8327
|
-
const
|
|
8520
|
+
const I2 = de(d3), u = useMemo(
|
|
8328
8521
|
() => memo(f2, ue),
|
|
8329
8522
|
[f2]
|
|
8330
8523
|
), [w2, m] = useState(null), O = ze(c2), G = useMemo(() => O ? (b) => c2.getRowHeight(b) ?? c2.getAverageRowHeight() : c2, [O, c2]), {
|
|
@@ -8341,9 +8534,9 @@ function Ae({
|
|
|
8341
8534
|
defaultContainerSize: s2,
|
|
8342
8535
|
direction: "vertical",
|
|
8343
8536
|
itemCount: l,
|
|
8344
|
-
itemProps:
|
|
8537
|
+
itemProps: I2,
|
|
8345
8538
|
itemSize: G,
|
|
8346
|
-
onResize:
|
|
8539
|
+
onResize: n3,
|
|
8347
8540
|
overscanCount: i
|
|
8348
8541
|
});
|
|
8349
8542
|
useImperativeHandle(
|
|
@@ -8413,7 +8606,7 @@ function Ae({
|
|
|
8413
8606
|
/* @__PURE__ */ createElement$1(
|
|
8414
8607
|
u,
|
|
8415
8608
|
{
|
|
8416
|
-
...
|
|
8609
|
+
...I2,
|
|
8417
8610
|
ariaAttributes: {
|
|
8418
8611
|
"aria-posinset": v2 + 1,
|
|
8419
8612
|
"aria-setsize": l,
|
|
@@ -8440,7 +8633,7 @@ function Ae({
|
|
|
8440
8633
|
x,
|
|
8441
8634
|
O,
|
|
8442
8635
|
l,
|
|
8443
|
-
|
|
8636
|
+
I2,
|
|
8444
8637
|
z,
|
|
8445
8638
|
y
|
|
8446
8639
|
]), E = /* @__PURE__ */ jsx(
|
|
@@ -8665,8 +8858,8 @@ function DiscoverPanel({
|
|
|
8665
8858
|
const maxHops = useMemo(() => {
|
|
8666
8859
|
if (!hopMap || hopMap.size === 0) return 1;
|
|
8667
8860
|
let max = 0;
|
|
8668
|
-
for (const
|
|
8669
|
-
if (
|
|
8861
|
+
for (const d3 of hopMap.values()) {
|
|
8862
|
+
if (d3 > max) max = d3;
|
|
8670
8863
|
}
|
|
8671
8864
|
return max || 1;
|
|
8672
8865
|
}, [hopMap]);
|
|
@@ -8772,6 +8965,7 @@ function DiscoverPanel({
|
|
|
8772
8965
|
] });
|
|
8773
8966
|
}
|
|
8774
8967
|
export {
|
|
8968
|
+
A as AddRepoModal,
|
|
8775
8969
|
DEFAULT_LAYOUT_CONFIG,
|
|
8776
8970
|
DiscoverPanel,
|
|
8777
8971
|
EDGE_OPACITY_DEFAULT,
|
|
@@ -8790,6 +8984,8 @@ export {
|
|
|
8790
8984
|
GraphBadge,
|
|
8791
8985
|
GraphCanvas,
|
|
8792
8986
|
GraphLegend,
|
|
8987
|
+
GraphToolbar,
|
|
8988
|
+
I as IndexingProgress,
|
|
8793
8989
|
LABEL_COLOR,
|
|
8794
8990
|
LABEL_FONT,
|
|
8795
8991
|
LABEL_RENDERED_SIZE_THRESHOLD,
|
|
@@ -8804,10 +9000,12 @@ export {
|
|
|
8804
9000
|
ZOOM_SIZE_EXPONENT,
|
|
8805
9001
|
buildCommunityColorMap,
|
|
8806
9002
|
buildCommunityNames,
|
|
9003
|
+
d as detectProvider,
|
|
8807
9004
|
drawNodeHover,
|
|
8808
9005
|
getCommunityColor,
|
|
8809
9006
|
getLinkColor,
|
|
8810
9007
|
getNodeColor,
|
|
9008
|
+
n as normalizeRepoUrl,
|
|
8811
9009
|
setHoveredNodeKey,
|
|
8812
9010
|
s as shouldHideNode,
|
|
8813
9011
|
useCommunities,
|