@html-graph/html-graph 9.0.0 → 9.2.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.
@@ -187,6 +187,7 @@ export declare class CanvasBuilder {
187
187
  private backgroundConfig;
188
188
  private connectablePortsConfig;
189
189
  private draggableEdgesConfig;
190
+ private rectangularSelectionConfig;
190
191
  private virtualScrollConfig;
191
192
  private layoutConfig;
192
193
  private animatedLayoutConfig;
@@ -199,6 +200,7 @@ export declare class CanvasBuilder {
199
200
  private hasBackground;
200
201
  private hasUserConnectablePorts;
201
202
  private hasUserDraggableEdges;
203
+ private hasRectangularSelection;
202
204
  private hasAnimatedLayout;
203
205
  private hasLayout;
204
206
  private readonly boxRenderingTrigger;
@@ -215,6 +217,7 @@ export declare class CanvasBuilder {
215
217
  enableBackground(config?: BackgroundConfig | undefined): CanvasBuilder;
216
218
  enableUserConnectablePorts(config?: ConnectablePortsConfig | undefined): CanvasBuilder;
217
219
  enableUserDraggableEdges(config?: DraggableEdgesConfig | undefined): CanvasBuilder;
220
+ enableRectangularSelection(config?: RectangularSelectionConfig | undefined): CanvasBuilder;
218
221
  enableLayout(config?: LayoutConfig | undefined): CanvasBuilder;
219
222
  enableAnimatedLayout(config?: AnimatedLayoutConfig | undefined): CanvasBuilder;
220
223
  enableUserSelectableNodes(config: UserSelectableNodesConfig): CanvasBuilder;
@@ -259,13 +262,15 @@ export declare interface CenterConfig {
259
262
  export declare type CenterFn = (width: number, height: number) => Point;
260
263
 
261
264
  export declare interface ConnectablePortsConfig {
262
- readonly edgeShape?: EdgeShapeConfig;
263
- readonly connectionTypeResolver?: ConnectionTypeResolver;
264
- readonly connectionAllowedVerifier?: ConnectionAllowedVerifier;
265
- readonly connectionPreprocessor?: ConnectionPreprocessor;
266
- readonly mouseDownEventVerifier?: MouseEventVerifier;
267
- readonly mouseUpEventVerifier?: MouseEventVerifier;
268
- readonly dragPortDirection?: DraggingPortDirectionConfig;
265
+ readonly edgeShape?: EdgeShapeConfig | undefined;
266
+ readonly connectionTypeResolver?: ConnectionTypeResolver | undefined;
267
+ readonly connectionAllowedVerifier?: ConnectionAllowedVerifier | undefined;
268
+ readonly connectionPreprocessor?: ConnectionPreprocessor | undefined;
269
+ readonly mouseDownEventVerifier?: MouseEventVerifier | undefined;
270
+ readonly mouseUpEventVerifier?: MouseEventVerifier | undefined;
271
+ readonly dragPortDirection?: DraggingPortDirectionConfig | undefined;
272
+ readonly grabbedPortIdResolver?: PortIdResolver | undefined;
273
+ readonly releasedPortIdResolver?: PortIdResolver | undefined;
269
274
  readonly events?: {
270
275
  readonly onAfterEdgeCreated?: (edgeId: Identifier) => void;
271
276
  readonly onEdgeCreationInterrupted?: (params: EdgeCreationInProgressParams) => void;
@@ -343,13 +348,15 @@ declare interface DotsRenderer {
343
348
  }
344
349
 
345
350
  export declare interface DraggableEdgesConfig {
346
- readonly connectionPreprocessor?: ConnectionPreprocessor;
347
- readonly connectionAllowedVerifier?: ConnectionAllowedVerifier;
348
- readonly mouseDownEventVerifier?: MouseEventVerifier;
349
- readonly mouseUpEventVerifier?: MouseEventVerifier;
350
- readonly draggingEdgeResolver?: DraggingEdgeResolver;
351
- readonly draggingEdgeShape?: EdgeShapeConfig;
352
- readonly dragPortDirection?: DraggingPortDirectionConfig;
351
+ readonly connectionPreprocessor?: ConnectionPreprocessor | undefined;
352
+ readonly connectionAllowedVerifier?: ConnectionAllowedVerifier | undefined;
353
+ readonly mouseDownEventVerifier?: MouseEventVerifier | undefined;
354
+ readonly mouseUpEventVerifier?: MouseEventVerifier | undefined;
355
+ readonly draggingEdgeResolver?: DraggingEdgeResolver | undefined;
356
+ readonly draggingEdgeShape?: EdgeShapeConfig | undefined;
357
+ readonly dragPortDirection?: DraggingPortDirectionConfig | undefined;
358
+ readonly grabbedPortIdResolver?: PortIdResolver | undefined;
359
+ readonly releasedPortIdResolver?: PortIdResolver | undefined;
353
360
  readonly events?: {
354
361
  readonly onAfterEdgeReattached?: (edgeId: Identifier) => void;
355
362
  readonly onEdgeReattachInterrupted?: (edge: GraphEdge & {
@@ -385,6 +392,8 @@ export declare interface EdgeCreationInProgressParams {
385
392
  readonly isDirect: boolean;
386
393
  }
387
394
 
395
+ export declare type EdgeElement = HTMLElement | SVGSVGElement;
396
+
388
397
  declare interface EdgePath {
389
398
  readonly path: string;
390
399
  readonly midpoint: Point;
@@ -405,7 +414,7 @@ export declare interface EdgeRenderPort {
405
414
  }
406
415
 
407
416
  export declare interface EdgeShape {
408
- readonly element: SVGSVGElement;
417
+ readonly element: EdgeElement;
409
418
  render(params: EdgeRenderParams): void;
410
419
  }
411
420
 
@@ -643,7 +652,7 @@ export declare interface InteractiveEdgeParams {
643
652
 
644
653
  export declare class InteractiveEdgeShape implements StructuredEdgeShape {
645
654
  private readonly baseEdge;
646
- readonly element: SVGSVGElement;
655
+ readonly element: EdgeElement;
647
656
  readonly group: SVGGElement;
648
657
  readonly line: SVGPathElement;
649
658
  readonly sourceArrow: SVGPathElement | null;
@@ -726,7 +735,7 @@ export declare class MidpointEdgeShape implements StructuredEdgeShape {
726
735
  readonly sourceArrow: SVGPathElement | null;
727
736
  readonly targetArrow: SVGPathElement | null;
728
737
  readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
729
- readonly element: SVGSVGElement;
738
+ readonly element: EdgeElement;
730
739
  constructor(baseShape: StructuredEdgeShape, midpointElement: SVGElement);
731
740
  render(params: EdgeRenderParams): void;
732
741
  }
@@ -802,6 +811,8 @@ export declare interface Point {
802
811
 
803
812
  export declare type PortElement = HTMLElement | SVGElement;
804
813
 
814
+ export declare type PortIdResolver = (portIds: readonly Identifier[]) => Identifier | null;
815
+
805
816
  export declare type PortOffset = number | PortOffsetFn | "box";
806
817
 
807
818
  export declare type PortOffsetFn = (params: PortOffsetFnParams) => number;
@@ -820,6 +831,26 @@ export declare interface Radii {
820
831
  readonly vertical: number;
821
832
  }
822
833
 
834
+ declare interface RectangularSelectionConfig {
835
+ readonly rectangleElement?: Element;
836
+ readonly mouseDownEventVerifier?: MouseEventVerifier;
837
+ readonly mouseUpEventVerifier?: MouseEventVerifier;
838
+ readonly onSelectionStarted?: () => void;
839
+ readonly onSelectionChange?: (selectionRectangle: DOMRect) => void;
840
+ readonly onSelectionInterrupted?: (selectionRectangle: DOMRect) => void;
841
+ readonly onSelectionFinished?: (selectionRectangle: DOMRect) => void;
842
+ }
843
+
844
+ export declare interface RectangularSelectionParams {
845
+ readonly rectangleElement: Element;
846
+ readonly mouseDownEventVerifier: MouseEventVerifier;
847
+ readonly mouseUpEventVerifier: MouseEventVerifier;
848
+ readonly onSelectionStarted: () => void;
849
+ readonly onSelectionChange: (selectionRectangle: DOMRect) => void;
850
+ readonly onSelectionInterrupted: (selectionRectangle: DOMRect) => void;
851
+ readonly onSelectionFinished: (selectionRectangle: DOMRect) => void;
852
+ }
853
+
823
854
  export declare interface ScaleLimitPreprocessorParams {
824
855
  readonly minContentScale: number | null;
825
856
  readonly maxContentScale: number | null;
@@ -1044,7 +1075,7 @@ declare class ViewportController {
1044
1075
  constructor(graphStore: GraphStore, viewportStore: ViewportStore, params: ViewportControllerParams, win: Window);
1045
1076
  patchViewportMatrix(request: PatchMatrixRequest): void;
1046
1077
  patchContentMatrix(request: PatchMatrixRequest): void;
1047
- center(target: Point, config?: CenterConfig | undefined): void;
1078
+ center(target: Point, config: CenterConfig | undefined): void;
1048
1079
  focus(config?: FocusConfig | undefined): void;
1049
1080
  destroy(): void;
1050
1081
  private navigate;