@krainovsd/graph 0.13.0-beta1 → 0.14.0-beta-7.1
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/lib/cjs/index.cjs +1297 -606
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/esm/constants/force-controls.js +4 -2
- package/lib/esm/constants/force-controls.js.map +1 -1
- package/lib/esm/constants/highlight-controls.js +9 -16
- package/lib/esm/constants/highlight-controls.js.map +1 -1
- package/lib/esm/constants/link-controls.js +17 -30
- package/lib/esm/constants/link-controls.js.map +1 -1
- package/lib/esm/constants/node-controls.js +4 -2
- package/lib/esm/constants/node-controls.js.map +1 -1
- package/lib/esm/index.js +8 -7
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/module/GraphCanvas/GraphCanvas.js +305 -81
- package/lib/esm/module/GraphCanvas/GraphCanvas.js.map +1 -1
- package/lib/esm/module/GraphCanvas/constants/force-settings.js +11 -1
- package/lib/esm/module/GraphCanvas/constants/force-settings.js.map +1 -1
- package/lib/esm/module/GraphCanvas/constants/graph-settings.js +17 -5
- package/lib/esm/module/GraphCanvas/constants/graph-settings.js.map +1 -1
- package/lib/esm/module/GraphCanvas/constants/highlight-settings.js +5 -3
- package/lib/esm/module/GraphCanvas/constants/highlight-settings.js.map +1 -1
- package/lib/esm/module/GraphCanvas/constants/index.js +5 -2
- package/lib/esm/module/GraphCanvas/constants/index.js.map +1 -1
- package/lib/esm/module/GraphCanvas/constants/link-settings.js +19 -9
- package/lib/esm/module/GraphCanvas/constants/link-settings.js.map +1 -1
- package/lib/esm/module/GraphCanvas/constants/node-settings.js +13 -3
- package/lib/esm/module/GraphCanvas/constants/node-settings.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/settings/force-settings-getter.js +4 -2
- package/lib/esm/module/GraphCanvas/lib/settings/force-settings-getter.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/settings/graph-settings-getter.js +4 -0
- package/lib/esm/module/GraphCanvas/lib/settings/graph-settings-getter.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/settings/highlight-settings-getter.js +4 -2
- package/lib/esm/module/GraphCanvas/lib/settings/highlight-settings-getter.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/settings/link-settings-getter.js +8 -5
- package/lib/esm/module/GraphCanvas/lib/settings/link-settings-getter.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/settings/node-settings-getter.js +14 -2
- package/lib/esm/module/GraphCanvas/lib/settings/node-settings-getter.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/utils/calculate-curve-link-position-by-node.js +45 -0
- package/lib/esm/module/GraphCanvas/lib/utils/calculate-curve-link-position-by-node.js.map +1 -0
- package/lib/esm/module/GraphCanvas/lib/utils/calculate-link-position-by-node.js +42 -37
- package/lib/esm/module/GraphCanvas/lib/utils/calculate-link-position-by-node.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/utils/compute-graph-bounds.js +26 -0
- package/lib/esm/module/GraphCanvas/lib/utils/compute-graph-bounds.js.map +1 -0
- package/lib/esm/module/GraphCanvas/lib/utils/get-particle-position.js +40 -30
- package/lib/esm/module/GraphCanvas/lib/utils/get-particle-position.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/utils/is-empty-object.js +11 -0
- package/lib/esm/module/GraphCanvas/lib/utils/is-empty-object.js.map +1 -0
- package/lib/esm/module/GraphCanvas/lib/utils/is-node-visible.js +5 -2
- package/lib/esm/module/GraphCanvas/lib/utils/is-node-visible.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/utils/link-by-pointer-getter.js +72 -26
- package/lib/esm/module/GraphCanvas/lib/utils/link-by-pointer-getter.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/utils/node-by-pointer-getter.js +1 -5
- package/lib/esm/module/GraphCanvas/lib/utils/node-by-pointer-getter.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/utils/pointer-getter.js +16 -8
- package/lib/esm/module/GraphCanvas/lib/utils/pointer-getter.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/draw-links.js +115 -77
- package/lib/esm/module/GraphCanvas/slices/draw-links.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/draw-nodes.js +9 -4
- package/lib/esm/module/GraphCanvas/slices/draw-nodes.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-area.js +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-area.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-dnd.js +20 -13
- package/lib/esm/module/GraphCanvas/slices/init-dnd.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-draw.js +14 -52
- package/lib/esm/module/GraphCanvas/slices/init-draw.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-pointer.js +51 -72
- package/lib/esm/module/GraphCanvas/slices/init-pointer.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-resize.js +11 -0
- package/lib/esm/module/GraphCanvas/slices/init-resize.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-selection.js +152 -0
- package/lib/esm/module/GraphCanvas/slices/init-selection.js.map +1 -0
- package/lib/esm/module/GraphCanvas/slices/init-simulation.js +12 -2
- package/lib/esm/module/GraphCanvas/slices/init-simulation.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-zoom.js +88 -16
- package/lib/esm/module/GraphCanvas/slices/init-zoom.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/update-link-cache.js +63 -3
- package/lib/esm/module/GraphCanvas/slices/update-link-cache.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/update-node-cache.js +61 -16
- package/lib/esm/module/GraphCanvas/slices/update-node-cache.js.map +1 -1
- package/lib/index.d.ts +127 -62
- package/package.json +3 -2
|
@@ -6,6 +6,10 @@ const FORCE_SETTINGS = {
|
|
|
6
6
|
xForce: true,
|
|
7
7
|
yForce: true,
|
|
8
8
|
collideForce: true,
|
|
9
|
+
precompute: true,
|
|
10
|
+
precomputeMaxTicks: 300,
|
|
11
|
+
precomputeMaxTimeMs: 200,
|
|
12
|
+
precomputeDisableForcesAfter: false,
|
|
9
13
|
centerPosition: {},
|
|
10
14
|
centerStrength: 1,
|
|
11
15
|
collideStrength: 0.1,
|
|
@@ -23,6 +27,12 @@ const FORCE_SETTINGS = {
|
|
|
23
27
|
linkStrength: 1,
|
|
24
28
|
collideRadius: null,
|
|
25
29
|
};
|
|
30
|
+
const PERFORMANCE_FORCE_SETTINGS = {
|
|
31
|
+
...FORCE_SETTINGS,
|
|
32
|
+
collideIterations: 1,
|
|
33
|
+
precomputeMaxTimeMs: 350,
|
|
34
|
+
precomputeDisableForcesAfter: true,
|
|
35
|
+
};
|
|
26
36
|
|
|
27
|
-
export { FORCE_SETTINGS };
|
|
37
|
+
export { FORCE_SETTINGS, PERFORMANCE_FORCE_SETTINGS };
|
|
28
38
|
//# sourceMappingURL=force-settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"force-settings.js","sources":["../../../../../src/module/GraphCanvas/constants/force-settings.ts"],"sourcesContent":["import type { ForceSettingsInterface } from \"../types/force-settings\";\n\nexport const FORCE_SETTINGS: Required<\n ForceSettingsInterface<Record<string, unknown>, Record<string, unknown>>\n> = {\n forces: true,\n centerForce: true,\n chargeForce: true,\n linkForce: true,\n xForce: true,\n yForce: true,\n collideForce: true,\n centerPosition: {},\n centerStrength: 1,\n collideStrength: 0.1,\n collideAdditionalRadius: 4,\n collideIterations: 2,\n collideOffMax: { links: 0, nodes: 0 },\n chargeStrength: -40,\n chargeDistanceMin: 1,\n xPosition: 0,\n xStrength: 0.1,\n yPosition: 0,\n yStrength: 0.1,\n linkDistance: 30,\n linkIterations: 1,\n linkStrength: 1,\n collideRadius: null,\n};\n"],"names":[],"mappings":"AAEa,MAAA,cAAc,GAEvB;AACF,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,cAAc,EAAE,CAAC;AACjB,IAAA,eAAe,EAAE,GAAG;AACpB,IAAA,uBAAuB,EAAE,CAAC;AAC1B,IAAA,iBAAiB,EAAE,CAAC;IACpB,aAAa,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;IACrC,cAAc,EAAE,GAAG;AACnB,IAAA,iBAAiB,EAAE,CAAC;AACpB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,cAAc,EAAE,CAAC;AACjB,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,aAAa,EAAE,IAAI;;;;;"}
|
|
1
|
+
{"version":3,"file":"force-settings.js","sources":["../../../../../src/module/GraphCanvas/constants/force-settings.ts"],"sourcesContent":["import type { ForceSettingsInterface } from \"../types/force-settings\";\n\nexport const FORCE_SETTINGS: Required<\n ForceSettingsInterface<Record<string, unknown>, Record<string, unknown>>\n> = {\n forces: true,\n centerForce: true,\n chargeForce: true,\n linkForce: true,\n xForce: true,\n yForce: true,\n collideForce: true,\n precompute: true,\n precomputeMaxTicks: 300,\n precomputeMaxTimeMs: 200,\n precomputeDisableForcesAfter: false,\n centerPosition: {},\n centerStrength: 1,\n collideStrength: 0.1,\n collideAdditionalRadius: 4,\n collideIterations: 2,\n collideOffMax: { links: 0, nodes: 0 },\n chargeStrength: -40,\n chargeDistanceMin: 1,\n xPosition: 0,\n xStrength: 0.1,\n yPosition: 0,\n yStrength: 0.1,\n linkDistance: 30,\n linkIterations: 1,\n linkStrength: 1,\n collideRadius: null,\n};\n\nexport const PERFORMANCE_FORCE_SETTINGS: Required<\n ForceSettingsInterface<Record<string, unknown>, Record<string, unknown>>\n> = {\n ...FORCE_SETTINGS,\n collideIterations: 1,\n precomputeMaxTimeMs: 350,\n precomputeDisableForcesAfter: true,\n};\n"],"names":[],"mappings":"AAEa,MAAA,cAAc,GAEvB;AACF,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,kBAAkB,EAAE,GAAG;AACvB,IAAA,mBAAmB,EAAE,GAAG;AACxB,IAAA,4BAA4B,EAAE,KAAK;AACnC,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,cAAc,EAAE,CAAC;AACjB,IAAA,eAAe,EAAE,GAAG;AACpB,IAAA,uBAAuB,EAAE,CAAC;AAC1B,IAAA,iBAAiB,EAAE,CAAC;IACpB,aAAa,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;IACrC,cAAc,EAAE,GAAG;AACnB,IAAA,iBAAiB,EAAE,CAAC;AACpB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,cAAc,EAAE,CAAC;AACjB,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,aAAa,EAAE,IAAI;;AAGR,MAAA,0BAA0B,GAEnC;AACF,IAAA,GAAG,cAAc;AACjB,IAAA,iBAAiB,EAAE,CAAC;AACpB,IAAA,mBAAmB,EAAE,GAAG;AACxB,IAAA,4BAA4B,EAAE,IAAI;;;;;"}
|
|
@@ -1,17 +1,29 @@
|
|
|
1
|
+
import './force-settings.js';
|
|
2
|
+
import './highlight-settings.js';
|
|
3
|
+
import './link-settings.js';
|
|
4
|
+
import './node-settings.js';
|
|
1
5
|
import '@krainovsd/js-helpers';
|
|
2
6
|
import { dragPlaceCoefficientGetter } from '../lib/utils/drag-place-coefficient-getter.js';
|
|
3
7
|
import 'd3-array';
|
|
4
8
|
|
|
5
9
|
const GRAPH_SETTINGS = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
zoomAnimation: true,
|
|
11
|
+
zoomAnimationDuration: 300,
|
|
12
|
+
zoomToNodeScale: 5,
|
|
13
|
+
zoomToFitMargin: 0.25,
|
|
14
|
+
zoomExtent: null,
|
|
15
|
+
zoomExtentMargin: 0.3,
|
|
16
|
+
translateExtent: null,
|
|
17
|
+
translateExtentCoefficient: null,
|
|
18
|
+
translateExtentOverlap: 0.3,
|
|
10
19
|
dragPlaceCoefficient: dragPlaceCoefficientGetter,
|
|
11
20
|
zoomInitial: null,
|
|
12
21
|
showDrawTime: true,
|
|
13
22
|
showDrawTimeEveryTick: false,
|
|
14
23
|
};
|
|
24
|
+
const PERFORMANCE_GRAPH_SETTINGS = {
|
|
25
|
+
...GRAPH_SETTINGS,
|
|
26
|
+
};
|
|
15
27
|
|
|
16
|
-
export { GRAPH_SETTINGS };
|
|
28
|
+
export { GRAPH_SETTINGS, PERFORMANCE_GRAPH_SETTINGS };
|
|
17
29
|
//# sourceMappingURL=graph-settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-settings.js","sources":["../../../../../src/module/GraphCanvas/constants/graph-settings.ts"],"sourcesContent":["import { dragPlaceCoefficientGetter } from \"../lib\";\nimport type { GraphSettingsInterface } from \"../types/graph-settings\";\n\nexport const GRAPH_SETTINGS: Required<GraphSettingsInterface<Record<string, unknown>>> = {\n
|
|
1
|
+
{"version":3,"file":"graph-settings.js","sources":["../../../../../src/module/GraphCanvas/constants/graph-settings.ts"],"sourcesContent":["import { dragPlaceCoefficientGetter } from \"../lib\";\nimport type { GraphSettingsInterface } from \"../types/graph-settings\";\n\nexport const GRAPH_SETTINGS: Required<GraphSettingsInterface<Record<string, unknown>>> = {\n zoomAnimation: true,\n zoomAnimationDuration: 300,\n zoomToNodeScale: 5,\n zoomToFitMargin: 0.25,\n zoomExtent: null,\n zoomExtentMargin: 0.3,\n translateExtent: null,\n translateExtentCoefficient: null,\n translateExtentOverlap: 0.3,\n dragPlaceCoefficient: dragPlaceCoefficientGetter,\n zoomInitial: null,\n showDrawTime: true,\n showDrawTimeEveryTick: false,\n};\n\nexport const PERFORMANCE_GRAPH_SETTINGS: Required<GraphSettingsInterface<Record<string, unknown>>> =\n {\n ...GRAPH_SETTINGS,\n };\n"],"names":[],"mappings":";;;;;;;;AAGa,MAAA,cAAc,GAA8D;AACvF,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,qBAAqB,EAAE,GAAG;AAC1B,IAAA,eAAe,EAAE,CAAC;AAClB,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,gBAAgB,EAAE,GAAG;AACrB,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,0BAA0B,EAAE,IAAI;AAChC,IAAA,sBAAsB,EAAE,GAAG;AAC3B,IAAA,oBAAoB,EAAE,0BAA0B;AAChD,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,qBAAqB,EAAE,KAAK;;AAGjB,MAAA,0BAA0B,GACrC;AACE,IAAA,GAAG,cAAc;;;;;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
const HIGHLIGHT_SETTINGS = {
|
|
2
2
|
highlightByHoverNode: true,
|
|
3
3
|
highlightByHoverLink: true,
|
|
4
|
-
|
|
5
|
-
highlightDownFrames: 5,
|
|
4
|
+
highlightDuration: 150,
|
|
6
5
|
linkHoverExtraZone: 2,
|
|
7
6
|
/** Node */
|
|
8
7
|
highlightByNodeOnlyRoot: true,
|
|
@@ -57,6 +56,9 @@ const HIGHLIGHT_SETTINGS = {
|
|
|
57
56
|
highlightByLinkForArrowBorderColor: null,
|
|
58
57
|
highlightByLinkForArrowBorderSizingAdditional: 0,
|
|
59
58
|
};
|
|
59
|
+
const PERFORMANCE_HIGHLIGHT_SETTINGS = {
|
|
60
|
+
...HIGHLIGHT_SETTINGS,
|
|
61
|
+
};
|
|
60
62
|
|
|
61
|
-
export { HIGHLIGHT_SETTINGS };
|
|
63
|
+
export { HIGHLIGHT_SETTINGS, PERFORMANCE_HIGHLIGHT_SETTINGS };
|
|
62
64
|
//# sourceMappingURL=highlight-settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"highlight-settings.js","sources":["../../../../../src/module/GraphCanvas/constants/highlight-settings.ts"],"sourcesContent":["import type { HighlightSettingsInterface } from \"../types/highlight-settings\";\n\nexport const HIGHLIGHT_SETTINGS: Required<HighlightSettingsInterface> = {\n highlightByHoverNode: true,\n highlightByHoverLink: true,\n
|
|
1
|
+
{"version":3,"file":"highlight-settings.js","sources":["../../../../../src/module/GraphCanvas/constants/highlight-settings.ts"],"sourcesContent":["import type { HighlightSettingsInterface } from \"../types/highlight-settings\";\n\nexport const HIGHLIGHT_SETTINGS: Required<HighlightSettingsInterface> = {\n highlightByHoverNode: true,\n highlightByHoverLink: true,\n highlightDuration: 150,\n linkHoverExtraZone: 2,\n /** Node */\n highlightByNodeOnlyRoot: true,\n highlightByNodeForNodeColorFading: false,\n highlightByNodeForNodeColor: null,\n highlightByNodeForNodeSizingAdditional: 0.5,\n highlightByNodeForNodeSizingAdditionalCoefficient: 0.35,\n highlightByNodeForNodeFadingMin: 0.21,\n highlightByNodeForNodeBorderColor: null,\n highlightByNodeForNodeBorderSizingAdditional: 0,\n\n highlightByLinkForNodeColorFading: false,\n highlightByLinkForNodeColor: null,\n highlightByLinkForNodeSizingAdditional: 0.5,\n highlightByLinkForNodeSizingAdditionalCoefficient: 0.35,\n highlightByLinkForNodeFadingMin: 0.21,\n highlightByLinkForNodeBorderColor: null,\n highlightByLinkForNodeBorderSizingAdditional: 0,\n /** Text */\n highlightByNodeForTextShiftXAdditional: 0,\n highlightByNodeForTextShiftYAdditional: 2,\n highlightByNodeForTextSizingAdditional: 1,\n highlightByNodeForTextWeightAdditional: 0,\n highlightByNodeForTextFadingMin: 0.21,\n\n highlightByLinkForTextShiftXAdditional: 0,\n highlightByLinkForTextShiftYAdditional: 2,\n highlightByLinkForTextSizingAdditional: 1,\n highlightByLinkForTextWeightAdditional: 0,\n highlightByLinkForTextFadingMin: 0.21,\n /** Label */\n highlightByNodeForLabelFadingMin: 0.21,\n highlightByNodeForLabelSizingAdditional: 1,\n highlightByNodeForLabelWeightAdditional: 0,\n\n highlightByLinkForLabelFadingMin: 0.21,\n highlightByLinkForLabelSizingAdditional: 1,\n highlightByLinkForLabelWeightAdditional: 0,\n /** Link */\n highlightByNodeForLinkFadingMin: 0.21,\n highlightByNodeForLinkSizeAdditional: 0,\n highlightByNodeForLinkColor: null,\n\n highlightByLinkForLinkFadingMin: 0.21,\n highlightByLinkForLinkSizeAdditional: 0,\n highlightByLinkForLinkColor: null,\n /** Arrow */\n highlightByNodeForArrowFadingMin: 0.21,\n highlightByNodeForArrowSizeAdditional: 0,\n highlightByNodeForArrowColor: null,\n highlightByNodeForArrowBorderColor: null,\n highlightByNodeForArrowBorderSizingAdditional: 0,\n\n highlightByLinkForArrowFadingMin: 0.21,\n highlightByLinkForArrowSizeAdditional: 0,\n highlightByLinkForArrowColor: null,\n highlightByLinkForArrowBorderColor: null,\n highlightByLinkForArrowBorderSizingAdditional: 0,\n};\n\nexport const PERFORMANCE_HIGHLIGHT_SETTINGS: Required<HighlightSettingsInterface> = {\n ...HIGHLIGHT_SETTINGS,\n};\n"],"names":[],"mappings":"AAEa,MAAA,kBAAkB,GAAyC;AACtE,IAAA,oBAAoB,EAAE,IAAI;AAC1B,IAAA,oBAAoB,EAAE,IAAI;AAC1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oC,EAAE,CAAC;AACvC,IAAA,2BAA2B,EAAE,IAAI;;AAEjC,IAAA,gCAAgC,EAAE,IAAI;AACtC,IAAA,qCAAqC,EAAE,CAAC;AACxC,IAAA,4BAA4B,EAAE,IAAI;AAClC,IAAA,kCAAkC,EAAE,IAAI;AACxC,IAAA,6CAA6C,EAAE,CAAC;AAEhD,IAAA,gCAAgC,EAAE,IAAI;AACtC,IAAA,qCAAqC,EAAE,CAAC;AACxC,IAAA,4BAA4B,EAAE,IAAI;AAClC,IAAA,kCAAkC,EAAE,IAAI;AACxC,IAAA,6CAA6C,EAAE,CAAC;;AAGrC,MAAA,8BAA8B,GAAyC;AAClF,IAAA,GAAG,kBAAkB;;;;;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export { FORCE_SETTINGS, PERFORMANCE_FORCE_SETTINGS } from './force-settings.js';
|
|
2
|
+
export { GRAPH_SETTINGS, PERFORMANCE_GRAPH_SETTINGS } from './graph-settings.js';
|
|
3
|
+
export { HIGHLIGHT_SETTINGS, PERFORMANCE_HIGHLIGHT_SETTINGS } from './highlight-settings.js';
|
|
4
|
+
export { LINK_OPTIONS, LINK_SETTINGS, PERFORMANCE_LINK_OPTIONS, PERFORMANCE_LINK_SETTINGS } from './link-settings.js';
|
|
5
|
+
export { NODE_OPTIONS, NODE_SETTINGS, PERFOMANCE_NODE_OPTIONS, PERFORMANCE_NODE_SETTINGS } from './node-settings.js';
|
|
3
6
|
|
|
4
7
|
const GRAPH_CACHE_TYPE = {
|
|
5
8
|
NodeOptions: "nodeOptions",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/module/GraphCanvas/constants/index.ts"],"sourcesContent":["export * from \"./common-settings\";\nexport * from \"./force-settings\";\nexport * from \"./graph-settings\";\nexport * from \"./highlight-settings\";\nexport * from \"./link-settings\";\nexport * from \"./node-settings\";\n\nexport const GRAPH_CACHE_TYPE = {\n NodeOptions: \"nodeOptions\",\n LinkOptions: \"linkOptions\",\n NodeText: \"nodeText\",\n NodeLabel: \"nodeLabel\",\n} as const;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/module/GraphCanvas/constants/index.ts"],"sourcesContent":["export * from \"./common-settings\";\nexport * from \"./force-settings\";\nexport * from \"./graph-settings\";\nexport * from \"./highlight-settings\";\nexport * from \"./link-settings\";\nexport * from \"./node-settings\";\n\nexport const GRAPH_CACHE_TYPE = {\n NodeOptions: \"nodeOptions\",\n LinkOptions: \"linkOptions\",\n NodeText: \"nodeText\",\n NodeLabel: \"nodeLabel\",\n} as const;\n"],"names":[],"mappings":";;;;;;AAOa,MAAA,gBAAgB,GAAG;AAC9B,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,SAAS,EAAE,WAAW;;;;;"}
|
|
@@ -1,30 +1,40 @@
|
|
|
1
1
|
const LINK_SETTINGS = {
|
|
2
|
+
smartCache: true,
|
|
2
3
|
prettyDraw: true,
|
|
4
|
+
curve: true,
|
|
3
5
|
linkScaleSwitch: 1,
|
|
4
|
-
linkColorAfterScaleSwitch: "#
|
|
6
|
+
linkColorAfterScaleSwitch: "#C5C5C5FF",
|
|
5
7
|
linkColorBeforeScaleSwitch: "#999",
|
|
6
8
|
linkWidthAfterScaleSwitch: 0.1,
|
|
7
9
|
linkWidthBeforeScaleSwitch: 1,
|
|
8
10
|
arrow: true,
|
|
9
11
|
arrowByHighlight: true,
|
|
10
12
|
particles: true,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
// spawn one more particle for N px
|
|
14
|
+
particleCountByDistance: 25,
|
|
15
|
+
// speed for 1px
|
|
16
|
+
particleSpeedByDistance: 50,
|
|
13
17
|
};
|
|
14
18
|
const LINK_OPTIONS = {
|
|
15
19
|
alpha: 1,
|
|
16
20
|
arrowAlpha: 1,
|
|
17
21
|
arrowSize: 2,
|
|
18
|
-
arrowBorderColor: "#
|
|
22
|
+
arrowBorderColor: "#C5C5C5FF",
|
|
19
23
|
arrowBorderWidth: 0.1,
|
|
20
24
|
particleAlpha: 1,
|
|
21
|
-
particleColor: "#
|
|
22
|
-
particleBorderColor: "#
|
|
25
|
+
particleColor: "#C5C5C5FF",
|
|
26
|
+
particleBorderColor: "#C5C5C5FF",
|
|
23
27
|
particleBorderWidth: 0.1,
|
|
24
|
-
particleCount: 2,
|
|
25
28
|
particleRadius: 0.5,
|
|
26
|
-
|
|
29
|
+
};
|
|
30
|
+
const PERFORMANCE_LINK_SETTINGS = {
|
|
31
|
+
...LINK_SETTINGS,
|
|
32
|
+
particles: false,
|
|
33
|
+
prettyDraw: false,
|
|
34
|
+
};
|
|
35
|
+
const PERFORMANCE_LINK_OPTIONS = {
|
|
36
|
+
...LINK_OPTIONS,
|
|
27
37
|
};
|
|
28
38
|
|
|
29
|
-
export { LINK_OPTIONS, LINK_SETTINGS };
|
|
39
|
+
export { LINK_OPTIONS, LINK_SETTINGS, PERFORMANCE_LINK_OPTIONS, PERFORMANCE_LINK_SETTINGS };
|
|
30
40
|
//# sourceMappingURL=link-settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-settings.js","sources":["../../../../../src/module/GraphCanvas/constants/link-settings.ts"],"sourcesContent":["import type { LinkOptionsInterface, LinkSettingsInterface } from \"../types/link-settings\";\n\nexport const LINK_SETTINGS: Omit<\n Required<LinkSettingsInterface<Record<string, unknown>, Record<string, unknown>>>,\n \"options\"\n> = {\n prettyDraw: true,\n linkScaleSwitch: 1,\n linkColorAfterScaleSwitch: \"#
|
|
1
|
+
{"version":3,"file":"link-settings.js","sources":["../../../../../src/module/GraphCanvas/constants/link-settings.ts"],"sourcesContent":["import type { LinkOptionsInterface, LinkSettingsInterface } from \"../types/link-settings\";\n\nexport const LINK_SETTINGS: Omit<\n Required<LinkSettingsInterface<Record<string, unknown>, Record<string, unknown>>>,\n \"options\"\n> = {\n smartCache: true,\n prettyDraw: true,\n curve: true,\n linkScaleSwitch: 1,\n linkColorAfterScaleSwitch: \"#C5C5C5FF\",\n linkColorBeforeScaleSwitch: \"#999\",\n linkWidthAfterScaleSwitch: 0.1,\n linkWidthBeforeScaleSwitch: 1,\n arrow: true,\n arrowByHighlight: true,\n particles: true,\n // spawn one more particle for N px\n particleCountByDistance: 25,\n // speed for 1px\n particleSpeedByDistance: 50,\n};\n\nexport const LINK_OPTIONS: Omit<\n Required<LinkOptionsInterface<Record<string, unknown>, Record<string, unknown>>>,\n \"color\" | \"width\" | \"drawLink\" | \"drawExtraLink\" | \"arrowColor\"\n> = {\n alpha: 1,\n arrowAlpha: 1,\n arrowSize: 2,\n arrowBorderColor: \"#C5C5C5FF\",\n arrowBorderWidth: 0.1,\n particleAlpha: 1,\n particleColor: \"#C5C5C5FF\",\n particleBorderColor: \"#C5C5C5FF\",\n particleBorderWidth: 0.1,\n particleRadius: 0.5,\n};\n\nexport const PERFORMANCE_LINK_SETTINGS: Omit<\n Required<LinkSettingsInterface<Record<string, unknown>, Record<string, unknown>>>,\n \"options\"\n> = {\n ...LINK_SETTINGS,\n particles: false,\n prettyDraw: false,\n};\n\nexport const PERFORMANCE_LINK_OPTIONS: Omit<\n Required<LinkOptionsInterface<Record<string, unknown>, Record<string, unknown>>>,\n \"color\" | \"width\" | \"drawLink\" | \"drawExtraLink\" | \"arrowColor\"\n> = {\n ...LINK_OPTIONS,\n};\n"],"names":[],"mappings":"AAEa,MAAA,aAAa,GAGtB;AACF,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,eAAe,EAAE,CAAC;AAClB,IAAA,yBAAyB,EAAE,WAAW;AACtC,IAAA,0BAA0B,EAAE,MAAM;AAClC,IAAA,yBAAyB,EAAE,GAAG;AAC9B,IAAA,0BAA0B,EAAE,CAAC;AAC7B,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,gBAAgB,EAAE,IAAI;AACtB,IAAA,SAAS,EAAE,IAAI;;AAEf,IAAA,uBAAuB,EAAE,EAAE;;AAE3B,IAAA,uBAAuB,EAAE,EAAE;;AAGhB,MAAA,YAAY,GAGrB;AACF,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,UAAU,EAAE,CAAC;AACb,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,gBAAgB,EAAE,WAAW;AAC7B,IAAA,gBAAgB,EAAE,GAAG;AACrB,IAAA,aAAa,EAAE,CAAC;AAChB,IAAA,aAAa,EAAE,WAAW;AAC1B,IAAA,mBAAmB,EAAE,WAAW;AAChC,IAAA,mBAAmB,EAAE,GAAG;AACxB,IAAA,cAAc,EAAE,GAAG;;AAGR,MAAA,yBAAyB,GAGlC;AACF,IAAA,GAAG,aAAa;AAChB,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,UAAU,EAAE,KAAK;;AAGN,MAAA,wBAAwB,GAGjC;AACF,IAAA,GAAG,YAAY;;;;;"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
const NODE_SETTINGS = {
|
|
2
|
+
smartCache: true,
|
|
3
|
+
textScaleSteps: [],
|
|
2
4
|
nodeRadiusFlexible: true,
|
|
3
5
|
nodeRadiusLinkCountForStep: 5,
|
|
4
6
|
nodeRadiusIncrementByStep: 1,
|
|
@@ -35,14 +37,14 @@ const NODE_OPTIONS = {
|
|
|
35
37
|
textShiftX: 0,
|
|
36
38
|
textFont: "Arial",
|
|
37
39
|
textAlign: "center",
|
|
38
|
-
textColor: "#
|
|
40
|
+
textColor: "#d2d2d2",
|
|
39
41
|
textStyle: "normal",
|
|
40
42
|
textWeight: 500,
|
|
41
43
|
textGap: 0,
|
|
42
44
|
label: null,
|
|
43
45
|
labelAlpha: 1,
|
|
44
46
|
labelAlign: "center",
|
|
45
|
-
labelColor: "#
|
|
47
|
+
labelColor: "#ffffff",
|
|
46
48
|
labelFont: "Arial",
|
|
47
49
|
labelGap: 0,
|
|
48
50
|
labelSize: 3.5,
|
|
@@ -50,6 +52,14 @@ const NODE_OPTIONS = {
|
|
|
50
52
|
labelWeight: 500,
|
|
51
53
|
labelWidth: 20,
|
|
52
54
|
};
|
|
55
|
+
const PERFORMANCE_NODE_SETTINGS = {
|
|
56
|
+
...NODE_SETTINGS,
|
|
57
|
+
nodeRadiusFlexible: false,
|
|
58
|
+
nodeSizeFlexible: false,
|
|
59
|
+
};
|
|
60
|
+
const PERFOMANCE_NODE_OPTIONS = {
|
|
61
|
+
...NODE_OPTIONS,
|
|
62
|
+
};
|
|
53
63
|
|
|
54
|
-
export { NODE_OPTIONS, NODE_SETTINGS };
|
|
64
|
+
export { NODE_OPTIONS, NODE_SETTINGS, PERFOMANCE_NODE_OPTIONS, PERFORMANCE_NODE_SETTINGS };
|
|
55
65
|
//# sourceMappingURL=node-settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-settings.js","sources":["../../../../../src/module/GraphCanvas/constants/node-settings.ts"],"sourcesContent":["import type { NodeOptionsInterface, NodeSettingsInterface } from \"../types/node-settings\";\n\nexport const NODE_SETTINGS: Omit<\n Required<NodeSettingsInterface<Record<string, unknown>, Record<string, unknown>>>,\n \"options\" | \"idGetter\"\n> = {\n nodeRadiusFlexible: true,\n nodeRadiusLinkCountForStep: 5,\n nodeRadiusIncrementByStep: 1,\n nodeRadiusMaxLinearSteps: 5,\n nodeRadiusLinkCountDividerForLog: 25,\n nodeRadiusLogFactor: 2.5,\n nodeSizeFlexible: true,\n nodeSizeLinkCountForStep: 5,\n nodeSizeIncrementByStep: 0.1,\n nodeSizeMaxLinearSteps: 5,\n nodeSizeLinkCountDividerForLog: 25,\n nodeSizeLogFactor: 2.5,\n textScaleMin: 1.5,\n textScaleMax: 18,\n textSizeMin: 3.5,\n textSizeMax: 1.5,\n textShiftYMin: 4,\n textShiftYMax: 2.5,\n textNodeDebug: false,\n};\n\nexport const NODE_OPTIONS: Omit<\n Required<NodeOptionsInterface<Record<string, unknown>, Record<string, unknown>>>,\n | \"color\"\n | \"text\"\n | \"textVisible\"\n | \"textSize\"\n | \"textShiftY\"\n | \"nodeDraw\"\n | \"nodeExtraDraw\"\n | \"textDraw\"\n | \"textExtraDraw\"\n> = {\n shape: \"circle\",\n height: 10,\n width: 15,\n borderRadius: 0,\n radius: 4,\n alpha: 1,\n labelXPadding: 1,\n labelYPadding: 1,\n borderWidth: 0.1,\n borderColor: \"#000000FF\",\n textAlpha: 1,\n textWidth: 20,\n textShiftX: 0,\n textFont: \"Arial\",\n textAlign: \"center\" as CanvasTextAlign,\n textColor: \"#
|
|
1
|
+
{"version":3,"file":"node-settings.js","sources":["../../../../../src/module/GraphCanvas/constants/node-settings.ts"],"sourcesContent":["import type { NodeOptionsInterface, NodeSettingsInterface } from \"../types/node-settings\";\n\nexport const NODE_SETTINGS: Omit<\n Required<NodeSettingsInterface<Record<string, unknown>, Record<string, unknown>>>,\n \"options\" | \"idGetter\"\n> = {\n smartCache: true,\n textScaleSteps: [],\n nodeRadiusFlexible: true,\n nodeRadiusLinkCountForStep: 5,\n nodeRadiusIncrementByStep: 1,\n nodeRadiusMaxLinearSteps: 5,\n nodeRadiusLinkCountDividerForLog: 25,\n nodeRadiusLogFactor: 2.5,\n nodeSizeFlexible: true,\n nodeSizeLinkCountForStep: 5,\n nodeSizeIncrementByStep: 0.1,\n nodeSizeMaxLinearSteps: 5,\n nodeSizeLinkCountDividerForLog: 25,\n nodeSizeLogFactor: 2.5,\n textScaleMin: 1.5,\n textScaleMax: 18,\n textSizeMin: 3.5,\n textSizeMax: 1.5,\n textShiftYMin: 4,\n textShiftYMax: 2.5,\n textNodeDebug: false,\n};\n\nexport const NODE_OPTIONS: Omit<\n Required<NodeOptionsInterface<Record<string, unknown>, Record<string, unknown>>>,\n | \"color\"\n | \"text\"\n | \"textVisible\"\n | \"textSize\"\n | \"textShiftY\"\n | \"nodeDraw\"\n | \"nodeExtraDraw\"\n | \"textDraw\"\n | \"textExtraDraw\"\n> = {\n shape: \"circle\",\n height: 10,\n width: 15,\n borderRadius: 0,\n radius: 4,\n alpha: 1,\n labelXPadding: 1,\n labelYPadding: 1,\n borderWidth: 0.1,\n borderColor: \"#000000FF\",\n textAlpha: 1,\n textWidth: 20,\n textShiftX: 0,\n textFont: \"Arial\",\n textAlign: \"center\" as CanvasTextAlign,\n textColor: \"#d2d2d2\",\n textStyle: \"normal\",\n textWeight: 500,\n textGap: 0,\n label: null,\n labelAlpha: 1,\n labelAlign: \"center\",\n labelColor: \"#ffffff\",\n labelFont: \"Arial\",\n labelGap: 0,\n labelSize: 3.5,\n labelStyle: \"normal\",\n labelWeight: 500,\n labelWidth: 20,\n};\n\nexport const PERFORMANCE_NODE_SETTINGS: Omit<\n Required<NodeSettingsInterface<Record<string, unknown>, Record<string, unknown>>>,\n \"options\" | \"idGetter\"\n> = {\n ...NODE_SETTINGS,\n nodeRadiusFlexible: false,\n nodeSizeFlexible: false,\n};\n\nexport const PERFOMANCE_NODE_OPTIONS: Omit<\n Required<NodeOptionsInterface<Record<string, unknown>, Record<string, unknown>>>,\n | \"color\"\n | \"text\"\n | \"textVisible\"\n | \"textSize\"\n | \"textShiftY\"\n | \"nodeDraw\"\n | \"nodeExtraDraw\"\n | \"textDraw\"\n | \"textExtraDraw\"\n> = {\n ...NODE_OPTIONS,\n};\n"],"names":[],"mappings":"AAEa,MAAA,aAAa,GAGtB;AACF,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,kBAAkB,EAAE,IAAI;AACxB,IAAA,0BAA0B,EAAE,CAAC;AAC7B,IAAA,yBAAyB,EAAE,CAAC;AAC5B,IAAA,wBAAwB,EAAE,CAAC;AAC3B,IAAA,gCAAgC,EAAE,EAAE;AACpC,IAAA,mBAAmB,EAAE,GAAG;AACxB,IAAA,gBAAgB,EAAE,IAAI;AACtB,IAAA,wBAAwB,EAAE,CAAC;AAC3B,IAAA,uBAAuB,EAAE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C;AACF,IAAA,GAAG,aAAa;AAChB,IAAA,kBAAkB,EAAE,KAAK;AACzB,IAAA,gBAAgB,EAAE,KAAK;;AAGZ,MAAA,uBAAuB,GAWhC;AACF,IAAA,GAAG,YAAY;;;;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { FORCE_SETTINGS } from '../../constants/force-settings.js';
|
|
2
|
-
import '
|
|
3
|
-
import '
|
|
2
|
+
import '../../constants/graph-settings.js';
|
|
3
|
+
import '../../constants/highlight-settings.js';
|
|
4
|
+
import '../../constants/link-settings.js';
|
|
5
|
+
import '../../constants/node-settings.js';
|
|
4
6
|
|
|
5
7
|
function forceSettingsGetter(settings, prevSettings) {
|
|
6
8
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"force-settings-getter.js","sources":["../../../../../../src/module/GraphCanvas/lib/settings/force-settings-getter.ts"],"sourcesContent":["import { FORCE_SETTINGS } from \"../../constants\";\nimport type { ForceSettingsInterface } from \"../../types\";\n\nexport function forceSettingsGetter<\n NodeData extends Record<string, unknown>,\n LinkData extends Record<string, unknown>,\n>(\n settings: ForceSettingsInterface<NodeData, LinkData> | undefined,\n prevSettings?: Required<ForceSettingsInterface<NodeData, LinkData>>,\n): Required<ForceSettingsInterface<NodeData, LinkData>> {\n return {\n ...(prevSettings ?? (FORCE_SETTINGS as Required<ForceSettingsInterface<NodeData, LinkData>>)),\n ...settings,\n };\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"force-settings-getter.js","sources":["../../../../../../src/module/GraphCanvas/lib/settings/force-settings-getter.ts"],"sourcesContent":["import { FORCE_SETTINGS } from \"../../constants\";\nimport type { ForceSettingsInterface } from \"../../types\";\n\nexport function forceSettingsGetter<\n NodeData extends Record<string, unknown>,\n LinkData extends Record<string, unknown>,\n>(\n settings: ForceSettingsInterface<NodeData, LinkData> | undefined,\n prevSettings?: Required<ForceSettingsInterface<NodeData, LinkData>>,\n): Required<ForceSettingsInterface<NodeData, LinkData>> {\n return {\n ...(prevSettings ?? (FORCE_SETTINGS as Required<ForceSettingsInterface<NodeData, LinkData>>)),\n ...settings,\n };\n}\n"],"names":[],"mappings":";;;;;;AAGgB,SAAA,mBAAmB,CAIjC,QAAgE,EAChE,YAAmE,EAAA;IAEnE,OAAO;AACL,QAAA,IAAI,YAAY,IAAK,cAAuE,CAAC;AAC7F,QAAA,GAAG,QAAQ;KACZ;AACH;;;;"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import '../../constants/force-settings.js';
|
|
1
2
|
import { GRAPH_SETTINGS } from '../../constants/graph-settings.js';
|
|
3
|
+
import '../../constants/highlight-settings.js';
|
|
4
|
+
import '../../constants/link-settings.js';
|
|
5
|
+
import '../../constants/node-settings.js';
|
|
2
6
|
|
|
3
7
|
function graphSettingsGetter(settings, prevSettings) {
|
|
4
8
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-settings-getter.js","sources":["../../../../../../src/module/GraphCanvas/lib/settings/graph-settings-getter.ts"],"sourcesContent":["import { GRAPH_SETTINGS } from \"../../constants\";\nimport type { GraphSettingsInterface } from \"../../types/graph-settings\";\n\nexport function graphSettingsGetter<NodeData extends Record<string, unknown>>(\n settings: GraphSettingsInterface<NodeData> | undefined,\n prevSettings?: Required<GraphSettingsInterface<NodeData>>,\n): Required<GraphSettingsInterface<NodeData>> {\n return {\n ...(prevSettings ?? GRAPH_SETTINGS),\n ...settings,\n };\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graph-settings-getter.js","sources":["../../../../../../src/module/GraphCanvas/lib/settings/graph-settings-getter.ts"],"sourcesContent":["import { GRAPH_SETTINGS } from \"../../constants\";\nimport type { GraphSettingsInterface } from \"../../types/graph-settings\";\n\nexport function graphSettingsGetter<NodeData extends Record<string, unknown>>(\n settings: GraphSettingsInterface<NodeData> | undefined,\n prevSettings?: Required<GraphSettingsInterface<NodeData>>,\n): Required<GraphSettingsInterface<NodeData>> {\n return {\n ...(prevSettings ?? GRAPH_SETTINGS),\n ...settings,\n };\n}\n"],"names":[],"mappings":";;;;;;AAGgB,SAAA,mBAAmB,CACjC,QAAsD,EACtD,YAAyD,EAAA;IAEzD,OAAO;AACL,QAAA,IAAI,YAAY,IAAI,cAAc,CAAC;AACnC,QAAA,GAAG,QAAQ;KACZ;AACH;;;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '
|
|
1
|
+
import '../../constants/force-settings.js';
|
|
2
|
+
import '../../constants/graph-settings.js';
|
|
3
3
|
import { HIGHLIGHT_SETTINGS } from '../../constants/highlight-settings.js';
|
|
4
|
+
import '../../constants/link-settings.js';
|
|
5
|
+
import '../../constants/node-settings.js';
|
|
4
6
|
|
|
5
7
|
function highlightSettingsGetter(settings, prevSettings) {
|
|
6
8
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"highlight-settings-getter.js","sources":["../../../../../../src/module/GraphCanvas/lib/settings/highlight-settings-getter.ts"],"sourcesContent":["import { HIGHLIGHT_SETTINGS } from \"../../constants\";\nimport type { HighlightSettingsInterface } from \"../../types\";\n\nexport function highlightSettingsGetter(\n settings: HighlightSettingsInterface | undefined,\n prevSettings?: Required<HighlightSettingsInterface>,\n): Required<HighlightSettingsInterface> {\n return {\n ...(prevSettings ?? HIGHLIGHT_SETTINGS),\n ...settings,\n };\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"highlight-settings-getter.js","sources":["../../../../../../src/module/GraphCanvas/lib/settings/highlight-settings-getter.ts"],"sourcesContent":["import { HIGHLIGHT_SETTINGS } from \"../../constants\";\nimport type { HighlightSettingsInterface } from \"../../types\";\n\nexport function highlightSettingsGetter(\n settings: HighlightSettingsInterface | undefined,\n prevSettings?: Required<HighlightSettingsInterface>,\n): Required<HighlightSettingsInterface> {\n return {\n ...(prevSettings ?? HIGHLIGHT_SETTINGS),\n ...settings,\n };\n}\n"],"names":[],"mappings":";;;;;;AAGgB,SAAA,uBAAuB,CACrC,QAAgD,EAChD,YAAmD,EAAA;IAEnD,OAAO;AACL,QAAA,IAAI,YAAY,IAAI,kBAAkB,CAAC;AACvC,QAAA,GAAG,QAAQ;KACZ;AACH;;;;"}
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '
|
|
1
|
+
import '../../constants/force-settings.js';
|
|
2
|
+
import '../../constants/graph-settings.js';
|
|
3
|
+
import '../../constants/highlight-settings.js';
|
|
3
4
|
import { LINK_SETTINGS, LINK_OPTIONS } from '../../constants/link-settings.js';
|
|
5
|
+
import '../../constants/node-settings.js';
|
|
4
6
|
|
|
5
7
|
function linkSettingsGetter(settings, prevSettings) {
|
|
6
8
|
return { ...(prevSettings ?? LINK_SETTINGS), ...settings };
|
|
7
9
|
}
|
|
8
10
|
function linkOptionsGetter() {
|
|
11
|
+
const aboveScale = this.areaTransform && this.areaTransform.k > this.linkSettings.linkScaleSwitch;
|
|
9
12
|
return {
|
|
10
13
|
...LINK_OPTIONS,
|
|
11
14
|
drawExtraLink: null,
|
|
12
15
|
drawLink: null,
|
|
13
|
-
color:
|
|
16
|
+
color: aboveScale
|
|
14
17
|
? this.linkSettings.linkColorAfterScaleSwitch
|
|
15
18
|
: this.linkSettings.linkColorBeforeScaleSwitch,
|
|
16
|
-
arrowColor:
|
|
19
|
+
arrowColor: aboveScale
|
|
17
20
|
? this.linkSettings.linkColorAfterScaleSwitch
|
|
18
21
|
: this.linkSettings.linkColorBeforeScaleSwitch,
|
|
19
|
-
width:
|
|
22
|
+
width: aboveScale
|
|
20
23
|
? this.linkSettings.linkWidthAfterScaleSwitch
|
|
21
24
|
: this.linkSettings.linkWidthBeforeScaleSwitch,
|
|
22
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-settings-getter.js","sources":["../../../../../../src/module/GraphCanvas/lib/settings/link-settings-getter.ts"],"sourcesContent":["import type { GraphCanvas } from \"../../GraphCanvas\";\nimport { LINK_OPTIONS, LINK_SETTINGS } from \"../../constants\";\nimport type { LinkOptionsInterface, LinkSettingsInterface } from \"../../types\";\n\nexport function linkSettingsGetter<\n NodeData extends Record<string, unknown>,\n LinkData extends Record<string, unknown>,\n>(\n settings: LinkSettingsInterface<NodeData, LinkData> | undefined,\n prevSettings?: Required<Omit<LinkSettingsInterface<NodeData, LinkData>, \"options\">> &\n Pick<LinkSettingsInterface<NodeData, LinkData>, \"options\">,\n): Required<Omit<LinkSettingsInterface<NodeData, LinkData>, \"options\">> &\n Pick<LinkSettingsInterface<NodeData, LinkData>, \"options\"> {\n return { ...(prevSettings ?? LINK_SETTINGS), ...settings };\n}\n\nexport function linkOptionsGetter<\n NodeData extends Record<string, unknown>,\n LinkData extends Record<string, unknown>,\n>(this: GraphCanvas<NodeData, LinkData>): Required<LinkOptionsInterface<NodeData, LinkData>> {\n return {\n ...LINK_OPTIONS,\n drawExtraLink: null,\n drawLink: null,\n color
|
|
1
|
+
{"version":3,"file":"link-settings-getter.js","sources":["../../../../../../src/module/GraphCanvas/lib/settings/link-settings-getter.ts"],"sourcesContent":["import type { GraphCanvas } from \"../../GraphCanvas\";\nimport { LINK_OPTIONS, LINK_SETTINGS } from \"../../constants\";\nimport type { LinkOptionsInterface, LinkSettingsInterface } from \"../../types\";\n\nexport function linkSettingsGetter<\n NodeData extends Record<string, unknown>,\n LinkData extends Record<string, unknown>,\n>(\n settings: LinkSettingsInterface<NodeData, LinkData> | undefined,\n prevSettings?: Required<Omit<LinkSettingsInterface<NodeData, LinkData>, \"options\">> &\n Pick<LinkSettingsInterface<NodeData, LinkData>, \"options\">,\n): Required<Omit<LinkSettingsInterface<NodeData, LinkData>, \"options\">> &\n Pick<LinkSettingsInterface<NodeData, LinkData>, \"options\"> {\n return { ...(prevSettings ?? LINK_SETTINGS), ...settings };\n}\n\nexport function linkOptionsGetter<\n NodeData extends Record<string, unknown>,\n LinkData extends Record<string, unknown>,\n>(this: GraphCanvas<NodeData, LinkData>): Required<LinkOptionsInterface<NodeData, LinkData>> {\n const aboveScale = this.areaTransform && this.areaTransform.k > this.linkSettings.linkScaleSwitch;\n\n return {\n ...LINK_OPTIONS,\n drawExtraLink: null,\n drawLink: null,\n color: aboveScale\n ? this.linkSettings.linkColorAfterScaleSwitch\n : this.linkSettings.linkColorBeforeScaleSwitch,\n arrowColor: aboveScale\n ? this.linkSettings.linkColorAfterScaleSwitch\n : this.linkSettings.linkColorBeforeScaleSwitch,\n width: aboveScale\n ? this.linkSettings.linkWidthAfterScaleSwitch\n : this.linkSettings.linkWidthBeforeScaleSwitch,\n };\n}\n"],"names":[],"mappings":";;;;;;AAIgB,SAAA,kBAAkB,CAIhC,QAA+D,EAC/D,YAC4D,EAAA;IAG5D,OAAO,EAAE,IAAI,YAAY,IAAI,aAAa,CAAC,EAAE,GAAG,QAAQ,EAAE;AAC5D;SAEgB,iBAAiB,GAAA;AAI/B,IAAA,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,eAAe;IAEjG,OAAO;AACL,QAAA,GAAG,YAAY;AACf,QAAA,aAAa,EAAE,IAAI;AACnB,QAAA,QAAQ,EAAE,IAAI;AACd,QAAA,KAAK,EAAE;AACL,cAAE,IAAI,CAAC,YAAY,CAAC;AACpB,cAAE,IAAI,CAAC,YAAY,CAAC,0BAA0B;AAChD,QAAA,UAAU,EAAE;AACV,cAAE,IAAI,CAAC,YAAY,CAAC;AACpB,cAAE,IAAI,CAAC,YAAY,CAAC,0BAA0B;AAChD,QAAA,KAAK,EAAE;AACL,cAAE,IAAI,CAAC,YAAY,CAAC;AACpB,cAAE,IAAI,CAAC,YAAY,CAAC,0BAA0B;KACjD;AACH;;;;"}
|
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
import { colorGetter } from '../../../../lib/color-getter.js';
|
|
2
2
|
import '@krainovsd/js-helpers';
|
|
3
|
-
import '
|
|
3
|
+
import '../../constants/force-settings.js';
|
|
4
|
+
import '../../constants/graph-settings.js';
|
|
5
|
+
import '../../constants/highlight-settings.js';
|
|
6
|
+
import '../../constants/link-settings.js';
|
|
4
7
|
import { NODE_SETTINGS, NODE_OPTIONS } from '../../constants/node-settings.js';
|
|
5
8
|
|
|
6
9
|
function nodeSettingsGetter(settings, prevNodeSettings) {
|
|
7
|
-
|
|
10
|
+
const result = {
|
|
8
11
|
...(prevNodeSettings ?? NODE_SETTINGS),
|
|
9
12
|
idGetter: nodeIdGetter,
|
|
10
13
|
...settings,
|
|
11
14
|
};
|
|
15
|
+
if (result.smartCache && (!result.textScaleSteps || result.textScaleSteps.length === 0)) {
|
|
16
|
+
const step = (result.textScaleMax - result.textScaleMin) / 9;
|
|
17
|
+
const steps = [];
|
|
18
|
+
for (let i = 0; i < 10; i++) {
|
|
19
|
+
steps.push(result.textScaleMin + i * step);
|
|
20
|
+
}
|
|
21
|
+
result.textScaleSteps = steps;
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
12
24
|
}
|
|
13
25
|
const color = colorGetter();
|
|
14
26
|
function nodeOptionsGetter(node) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-settings-getter.js","sources":["../../../../../../src/module/GraphCanvas/lib/settings/node-settings-getter.ts"],"sourcesContent":["import type { ZoomTransform } from \"d3-zoom\";\nimport { colorGetter } from \"@/lib\";\nimport type { GraphCanvas } from \"../../GraphCanvas\";\nimport { NODE_OPTIONS, NODE_SETTINGS } from \"../../constants\";\nimport type { NodeInterface, NodeOptionsInterface, NodeSettingsInterface } from \"../../types\";\n\nexport function nodeSettingsGetter<\n NodeData extends Record<string, unknown>,\n LinkData extends Record<string, unknown>,\n>(\n settings: NodeSettingsInterface<NodeData, LinkData> | undefined,\n prevNodeSettings?: Required<Omit<NodeSettingsInterface<NodeData, LinkData>, \"options\">> &\n Pick<NodeSettingsInterface<NodeData, LinkData>, \"options\">,\n): Required<Omit<NodeSettingsInterface<NodeData, LinkData>, \"options\">> &\n Pick<NodeSettingsInterface<NodeData, LinkData>, \"options\"> {\n
|
|
1
|
+
{"version":3,"file":"node-settings-getter.js","sources":["../../../../../../src/module/GraphCanvas/lib/settings/node-settings-getter.ts"],"sourcesContent":["import type { ZoomTransform } from \"d3-zoom\";\nimport { colorGetter } from \"@/lib\";\nimport type { GraphCanvas } from \"../../GraphCanvas\";\nimport { NODE_OPTIONS, NODE_SETTINGS } from \"../../constants\";\nimport type { NodeInterface, NodeOptionsInterface, NodeSettingsInterface } from \"../../types\";\n\nexport function nodeSettingsGetter<\n NodeData extends Record<string, unknown>,\n LinkData extends Record<string, unknown>,\n>(\n settings: NodeSettingsInterface<NodeData, LinkData> | undefined,\n prevNodeSettings?: Required<Omit<NodeSettingsInterface<NodeData, LinkData>, \"options\">> &\n Pick<NodeSettingsInterface<NodeData, LinkData>, \"options\">,\n): Required<Omit<NodeSettingsInterface<NodeData, LinkData>, \"options\">> &\n Pick<NodeSettingsInterface<NodeData, LinkData>, \"options\"> {\n const result = {\n ...(prevNodeSettings ?? NODE_SETTINGS),\n idGetter: nodeIdGetter,\n ...settings,\n };\n if (result.smartCache && (!result.textScaleSteps || result.textScaleSteps.length === 0)) {\n const step = (result.textScaleMax - result.textScaleMin) / 9;\n const steps: number[] = [];\n for (let i = 0; i < 10; i++) {\n steps.push(result.textScaleMin + i * step);\n }\n result.textScaleSteps = steps;\n }\n return result as Required<Omit<NodeSettingsInterface<NodeData, LinkData>, \"options\">> &\n Pick<NodeSettingsInterface<NodeData, LinkData>, \"options\">;\n}\n\nconst color = colorGetter();\n\nexport function nodeOptionsGetter<\n NodeData extends Record<string, unknown>,\n LinkData extends Record<string, unknown>,\n>(\n this: GraphCanvas<NodeData, LinkData>,\n node: NodeInterface<NodeData>,\n): Required<NodeOptionsInterface<NodeData, LinkData>> {\n const { textShiftY, textSize } = nodeTextSizeGetter(this.areaTransform, this.nodeSettings);\n\n return {\n ...NODE_OPTIONS,\n nodeDraw: null,\n nodeExtraDraw: null,\n textDraw: null,\n textExtraDraw: null,\n color: color(String(node.group ?? \"_DEFAULT\")),\n textVisible: Boolean(this.areaTransform.k > this.nodeSettings.textScaleMin),\n text: node.name ?? node.id.toString(),\n textShiftY,\n textSize,\n };\n}\n\nexport function nodeTextSizeGetter<\n NodeData extends Record<string, unknown>,\n LinkData extends Record<string, unknown>,\n>(\n transform: ZoomTransform | undefined,\n nodeSettings: Required<Omit<NodeSettingsInterface<NodeData, LinkData>, \"options\">> &\n Pick<NodeSettingsInterface<NodeData, LinkData>, \"options\">,\n) {\n let textSize: number = nodeSettings.textSizeMin;\n let textShiftY: number = nodeSettings.textShiftYMin;\n\n if (transform) {\n if (transform.k >= nodeSettings.textScaleMax) {\n textSize = nodeSettings.textSizeMax;\n textShiftY = nodeSettings.textShiftYMax;\n } else if (transform.k > nodeSettings.textScaleMin) {\n textSize =\n nodeSettings.textSizeMin +\n ((transform.k - nodeSettings.textScaleMin) *\n (nodeSettings.textSizeMax - nodeSettings.textSizeMin)) /\n (nodeSettings.textScaleMax - nodeSettings.textScaleMin);\n\n textShiftY =\n nodeSettings.textShiftYMin +\n ((transform.k - nodeSettings.textScaleMin) *\n (nodeSettings.textShiftYMax - nodeSettings.textShiftYMin)) /\n (nodeSettings.textScaleMax - nodeSettings.textScaleMin);\n }\n }\n\n return { textSize, textShiftY };\n}\n\nexport type NodeRadiusGetterOptions = {\n linkCount: number | undefined;\n radiusFlexible: boolean;\n radiusInitial: number;\n radiusLinkCountForStep: number;\n radiusIncrementByStep: number;\n radiusMaxLinearSteps: number;\n radiusLogFactor: number;\n radiusLinkCountDividerForLog: number;\n};\n\nexport function nodeRadiusGetter({\n radiusFlexible,\n linkCount,\n radiusInitial,\n radiusIncrementByStep,\n radiusLinkCountDividerForLog,\n radiusLinkCountForStep,\n radiusLogFactor,\n radiusMaxLinearSteps,\n}: NodeRadiusGetterOptions) {\n if (!radiusFlexible || !linkCount) return radiusInitial;\n const steps = linkCount / radiusLinkCountForStep;\n\n if (steps < radiusMaxLinearSteps) {\n return steps * radiusIncrementByStep + radiusInitial;\n }\n\n return (\n radiusInitial +\n radiusMaxLinearSteps * radiusIncrementByStep +\n radiusLogFactor * Math.log10(linkCount / radiusLinkCountDividerForLog)\n );\n}\n\nexport type NodeSizeGetterOptions = {\n linkCount: number | undefined;\n sizeFlexible: boolean;\n widthInitial: number;\n heightInitial: number;\n sizeLinkCountForStep: number;\n sizeIncrementByStep: number;\n sizeMaxLinearSteps: number;\n sizeLogFactor: number;\n sizeLinkCountDividerForLog: number;\n};\n\nexport function nodeSizeGetter({\n heightInitial,\n linkCount,\n sizeFlexible,\n widthInitial,\n sizeIncrementByStep,\n sizeLinkCountDividerForLog,\n sizeLinkCountForStep,\n sizeLogFactor,\n sizeMaxLinearSteps,\n}: NodeSizeGetterOptions) {\n let additionalSizeCoefficient = 1;\n if (sizeFlexible && linkCount != undefined) {\n const steps = linkCount / sizeLinkCountForStep;\n if (steps < sizeMaxLinearSteps) {\n additionalSizeCoefficient += steps * sizeIncrementByStep;\n } else {\n additionalSizeCoefficient +=\n sizeMaxLinearSteps * sizeIncrementByStep +\n sizeLogFactor * Math.log10(linkCount / sizeLinkCountDividerForLog);\n }\n }\n\n return {\n width: widthInitial * additionalSizeCoefficient,\n height: heightInitial * additionalSizeCoefficient,\n additionalSizeCoefficient,\n };\n}\n\nexport function nodeIdGetter<NodeData extends Record<string, unknown>>(\n node: NodeInterface<NodeData>,\n) {\n return node.id;\n}\n"],"names":[],"mappings":";;;;;;;;AAMgB,SAAA,kBAAkB,CAIhC,QAA+D,EAC/D,gBAC4D,EAAA;AAG5D,IAAA,MAAM,MAAM,GAAG;AACb,QAAA,IAAI,gBAAgB,IAAI,aAAa,CAAC;AACtC,QAAA,QAAQ,EAAE,YAAY;AACtB,QAAA,GAAG,QAAQ;KACZ;AACD,IAAA,IAAI,MAAM,CAAC,UAAU,KAAK,CAAC,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,K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AAS,EACT,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,0BAA0B,EAC1B,oBAAoB,EACpB,aAAa,EACb,kBAAkB,GACI,EAAA;IACtB,IAAI,yBAAyB,GAAG,CAAC;AACjC,IAAA,IAAI,YAAY,IAAI,SAAS,IAAI,SAAS,EAAE;AAC1C,QAAA,MAAM,KAAK,GAAG,SAAS,GAAG,oBAAoB;AAC9C,QAAA,IAAI,KAAK,GAAG,kBAAkB,EAAE;AAC9B,YAAA,yBAAyB,IAAI,KAAK,GAAG,mBAAmB;;aACnD;YACL,yBAAyB;AACvB,gBAAA,kBAAkB,GAAG,mBAAmB;oBACxC,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,0BAA0B,CAAC;;;IAIxE,OAAO;QACL,KAAK,EAAE,YAAY,GAAG,yBAAyB;QAC/C,MAAM,EAAE,aAAa,GAAG,yBAAyB;QACjD,yBAAyB;KAC1B;AACH;AAEM,SAAU,YAAY,CAC1B,IAA6B,EAAA;IAE7B,OAAO,IAAI,CAAC,EAAE;AAChB;;;;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { COMMON_SETTINGS } from '../../constants/common-settings.js';
|
|
2
|
+
import '../../constants/force-settings.js';
|
|
3
|
+
import '../../constants/graph-settings.js';
|
|
4
|
+
import '../../constants/highlight-settings.js';
|
|
5
|
+
import '../../constants/link-settings.js';
|
|
6
|
+
import '../../constants/node-settings.js';
|
|
7
|
+
|
|
8
|
+
function calculateCurveLinkPositionByNode(xStart, yStart, xEnd, yEnd, sourceNode, targetNode, groupIndex, arrowSize = 0) {
|
|
9
|
+
const sourceRadius = (sourceNode._radius ?? COMMON_SETTINGS.nodeRadius) + (sourceNode._borderWidth ?? 0) * 0.5;
|
|
10
|
+
const targetRadius = (targetNode._radius ?? COMMON_SETTINGS.nodeRadius) + (targetNode._borderWidth ?? 0) * 0.5;
|
|
11
|
+
const effectiveTargetRadius = targetRadius + arrowSize * 0.9;
|
|
12
|
+
const mx = (xStart + xEnd) * 0.5;
|
|
13
|
+
const my = (yStart + yEnd) * 0.5;
|
|
14
|
+
const dx = xEnd - xStart;
|
|
15
|
+
const dy = yEnd - yStart;
|
|
16
|
+
const lenSq = dx * dx + dy * dy;
|
|
17
|
+
const len = lenSq > 0 ? Math.sqrt(lenSq) : 1;
|
|
18
|
+
const nx = -dy / len;
|
|
19
|
+
const ny = dx / len;
|
|
20
|
+
const offset = 0.12 * len * groupIndex;
|
|
21
|
+
const xControl = mx + nx * offset;
|
|
22
|
+
const yControl = my + ny * offset;
|
|
23
|
+
const [xStartP, yStartP] = adjustPoint(xStart, yStart, xControl, yControl, sourceRadius);
|
|
24
|
+
const [xEndP, yEndP] = adjustPoint(xEnd, yEnd, xControl, yControl, effectiveTargetRadius);
|
|
25
|
+
const [xEndArrow, yEndArrow] = adjustPoint(xEnd, yEnd, xControl, yControl, targetRadius);
|
|
26
|
+
return {
|
|
27
|
+
xStart: xStartP,
|
|
28
|
+
yStart: yStartP,
|
|
29
|
+
xEnd: xEndP,
|
|
30
|
+
yEnd: yEndP,
|
|
31
|
+
xControl,
|
|
32
|
+
yControl,
|
|
33
|
+
xEndArrow,
|
|
34
|
+
yEndArrow,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function adjustPoint(x, y, xControl, yControl, radius) {
|
|
38
|
+
const dxToControl = xControl - x;
|
|
39
|
+
const dyToControl = yControl - y;
|
|
40
|
+
const distToControl = Math.sqrt(dxToControl * dxToControl + dyToControl * dyToControl) || 1;
|
|
41
|
+
return [x + (dxToControl / distToControl) * radius, y + (dyToControl / distToControl) * radius];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { calculateCurveLinkPositionByNode };
|
|
45
|
+
//# sourceMappingURL=calculate-curve-link-position-by-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calculate-curve-link-position-by-node.js","sources":["../../../../../../src/module/GraphCanvas/lib/utils/calculate-curve-link-position-by-node.ts"],"sourcesContent":["import { COMMON_SETTINGS } from \"../../constants\";\nimport type { NodeInterface } from \"../../types\";\n\nexport function calculateCurveLinkPositionByNode<NodeData extends Record<string, unknown>>(\n xStart: number,\n yStart: number,\n xEnd: number,\n yEnd: number,\n sourceNode: NodeInterface<NodeData>,\n targetNode: NodeInterface<NodeData>,\n groupIndex: number,\n arrowSize: number = 0,\n) {\n const sourceRadius =\n (sourceNode._radius ?? COMMON_SETTINGS.nodeRadius) + (sourceNode._borderWidth ?? 0) * 0.5;\n const targetRadius =\n (targetNode._radius ?? COMMON_SETTINGS.nodeRadius) + (targetNode._borderWidth ?? 0) * 0.5;\n const effectiveTargetRadius = targetRadius + arrowSize * 0.9;\n\n const mx = (xStart + xEnd) * 0.5;\n const my = (yStart + yEnd) * 0.5;\n const dx = xEnd - xStart;\n const dy = yEnd - yStart;\n const lenSq = dx * dx + dy * dy;\n const len = lenSq > 0 ? Math.sqrt(lenSq) : 1;\n\n const nx = -dy / len;\n const ny = dx / len;\n\n const offset = 0.12 * len * groupIndex;\n\n const xControl = mx + nx * offset;\n const yControl = my + ny * offset;\n\n const [xStartP, yStartP] = adjustPoint(xStart, yStart, xControl, yControl, sourceRadius);\n const [xEndP, yEndP] = adjustPoint(xEnd, yEnd, xControl, yControl, effectiveTargetRadius);\n const [xEndArrow, yEndArrow] = adjustPoint(xEnd, yEnd, xControl, yControl, targetRadius);\n\n return {\n xStart: xStartP,\n yStart: yStartP,\n xEnd: xEndP,\n yEnd: yEndP,\n xControl,\n yControl,\n xEndArrow,\n yEndArrow,\n };\n}\n\nfunction adjustPoint(\n x: number,\n y: number,\n xControl: number,\n yControl: number,\n radius: number,\n): [number, number] {\n const dxToControl = xControl - x;\n const dyToControl = yControl - y;\n const distToControl = Math.sqrt(dxToControl * dxToControl + dyToControl * dyToControl) || 1;\n\n return [x + (dxToControl / distToControl) * radius, y + (dyToControl / distToControl) * radius];\n}\n"],"names":[],"mappings":";;;;;;;SAGgB,gCAAgC,CAC9C,MA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