@html-graph/html-graph 8.24.0 → 9.1.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
  };
@@ -292,13 +259,15 @@ export declare interface CenterConfig {
292
259
  export declare type CenterFn = (width: number, height: number) => Point;
293
260
 
294
261
  export declare interface ConnectablePortsConfig {
295
- readonly edgeShape?: EdgeShapeConfig;
296
- readonly connectionTypeResolver?: ConnectionTypeResolver;
297
- readonly connectionAllowedVerifier?: ConnectionAllowedVerifier;
298
- readonly connectionPreprocessor?: ConnectionPreprocessor;
299
- readonly mouseDownEventVerifier?: MouseEventVerifier;
300
- readonly mouseUpEventVerifier?: MouseEventVerifier;
301
- readonly dragPortDirection?: DraggingPortDirectionConfig;
262
+ readonly edgeShape?: EdgeShapeConfig | undefined;
263
+ readonly connectionTypeResolver?: ConnectionTypeResolver | undefined;
264
+ readonly connectionAllowedVerifier?: ConnectionAllowedVerifier | undefined;
265
+ readonly connectionPreprocessor?: ConnectionPreprocessor | undefined;
266
+ readonly mouseDownEventVerifier?: MouseEventVerifier | undefined;
267
+ readonly mouseUpEventVerifier?: MouseEventVerifier | undefined;
268
+ readonly dragPortDirection?: DraggingPortDirectionConfig | undefined;
269
+ readonly grabbedPortIdResolver?: PortIdResolver | undefined;
270
+ readonly releasedPortIdResolver?: PortIdResolver | undefined;
302
271
  readonly events?: {
303
272
  readonly onAfterEdgeCreated?: (edgeId: Identifier) => void;
304
273
  readonly onEdgeCreationInterrupted?: (params: EdgeCreationInProgressParams) => void;
@@ -319,13 +288,7 @@ export declare enum ConnectionCategory {
319
288
  PortCycle = "port-cycle"
320
289
  }
321
290
 
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;
291
+ export declare type ConnectionPreprocessor = (request: AddEdgeRequest) => AddEdgeRequest;
329
292
 
330
293
  export declare type ConnectionTypeResolver = (portId: Identifier) => "direct" | "reverse" | null;
331
294
 
@@ -355,7 +318,6 @@ export declare interface DirectEdgeParams {
355
318
 
356
319
  export declare class DirectEdgeShape implements StructuredEdgeShape {
357
320
  readonly element: SVGSVGElement;
358
- readonly svg: SVGSVGElement;
359
321
  readonly group: SVGGElement;
360
322
  readonly line: SVGPathElement;
361
323
  readonly sourceArrow: SVGPathElement | null;
@@ -383,13 +345,15 @@ declare interface DotsRenderer {
383
345
  }
384
346
 
385
347
  export declare interface DraggableEdgesConfig {
386
- readonly connectionPreprocessor?: ConnectionPreprocessor;
387
- readonly connectionAllowedVerifier?: ConnectionAllowedVerifier;
388
- readonly mouseDownEventVerifier?: MouseEventVerifier;
389
- readonly mouseUpEventVerifier?: MouseEventVerifier;
390
- readonly draggingEdgeResolver?: DraggingEdgeResolver;
391
- readonly draggingEdgeShape?: EdgeShapeConfig;
392
- readonly dragPortDirection?: DraggingPortDirectionConfig;
348
+ readonly connectionPreprocessor?: ConnectionPreprocessor | undefined;
349
+ readonly connectionAllowedVerifier?: ConnectionAllowedVerifier | undefined;
350
+ readonly mouseDownEventVerifier?: MouseEventVerifier | undefined;
351
+ readonly mouseUpEventVerifier?: MouseEventVerifier | undefined;
352
+ readonly draggingEdgeResolver?: DraggingEdgeResolver | undefined;
353
+ readonly draggingEdgeShape?: EdgeShapeConfig | undefined;
354
+ readonly dragPortDirection?: DraggingPortDirectionConfig | undefined;
355
+ readonly grabbedPortIdResolver?: PortIdResolver | undefined;
356
+ readonly releasedPortIdResolver?: PortIdResolver | undefined;
393
357
  readonly events?: {
394
358
  readonly onAfterEdgeReattached?: (edgeId: Identifier) => void;
395
359
  readonly onEdgeReattachInterrupted?: (edge: GraphEdge & {
@@ -418,12 +382,7 @@ export declare interface DraggableNodesConfig {
418
382
 
419
383
  export declare type DraggingEdgeResolver = (portId: Identifier) => Identifier | null;
420
384
 
421
- export declare type DraggingPortDirectionConfig = number | undefined
422
- /**
423
- * @deprecated
424
- * use "nearest-connectable-port" instead
425
- */
426
- | "closest-connectable-port" | "nearest-connectable-port";
385
+ export declare type DraggingPortDirectionConfig = number | "inherit" | "nearest-connectable-port";
427
386
 
428
387
  export declare interface EdgeCreationInProgressParams {
429
388
  readonly staticPortId: Identifier;
@@ -450,16 +409,11 @@ export declare interface EdgeRenderPort {
450
409
  }
451
410
 
452
411
  export declare interface EdgeShape {
453
- /**
454
- * @deprecated
455
- * use element instead
456
- */
457
- readonly svg: SVGSVGElement;
458
412
  readonly element: SVGSVGElement;
459
413
  render(params: EdgeRenderParams): void;
460
414
  }
461
415
 
462
- declare type EdgeShapeConfig = BezierEdgeShapeConfig | StraightEdgeShapeConfig | HorizontalEdgeShapeConfig | VerticalEdgeShapeConfig | DirectEdgeShapeConfig | OrthogonalEdgeShapeConfig | EdgeShapeFactory;
416
+ declare type EdgeShapeConfig = BezierEdgeShapeConfig | StraightEdgeShapeConfig | DirectEdgeShapeConfig | OrthogonalEdgeShapeConfig | EdgeShapeFactory;
463
417
 
464
418
  declare type EdgeShapeFactory = (edgeId: Identifier) => EdgeShape;
465
419
 
@@ -481,11 +435,6 @@ export declare class EventSubject<T> implements EventEmitter<T>, EventHandler<T>
481
435
 
482
436
  export declare type FocusConfig = {
483
437
  readonly contentPadding?: number | undefined;
484
- /**
485
- * @deprecated
486
- * use contentPadding instead
487
- */
488
- readonly contentOffset?: number | undefined;
489
438
  readonly nodes?: Iterable<Identifier> | undefined;
490
439
  readonly minContentScale?: number | undefined;
491
440
  readonly animationDuration?: number | undefined;
@@ -670,58 +619,6 @@ declare class GraphStore {
670
619
  private removeEdgeInternal;
671
620
  }
672
621
 
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
622
  declare interface HtmlView {
726
623
  attachNode(nodeId: Identifier): void;
727
624
  detachNode(nodeId: Identifier): void;
@@ -751,16 +648,11 @@ export declare interface InteractiveEdgeParams {
751
648
  export declare class InteractiveEdgeShape implements StructuredEdgeShape {
752
649
  private readonly baseEdge;
753
650
  readonly element: SVGSVGElement;
754
- readonly svg: SVGSVGElement;
755
651
  readonly group: SVGGElement;
756
652
  readonly line: SVGPathElement;
757
653
  readonly sourceArrow: SVGPathElement | null;
758
654
  readonly targetArrow: SVGPathElement | null;
759
- /**
760
- * @deprecated
761
- * use shape.svg instead
762
- */
763
- readonly handle: SVGGElement;
655
+ private readonly handle;
764
656
  readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
765
657
  private readonly interactiveLine;
766
658
  private readonly interactiveSourceArrow;
@@ -785,7 +677,7 @@ declare type LayoutAlgorithmConfig = {
785
677
  readonly nodeMass?: number | undefined;
786
678
  readonly edgeEquilibriumLength?: number | undefined;
787
679
  readonly edgeStiffness?: number | undefined;
788
- readonly convergenceVelocity?: number | undefined;
680
+ readonly stopVelocity?: number | undefined;
789
681
  readonly maxForce?: number | undefined;
790
682
  readonly nodeForceCoefficient?: number | undefined;
791
683
  readonly barnesHut?: {
@@ -805,7 +697,7 @@ export declare interface LayoutAlgorithmParams {
805
697
  readonly viewport: Viewport;
806
698
  }
807
699
 
808
- export declare type LayoutApplyOn = TopologyChangeMacrotask | TopologyChangeMicrotask | "topologyChangeMicrotask" | EventSubject<void>;
700
+ export declare type LayoutApplyOn = "topologyChangeMicrotask" | EventSubject<void>;
809
701
 
810
702
  export declare interface LayoutConfig {
811
703
  readonly algorithm?: LayoutAlgorithmConfig | undefined;
@@ -839,7 +731,6 @@ export declare class MidpointEdgeShape implements StructuredEdgeShape {
839
731
  readonly targetArrow: SVGPathElement | null;
840
732
  readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
841
733
  readonly element: SVGSVGElement;
842
- readonly svg: SVGSVGElement;
843
734
  constructor(baseShape: StructuredEdgeShape, midpointElement: SVGElement);
844
735
  render(params: EdgeRenderParams): void;
845
736
  }
@@ -872,7 +763,6 @@ export declare interface OrthogonalEdgeParams {
872
763
 
873
764
  export declare class OrthogonalEdgeShape implements StructuredEdgeShape {
874
765
  readonly element: SVGSVGElement;
875
- readonly svg: SVGSVGElement;
876
766
  readonly group: SVGGElement;
877
767
  readonly line: SVGPathElement;
878
768
  readonly sourceArrow: SVGPathElement | null;
@@ -916,6 +806,8 @@ export declare interface Point {
916
806
 
917
807
  export declare type PortElement = HTMLElement | SVGElement;
918
808
 
809
+ export declare type PortIdResolver = (portIds: readonly Identifier[]) => Identifier | null;
810
+
919
811
  export declare type PortOffset = number | PortOffsetFn | "box";
920
812
 
921
813
  export declare type PortOffsetFn = (params: PortOffsetFnParams) => number;
@@ -992,7 +884,6 @@ export declare interface StraightEdgeParams {
992
884
 
993
885
  export declare class StraightEdgeShape implements StructuredEdgeShape {
994
886
  readonly element: SVGSVGElement;
995
- readonly svg: SVGSVGElement;
996
887
  readonly group: SVGGElement;
997
888
  readonly line: SVGPathElement;
998
889
  readonly sourceArrow: SVGPathElement | null;
@@ -1032,18 +923,6 @@ export declare interface StructuredEdgeShape extends EdgeShape {
1032
923
  readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
1033
924
  }
1034
925
 
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
926
  export declare type TransformDeclaration = {
1048
927
  readonly a?: number | undefined;
1049
928
  readonly b?: number | undefined;
@@ -1081,17 +960,17 @@ export declare type TransformPreprocessorFn = (params: TransformPreprocessorPara
1081
960
  export declare interface TransformPreprocessorParams {
1082
961
  readonly prevTransform: TransformState;
1083
962
  readonly nextTransform: TransformState;
1084
- readonly canvasWidth: number;
1085
- readonly canvasHeight: number;
963
+ readonly viewport: {
964
+ readonly width: number;
965
+ readonly height: number;
966
+ };
1086
967
  }
1087
968
 
1088
- declare interface TransformState {
969
+ export declare interface TransformState {
1089
970
  readonly scale: number;
1090
971
  readonly x: number;
1091
972
  readonly y: number;
1092
973
  }
1093
- export { TransformState as TransformPayload }
1094
- export { TransformState }
1095
974
 
1096
975
  export declare interface UpdateEdgeRequest {
1097
976
  readonly from?: Identifier | undefined;
@@ -1150,58 +1029,6 @@ export declare interface UserSelectableNodesConfig {
1150
1029
  readonly movementThreshold?: number | undefined;
1151
1030
  }
1152
1031
 
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
1032
  export declare class Viewport {
1206
1033
  private readonly viewportStore;
1207
1034
  readonly onBeforeUpdated: EventHandler<void>;
@@ -1267,7 +1094,7 @@ export declare interface ViewportTransformConfig {
1267
1094
  readonly mouseWheelEventVerifier?: (event: WheelEvent) => boolean;
1268
1095
  readonly wheelFinishTimeout?: number;
1269
1096
  };
1270
- readonly shift?: {
1097
+ readonly pan?: {
1271
1098
  readonly cursor?: string | null;
1272
1099
  readonly mouseDownEventVerifier?: MouseEventVerifier;
1273
1100
  readonly mouseUpEventVerifier?: MouseEventVerifier;