@html-graph/html-graph 8.18.1 → 8.19.0
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/html-graph.d.ts +9 -4
- package/dist/html-graph.js +16 -3
- package/dist/html-graph.min.js +179 -172
- package/dist/html-graph.min.umd.cjs +1 -1
- package/dist/html-graph.umd.cjs +16 -3
- package/package.json +1 -1
package/dist/html-graph.d.ts
CHANGED
|
@@ -413,7 +413,12 @@ export declare interface DraggableNodesConfig {
|
|
|
413
413
|
|
|
414
414
|
export declare type DraggingEdgeResolver = (portId: Identifier) => Identifier | null;
|
|
415
415
|
|
|
416
|
-
export declare type DraggingPortDirectionConfig = number | undefined
|
|
416
|
+
export declare type DraggingPortDirectionConfig = number | undefined
|
|
417
|
+
/**
|
|
418
|
+
* @deprecated
|
|
419
|
+
* use "nearest-connectable-port" instead
|
|
420
|
+
*/
|
|
421
|
+
| "closest-connectable-port" | "nearest-connectable-port";
|
|
417
422
|
|
|
418
423
|
export declare interface EdgeCreationInProgressParams {
|
|
419
424
|
readonly staticPortId: Identifier;
|
|
@@ -729,7 +734,7 @@ export declare class InteractiveEdgeShape implements StructuredEdgeShape {
|
|
|
729
734
|
readonly targetArrow: SVGPathElement | null;
|
|
730
735
|
/**
|
|
731
736
|
* @deprecated
|
|
732
|
-
*
|
|
737
|
+
* use shape.svg instead
|
|
733
738
|
*/
|
|
734
739
|
readonly handle: SVGGElement;
|
|
735
740
|
readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
|
|
@@ -776,7 +781,7 @@ export declare interface LayoutAlgorithmParams {
|
|
|
776
781
|
readonly viewport: Viewport;
|
|
777
782
|
}
|
|
778
783
|
|
|
779
|
-
export declare type LayoutApplyOn = TopologyChangeMacrotask | TopologyChangeMicrotask | EventSubject<void>;
|
|
784
|
+
export declare type LayoutApplyOn = TopologyChangeMacrotask | TopologyChangeMicrotask | "topologyChangeMicrotask" | EventSubject<void>;
|
|
780
785
|
|
|
781
786
|
export declare interface LayoutConfig {
|
|
782
787
|
readonly algorithm?: LayoutAlgorithmConfig | undefined;
|
|
@@ -949,7 +954,7 @@ export declare interface StructuredEdgeShape extends EdgeShape {
|
|
|
949
954
|
|
|
950
955
|
/**
|
|
951
956
|
* @deprecated
|
|
952
|
-
* use topologyChangeMicrotask instead
|
|
957
|
+
* use "topologyChangeMicrotask" instead
|
|
953
958
|
*/
|
|
954
959
|
declare type TopologyChangeMacrotask = {
|
|
955
960
|
type: "topologyChangeMacrotask";
|
package/dist/html-graph.js
CHANGED
|
@@ -2691,7 +2691,7 @@ class InteractiveEdgeShape {
|
|
|
2691
2691
|
// TODO: make private
|
|
2692
2692
|
/**
|
|
2693
2693
|
* @deprecated
|
|
2694
|
-
*
|
|
2694
|
+
* use shape.svg instead
|
|
2695
2695
|
*/
|
|
2696
2696
|
__publicField(this, "handle", createEdgeGroup());
|
|
2697
2697
|
__publicField(this, "onAfterRender");
|
|
@@ -3590,7 +3590,7 @@ const resolveCreateEdgeRequest = (params, targetPortId) => {
|
|
|
3590
3590
|
to: params.isDirect ? targetPortId : params.staticPortId
|
|
3591
3591
|
};
|
|
3592
3592
|
};
|
|
3593
|
-
class
|
|
3593
|
+
class NearestConnectablePortDraggingPortDirectionResolver {
|
|
3594
3594
|
constructor(graph, connectionAllowedVerifier) {
|
|
3595
3595
|
this.graph = graph;
|
|
3596
3596
|
this.connectionAllowedVerifier = connectionAllowedVerifier;
|
|
@@ -5050,7 +5050,13 @@ const noopFn = () => {
|
|
|
5050
5050
|
};
|
|
5051
5051
|
const resolveDraggingPortDirectionResolver = (config, graph, connectionAllowedVerifier) => {
|
|
5052
5052
|
if (config === "closest-connectable-port") {
|
|
5053
|
-
return new
|
|
5053
|
+
return new NearestConnectablePortDraggingPortDirectionResolver(
|
|
5054
|
+
graph,
|
|
5055
|
+
connectionAllowedVerifier
|
|
5056
|
+
);
|
|
5057
|
+
}
|
|
5058
|
+
if (config === "nearest-connectable-port") {
|
|
5059
|
+
return new NearestConnectablePortDraggingPortDirectionResolver(
|
|
5054
5060
|
graph,
|
|
5055
5061
|
connectionAllowedVerifier
|
|
5056
5062
|
);
|
|
@@ -6421,6 +6427,7 @@ const resolveAnimatedLayoutAlgorithm = (config) => {
|
|
|
6421
6427
|
nodeMass: (config == null ? void 0 : config.nodeMass) ?? forceDirectedDefaults.nodeMass,
|
|
6422
6428
|
edgeEquilibriumLength: (config == null ? void 0 : config.edgeEquilibriumLength) ?? forceDirectedDefaults.edgeEquilibriumLength,
|
|
6423
6429
|
edgeStiffness: (config == null ? void 0 : config.edgeStiffness) ?? forceDirectedDefaults.edgeStiffness,
|
|
6430
|
+
// TODO: rename no `minVelocity`
|
|
6424
6431
|
convergenceVelocity: (config == null ? void 0 : config.convergenceVelocity) ?? forceDirectedDefaults.convergenceVelocity,
|
|
6425
6432
|
maxForce: (config == null ? void 0 : config.maxForce) ?? forceDirectedDefaults.maxForce,
|
|
6426
6433
|
nodeForceCoefficient: (config == null ? void 0 : config.nodeForceCoefficient) ?? forceDirectedDefaults.nodeForceCoefficient,
|
|
@@ -6450,6 +6457,12 @@ const resolveLayoutApplyOn = (applyOn) => {
|
|
|
6450
6457
|
trigger: applyOn
|
|
6451
6458
|
};
|
|
6452
6459
|
}
|
|
6460
|
+
if (applyOn === "topologyChangeMicrotask") {
|
|
6461
|
+
return {
|
|
6462
|
+
type: "topologyChangeSchedule",
|
|
6463
|
+
schedule: microtaskScheduleFn
|
|
6464
|
+
};
|
|
6465
|
+
}
|
|
6453
6466
|
if ((applyOn == null ? void 0 : applyOn.type) === "topologyChangeMacrotask") {
|
|
6454
6467
|
return {
|
|
6455
6468
|
type: "topologyChangeSchedule",
|