@html-graph/html-graph 8.24.0 → 9.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.
@@ -57,7 +57,7 @@ export declare type AnimatedLayoutAlgorithmConfig = {
57
57
  readonly edgeEquilibriumLength?: number;
58
58
  readonly edgeStiffness?: number;
59
59
  readonly seed?: string;
60
- readonly convergenceVelocity?: number;
60
+ readonly stopVelocity?: number;
61
61
  readonly maxForce?: number;
62
62
  readonly nodeForceCoefficient?: number;
63
63
  readonly barnesHut?: {
@@ -127,7 +127,6 @@ export declare interface BezierEdgeParams {
127
127
 
128
128
  export declare class BezierEdgeShape implements StructuredEdgeShape {
129
129
  readonly element: SVGSVGElement;
130
- readonly svg: SVGSVGElement;
131
130
  readonly group: SVGGElement;
132
131
  readonly line: SVGPathElement;
133
132
  readonly sourceArrow: SVGPathElement | null;
@@ -153,8 +152,6 @@ declare type BezierEdgeShapeConfig = {
153
152
  readonly type?: "bezier" | undefined;
154
153
  } & BezierEdgeParams;
155
154
 
156
- export declare const boxPortOffsetFn: PortOffsetFn;
157
-
158
155
  export declare class Canvas {
159
156
  readonly graph: Graph;
160
157
  readonly viewport: Viewport;
@@ -232,49 +229,19 @@ export declare class CanvasBuilderError extends Error {
232
229
  }
233
230
 
234
231
  export declare interface CanvasDefaults {
235
- /**
236
- * nodes related behavior
237
- */
238
232
  readonly nodes?: {
239
- /**
240
- * specifies how to determine center of node
241
- * center of nodes specified in addNode method by x and y
242
- */
243
233
  readonly centerFn?: CenterFn;
244
- /**
245
- * specifies default z-index value
246
- */
247
234
  readonly priority?: Priority;
248
235
  };
249
- /**
250
- * ports related behavior
251
- */
252
236
  readonly ports?: {
253
- /**
254
- * specifies default direction of port
255
- */
256
237
  readonly direction?: number;
257
238
  };
258
- /**
259
- *edges related behavior
260
- */
261
239
  readonly edges?: {
262
- /**
263
- * specifies default controller
264
- */
265
240
  readonly shape?: EdgeShapeConfig;
266
- /**
267
- * specifies default z-index value
268
- */
269
241
  readonly priority?: Priority;
270
242
  };
271
243
  readonly focus?: {
272
244
  readonly contentPadding?: number;
273
- /**
274
- * @deprecated
275
- * use contentPadding instead
276
- */
277
- readonly contentOffset?: number;
278
245
  readonly minContentScale?: number;
279
246
  readonly animationDuration?: number;
280
247
  };
@@ -319,13 +286,7 @@ export declare enum ConnectionCategory {
319
286
  PortCycle = "port-cycle"
320
287
  }
321
288
 
322
- export declare type ConnectionPreprocessor = (request: AddEdgeRequest) => AddEdgeRequest | ConnectionPreprocessorNullResponse;
323
-
324
- /**
325
- * @deprecated
326
- * connection preprocessor should not return null
327
- */
328
- declare type ConnectionPreprocessorNullResponse = null;
289
+ export declare type ConnectionPreprocessor = (request: AddEdgeRequest) => AddEdgeRequest;
329
290
 
330
291
  export declare type ConnectionTypeResolver = (portId: Identifier) => "direct" | "reverse" | null;
331
292
 
@@ -355,7 +316,6 @@ export declare interface DirectEdgeParams {
355
316
 
356
317
  export declare class DirectEdgeShape implements StructuredEdgeShape {
357
318
  readonly element: SVGSVGElement;
358
- readonly svg: SVGSVGElement;
359
319
  readonly group: SVGGElement;
360
320
  readonly line: SVGPathElement;
361
321
  readonly sourceArrow: SVGPathElement | null;
@@ -418,12 +378,7 @@ export declare interface DraggableNodesConfig {
418
378
 
419
379
  export declare type DraggingEdgeResolver = (portId: Identifier) => Identifier | null;
420
380
 
421
- export declare type DraggingPortDirectionConfig = number | undefined
422
- /**
423
- * @deprecated
424
- * use "nearest-connectable-port" instead
425
- */
426
- | "closest-connectable-port" | "nearest-connectable-port";
381
+ export declare type DraggingPortDirectionConfig = number | "inherit" | "nearest-connectable-port";
427
382
 
428
383
  export declare interface EdgeCreationInProgressParams {
429
384
  readonly staticPortId: Identifier;
@@ -450,16 +405,11 @@ export declare interface EdgeRenderPort {
450
405
  }
451
406
 
452
407
  export declare interface EdgeShape {
453
- /**
454
- * @deprecated
455
- * use element instead
456
- */
457
- readonly svg: SVGSVGElement;
458
408
  readonly element: SVGSVGElement;
459
409
  render(params: EdgeRenderParams): void;
460
410
  }
461
411
 
462
- declare type EdgeShapeConfig = BezierEdgeShapeConfig | StraightEdgeShapeConfig | HorizontalEdgeShapeConfig | VerticalEdgeShapeConfig | DirectEdgeShapeConfig | OrthogonalEdgeShapeConfig | EdgeShapeFactory;
412
+ declare type EdgeShapeConfig = BezierEdgeShapeConfig | StraightEdgeShapeConfig | DirectEdgeShapeConfig | OrthogonalEdgeShapeConfig | EdgeShapeFactory;
463
413
 
464
414
  declare type EdgeShapeFactory = (edgeId: Identifier) => EdgeShape;
465
415
 
@@ -481,11 +431,6 @@ export declare class EventSubject<T> implements EventEmitter<T>, EventHandler<T>
481
431
 
482
432
  export declare type FocusConfig = {
483
433
  readonly contentPadding?: number | undefined;
484
- /**
485
- * @deprecated
486
- * use contentPadding instead
487
- */
488
- readonly contentOffset?: number | undefined;
489
434
  readonly nodes?: Iterable<Identifier> | undefined;
490
435
  readonly minContentScale?: number | undefined;
491
436
  readonly animationDuration?: number | undefined;
@@ -670,58 +615,6 @@ declare class GraphStore {
670
615
  private removeEdgeInternal;
671
616
  }
672
617
 
673
- /**
674
- * @deprecated
675
- * use OrthogonalEdgeShape instead
676
- */
677
- export declare interface HorizontalEdgeParams {
678
- readonly color?: string | undefined;
679
- readonly width?: number | undefined;
680
- readonly arrowLength?: number | undefined;
681
- readonly arrowRenderer?: ArrowRendererConfig | undefined;
682
- readonly arrowOffset?: number | undefined;
683
- readonly hasSourceArrow?: boolean | undefined;
684
- readonly hasTargetArrow?: boolean | undefined;
685
- readonly cycleSquareSide?: number | undefined;
686
- readonly roundness?: number | undefined;
687
- readonly detourDistance?: number | undefined;
688
- }
689
-
690
- /**
691
- * @deprecated
692
- * use OrthogonalEdgeShape instead
693
- */
694
- export declare class HorizontalEdgeShape implements StructuredEdgeShape {
695
- readonly element: SVGSVGElement;
696
- readonly svg: SVGSVGElement;
697
- readonly group: SVGGElement;
698
- readonly line: SVGPathElement;
699
- readonly sourceArrow: SVGPathElement | null;
700
- readonly targetArrow: SVGPathElement | null;
701
- readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
702
- private readonly arrowLength;
703
- private readonly arrowOffset;
704
- private readonly roundness;
705
- private readonly cycleSquareSide;
706
- private readonly detourDistance;
707
- private readonly hasSourceArrow;
708
- private readonly hasTargetArrow;
709
- private readonly pathShape;
710
- private readonly createCyclePath;
711
- private readonly createDetourPath;
712
- private readonly createLinePath;
713
- constructor(params?: HorizontalEdgeParams);
714
- render(params: EdgeRenderParams): void;
715
- }
716
-
717
- /**
718
- * @deprecated
719
- * use type: "orthogonal" instead
720
- */
721
- declare type HorizontalEdgeShapeConfig = {
722
- readonly type: "horizontal";
723
- } & HorizontalEdgeParams;
724
-
725
618
  declare interface HtmlView {
726
619
  attachNode(nodeId: Identifier): void;
727
620
  detachNode(nodeId: Identifier): void;
@@ -751,16 +644,11 @@ export declare interface InteractiveEdgeParams {
751
644
  export declare class InteractiveEdgeShape implements StructuredEdgeShape {
752
645
  private readonly baseEdge;
753
646
  readonly element: SVGSVGElement;
754
- readonly svg: SVGSVGElement;
755
647
  readonly group: SVGGElement;
756
648
  readonly line: SVGPathElement;
757
649
  readonly sourceArrow: SVGPathElement | null;
758
650
  readonly targetArrow: SVGPathElement | null;
759
- /**
760
- * @deprecated
761
- * use shape.svg instead
762
- */
763
- readonly handle: SVGGElement;
651
+ private readonly handle;
764
652
  readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
765
653
  private readonly interactiveLine;
766
654
  private readonly interactiveSourceArrow;
@@ -785,7 +673,7 @@ declare type LayoutAlgorithmConfig = {
785
673
  readonly nodeMass?: number | undefined;
786
674
  readonly edgeEquilibriumLength?: number | undefined;
787
675
  readonly edgeStiffness?: number | undefined;
788
- readonly convergenceVelocity?: number | undefined;
676
+ readonly stopVelocity?: number | undefined;
789
677
  readonly maxForce?: number | undefined;
790
678
  readonly nodeForceCoefficient?: number | undefined;
791
679
  readonly barnesHut?: {
@@ -805,7 +693,7 @@ export declare interface LayoutAlgorithmParams {
805
693
  readonly viewport: Viewport;
806
694
  }
807
695
 
808
- export declare type LayoutApplyOn = TopologyChangeMacrotask | TopologyChangeMicrotask | "topologyChangeMicrotask" | EventSubject<void>;
696
+ export declare type LayoutApplyOn = "topologyChangeMicrotask" | EventSubject<void>;
809
697
 
810
698
  export declare interface LayoutConfig {
811
699
  readonly algorithm?: LayoutAlgorithmConfig | undefined;
@@ -839,7 +727,6 @@ export declare class MidpointEdgeShape implements StructuredEdgeShape {
839
727
  readonly targetArrow: SVGPathElement | null;
840
728
  readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
841
729
  readonly element: SVGSVGElement;
842
- readonly svg: SVGSVGElement;
843
730
  constructor(baseShape: StructuredEdgeShape, midpointElement: SVGElement);
844
731
  render(params: EdgeRenderParams): void;
845
732
  }
@@ -872,7 +759,6 @@ export declare interface OrthogonalEdgeParams {
872
759
 
873
760
  export declare class OrthogonalEdgeShape implements StructuredEdgeShape {
874
761
  readonly element: SVGSVGElement;
875
- readonly svg: SVGSVGElement;
876
762
  readonly group: SVGGElement;
877
763
  readonly line: SVGPathElement;
878
764
  readonly sourceArrow: SVGPathElement | null;
@@ -992,7 +878,6 @@ export declare interface StraightEdgeParams {
992
878
 
993
879
  export declare class StraightEdgeShape implements StructuredEdgeShape {
994
880
  readonly element: SVGSVGElement;
995
- readonly svg: SVGSVGElement;
996
881
  readonly group: SVGGElement;
997
882
  readonly line: SVGPathElement;
998
883
  readonly sourceArrow: SVGPathElement | null;
@@ -1032,18 +917,6 @@ export declare interface StructuredEdgeShape extends EdgeShape {
1032
917
  readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
1033
918
  }
1034
919
 
1035
- /**
1036
- * @deprecated
1037
- * use "topologyChangeMicrotask" instead
1038
- */
1039
- declare type TopologyChangeMacrotask = {
1040
- type: "topologyChangeMacrotask";
1041
- };
1042
-
1043
- declare type TopologyChangeMicrotask = {
1044
- type: "topologyChangeMicrotask";
1045
- };
1046
-
1047
920
  export declare type TransformDeclaration = {
1048
921
  readonly a?: number | undefined;
1049
922
  readonly b?: number | undefined;
@@ -1081,17 +954,17 @@ export declare type TransformPreprocessorFn = (params: TransformPreprocessorPara
1081
954
  export declare interface TransformPreprocessorParams {
1082
955
  readonly prevTransform: TransformState;
1083
956
  readonly nextTransform: TransformState;
1084
- readonly canvasWidth: number;
1085
- readonly canvasHeight: number;
957
+ readonly viewport: {
958
+ readonly width: number;
959
+ readonly height: number;
960
+ };
1086
961
  }
1087
962
 
1088
- declare interface TransformState {
963
+ export declare interface TransformState {
1089
964
  readonly scale: number;
1090
965
  readonly x: number;
1091
966
  readonly y: number;
1092
967
  }
1093
- export { TransformState as TransformPayload }
1094
- export { TransformState }
1095
968
 
1096
969
  export declare interface UpdateEdgeRequest {
1097
970
  readonly from?: Identifier | undefined;
@@ -1150,58 +1023,6 @@ export declare interface UserSelectableNodesConfig {
1150
1023
  readonly movementThreshold?: number | undefined;
1151
1024
  }
1152
1025
 
1153
- /**
1154
- * @deprecated
1155
- * use OrthogonalEdgeShape instead
1156
- */
1157
- export declare interface VerticalEdgeParams {
1158
- readonly color?: string | undefined;
1159
- readonly width?: number | undefined;
1160
- readonly arrowLength?: number | undefined;
1161
- readonly arrowOffset?: number | undefined;
1162
- readonly arrowRenderer?: ArrowRendererConfig | undefined;
1163
- readonly hasSourceArrow?: boolean | undefined;
1164
- readonly hasTargetArrow?: boolean | undefined;
1165
- readonly cycleSquareSide?: number | undefined;
1166
- readonly roundness?: number | undefined;
1167
- readonly detourDistance?: number | undefined;
1168
- }
1169
-
1170
- /**
1171
- * @deprecated
1172
- * use OrthogonalEdgeShape instead
1173
- */
1174
- export declare class VerticalEdgeShape implements StructuredEdgeShape {
1175
- readonly element: SVGSVGElement;
1176
- readonly svg: SVGSVGElement;
1177
- readonly group: SVGGElement;
1178
- readonly line: SVGPathElement;
1179
- readonly sourceArrow: SVGPathElement | null;
1180
- readonly targetArrow: SVGPathElement | null;
1181
- readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
1182
- private readonly arrowLength;
1183
- private readonly arrowOffset;
1184
- private readonly roundness;
1185
- private readonly cycleSquareSide;
1186
- private readonly detourDistance;
1187
- private readonly hasSourceArrow;
1188
- private readonly hasTargetArrow;
1189
- private readonly pathShape;
1190
- private readonly createCyclePath;
1191
- private readonly createDetourPath;
1192
- private readonly createLinePath;
1193
- constructor(params?: VerticalEdgeParams);
1194
- render(params: EdgeRenderParams): void;
1195
- }
1196
-
1197
- /**
1198
- * @deprecated
1199
- * use type: "orthogonal" instead
1200
- */
1201
- declare type VerticalEdgeShapeConfig = {
1202
- readonly type: "vertical";
1203
- } & VerticalEdgeParams;
1204
-
1205
1026
  export declare class Viewport {
1206
1027
  private readonly viewportStore;
1207
1028
  readonly onBeforeUpdated: EventHandler<void>;
@@ -1267,7 +1088,7 @@ export declare interface ViewportTransformConfig {
1267
1088
  readonly mouseWheelEventVerifier?: (event: WheelEvent) => boolean;
1268
1089
  readonly wheelFinishTimeout?: number;
1269
1090
  };
1270
- readonly shift?: {
1091
+ readonly pan?: {
1271
1092
  readonly cursor?: string | null;
1272
1093
  readonly mouseDownEventVerifier?: MouseEventVerifier;
1273
1094
  readonly mouseUpEventVerifier?: MouseEventVerifier;