@html-graph/html-graph 6.0.0 → 7.0.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.
@@ -47,7 +47,20 @@ export declare interface AnimatedLayoutAlgorithm {
47
47
  }
48
48
 
49
49
  export declare interface AnimatedLayoutConfig {
50
- readonly algorithm: AnimatedLayoutAlgorithm;
50
+ readonly algorithm?: {
51
+ readonly type: "custom";
52
+ readonly instance: AnimatedLayoutAlgorithm;
53
+ } | {
54
+ readonly type?: "forceDirected";
55
+ readonly maxTimeDeltaSec?: number;
56
+ readonly nodeCharge?: number;
57
+ readonly nodeMass?: number;
58
+ readonly edgeEquilibriumLength?: number;
59
+ readonly edgeStiffness?: number;
60
+ readonly seed?: string;
61
+ readonly effectiveDistance?: number;
62
+ readonly convergenceDelta?: number;
63
+ } | undefined;
51
64
  }
52
65
 
53
66
  export declare type ArrowRenderer = (params: ArrowRenderingParams) => string;
@@ -241,6 +254,8 @@ export declare class CanvasBuilder {
241
254
  private hasBackground;
242
255
  private hasUserConnectablePorts;
243
256
  private hasUserDraggableEdges;
257
+ private hasAnimatedLayout;
258
+ private hasLayout;
244
259
  private readonly boxRenderingTrigger;
245
260
  private readonly graphStore;
246
261
  private readonly viewportStore;
@@ -285,11 +300,11 @@ export declare class CanvasBuilder {
285
300
  /**
286
301
  * enables nodes positioning with specified layout
287
302
  */
288
- enableLayout(config: LayoutConfig): CanvasBuilder;
303
+ enableLayout(config?: LayoutConfig): CanvasBuilder;
289
304
  /**
290
305
  * enables animated nodes positioning with specified layout
291
306
  */
292
- enableAnimatedLayout(config: AnimatedLayoutConfig): CanvasBuilder;
307
+ enableAnimatedLayout(config?: AnimatedLayoutConfig): CanvasBuilder;
293
308
  /**
294
309
  * builds final canvas
295
310
  */
@@ -711,13 +726,30 @@ export declare interface LayoutAlgorithm {
711
726
  calculateCoordinates(graph: Graph): ReadonlyMap<Identifier, Point>;
712
727
  }
713
728
 
729
+ declare type LayoutAlgorithmConfig = {
730
+ readonly type: "custom";
731
+ readonly instance: LayoutAlgorithm;
732
+ } | {
733
+ readonly type: "forceDirected";
734
+ readonly dtSec?: number;
735
+ readonly maxIterations?: number;
736
+ readonly seed?: string;
737
+ readonly maxTimeDeltaSec?: number;
738
+ readonly nodeCharge?: number;
739
+ readonly nodeMass?: number;
740
+ readonly edgeEquilibriumLength?: number;
741
+ readonly edgeStiffness?: number;
742
+ readonly effectiveDistance?: number;
743
+ readonly convergenceDelta?: number;
744
+ };
745
+
714
746
  export declare type LayoutApplyOn = {
715
747
  type: "topologyChangeTimeout";
716
748
  } | EventSubject<void>;
717
749
 
718
750
  export declare interface LayoutConfig {
719
- readonly algorithm: LayoutAlgorithm;
720
- readonly applyOn: LayoutApplyOn;
751
+ readonly algorithm?: LayoutAlgorithmConfig | undefined;
752
+ readonly applyOn?: LayoutApplyOn | undefined;
721
753
  }
722
754
 
723
755
  export declare type MarkNodePortRequest = {