@html-graph/html-graph 3.8.0 → 3.10.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.
@@ -65,9 +65,6 @@ export declare interface BezierEdgeParams {
65
65
  readonly detourDirection?: number | undefined;
66
66
  }
67
67
 
68
- /**
69
- * Responsibility: Providing edge shape connecting ports with bezier line
70
- */
71
68
  export declare class BezierEdgeShape implements StructuredEdgeShape {
72
69
  readonly svg: SVGSVGElement;
73
70
  readonly group: SVGGElement;
@@ -95,9 +92,6 @@ declare type BezierEdgeShapeConfig = {
95
92
  readonly type?: "bezier" | undefined;
96
93
  } & BezierEdgeParams;
97
94
 
98
- /**
99
- * Responsibility: provides graph rendering API for end user
100
- */
101
95
  export declare class Canvas {
102
96
  /**
103
97
  * @deprecated access element directly instead
@@ -199,9 +193,6 @@ export declare class Canvas {
199
193
  destroy(): void;
200
194
  }
201
195
 
202
- /**
203
- * Responsibility: Constructs canvas based on specified configuration
204
- */
205
196
  export declare class CanvasBuilder {
206
197
  private element;
207
198
  private canvasDefaults;
@@ -347,6 +338,37 @@ declare interface Defaults {
347
338
  };
348
339
  }
349
340
 
341
+ export declare interface DirectEdgeParams {
342
+ readonly color?: string | undefined;
343
+ readonly width?: number | undefined;
344
+ readonly arrowLength?: number | undefined;
345
+ readonly arrowWidth?: number | undefined;
346
+ readonly hasSourceArrow?: boolean | undefined;
347
+ readonly hasTargetArrow?: boolean | undefined;
348
+ readonly sourceOffset?: number | undefined;
349
+ readonly targetOffset?: number | undefined;
350
+ }
351
+
352
+ export declare class DirectEdgeShape implements StructuredEdgeShape {
353
+ readonly svg: SVGSVGElement;
354
+ readonly group: SVGGElement;
355
+ readonly line: SVGPathElement;
356
+ readonly sourceArrow: SVGPathElement | null;
357
+ readonly targetArrow: SVGPathElement | null;
358
+ private readonly color;
359
+ private readonly width;
360
+ private readonly arrowLength;
361
+ private readonly arrowWidth;
362
+ private readonly sourceOffset;
363
+ private readonly targetOffset;
364
+ constructor(params?: DirectEdgeParams);
365
+ render(params: EdgeRenderParams): void;
366
+ }
367
+
368
+ declare type DirectEdgeShapeConfig = {
369
+ readonly type: "direct";
370
+ } & DirectEdgeParams;
371
+
350
372
  declare interface DotsRenderer {
351
373
  readonly radius?: number;
352
374
  readonly color?: string;
@@ -354,6 +376,7 @@ declare interface DotsRenderer {
354
376
 
355
377
  declare interface DraggableNodesConfig {
356
378
  readonly moveOnTop?: boolean;
379
+ readonly moveEdgesOnTop?: boolean;
357
380
  readonly mouse?: {
358
381
  readonly dragCursor?: string | null;
359
382
  readonly mouseDownEventVerifier?: MouseEventVerifier;
@@ -390,36 +413,24 @@ export declare interface EdgeRenderPort {
390
413
  readonly nodeId: unknown;
391
414
  }
392
415
 
393
- /**
394
- * Responsibility: Rendering edge via SVG
395
- */
396
416
  export declare interface EdgeShape {
397
417
  readonly svg: SVGSVGElement;
398
418
  render(params: EdgeRenderParams): void;
399
419
  }
400
420
 
401
- declare type EdgeShapeConfig = BezierEdgeShapeConfig | StraightEdgeShapeConfig | HorizontalEdgeShapeConfig | VerticalEdgeShapeConfig | EdgeShapeFactory;
421
+ declare type EdgeShapeConfig = BezierEdgeShapeConfig | StraightEdgeShapeConfig | HorizontalEdgeShapeConfig | VerticalEdgeShapeConfig | DirectEdgeShapeConfig | EdgeShapeFactory;
402
422
 
403
423
  declare type EdgeShapeFactory = (edgeId: unknown) => EdgeShape;
404
424
 
405
- /**
406
- * Responsibility: Provides a way to trigger events
407
- */
408
425
  export declare interface EventEmitter<T> {
409
426
  emit(payload: T): void;
410
427
  }
411
428
 
412
- /**
413
- * Responsibility: Provides a way to handle events
414
- */
415
429
  export declare interface EventHandler<T> {
416
430
  subscribe(callback: (payload: T) => void): void;
417
431
  unsubscribe(callback: (payload: T) => void): void;
418
432
  }
419
433
 
420
- /**
421
- * Responsibility: Connects events and event handlers
422
- */
423
434
  export declare class EventSubject<T> implements EventEmitter<T>, EventHandler<T> {
424
435
  private readonly callbacks;
425
436
  subscribe(callback: (payload: T) => void): void;
@@ -427,9 +438,6 @@ export declare class EventSubject<T> implements EventEmitter<T>, EventHandler<T>
427
438
  emit(payload: T): void;
428
439
  }
429
440
 
430
- /**
431
- * Responsibility: Provides access to graph model for end user
432
- */
433
441
  export declare class Graph {
434
442
  private readonly graphStore;
435
443
  readonly onAfterNodeAdded: EventHandler<unknown>;
@@ -485,9 +493,6 @@ export declare interface GraphPort {
485
493
  readonly nodeId: unknown;
486
494
  }
487
495
 
488
- /**
489
- * Responsibility: Store state of graph
490
- */
491
496
  declare class GraphStore {
492
497
  private readonly nodes;
493
498
  private readonly ports;
@@ -569,10 +574,6 @@ export declare interface HorizontalEdgeParams {
569
574
  readonly detourDirection?: number | undefined;
570
575
  }
571
576
 
572
- /**
573
- * Responsibility: Providing edge shape connecting ports with horizontal angled
574
- * line
575
- */
576
577
  export declare class HorizontalEdgeShape implements StructuredEdgeShape {
577
578
  readonly svg: SVGSVGElement;
578
579
  readonly group: SVGGElement;
@@ -600,17 +601,10 @@ declare type HorizontalEdgeShapeConfig = {
600
601
  readonly type: "horizontal";
601
602
  } & HorizontalEdgeParams;
602
603
 
603
- /**
604
- * Responsibility: Library specific error to throw when unexpected action
605
- * occured
606
- */
607
604
  export declare class HtmlGraphError extends Error {
608
605
  readonly name = "HtmlGraphError";
609
606
  }
610
607
 
611
- /**
612
- * Responsibility: Provides access to DOM modifications
613
- */
614
608
  declare interface HtmlView {
615
609
  attachNode(nodeId: unknown): void;
616
610
  detachNode(nodeId: unknown): void;
@@ -638,10 +632,6 @@ export declare interface InteractiveEdgeParams {
638
632
  readonly width?: number;
639
633
  }
640
634
 
641
- /**
642
- * Responsibility: Providing handle for attaching interactive behavior to an
643
- * edge
644
- */
645
635
  export declare class InteractiveEdgeShape implements StructuredEdgeShape {
646
636
  private readonly structuredEdge;
647
637
  readonly svg: SVGSVGElement;
@@ -669,9 +659,6 @@ export declare interface LineEdgeParams {
669
659
  readonly createLinePath: CreatePathFn;
670
660
  }
671
661
 
672
- /**
673
- * Responsibility: Providing low level core for single line structured edges
674
- */
675
662
  export declare class LineEdgeShape implements StructuredEdgeShape {
676
663
  private readonly params;
677
664
  readonly svg: SVGSVGElement;
@@ -726,9 +713,6 @@ declare interface PatchTransformRequest {
726
713
  readonly y?: number;
727
714
  }
728
715
 
729
- /**
730
- * Responsibility: Specifies point coordinates
731
- */
732
716
  export declare interface Point {
733
717
  readonly x: number;
734
718
  readonly y: number;
@@ -742,9 +726,6 @@ declare interface PortPayload {
742
726
 
743
727
  declare type Priority = ConstantPriority | IncrementalPriority | CustomPriority;
744
728
 
745
- /**
746
- * Responsibility: Specifies how to determine Z-index of an entity in DOM
747
- */
748
729
  export declare type PriorityFn = () => number;
749
730
 
750
731
  export declare interface RenderingBox {
@@ -780,9 +761,6 @@ export declare interface StraightEdgeParams {
780
761
  readonly detourDirection?: number | undefined;
781
762
  }
782
763
 
783
- /**
784
- * Responsibility: Providing edge shape connecting ports with straight line
785
- */
786
764
  export declare class StraightEdgeShape implements StructuredEdgeShape {
787
765
  readonly svg: SVGSVGElement;
788
766
  readonly group: SVGGElement;
@@ -810,9 +788,6 @@ declare type StraightEdgeShapeConfig = {
810
788
  readonly type: "straight";
811
789
  } & StraightEdgeParams;
812
790
 
813
- /**
814
- * Responsibility: Specifying EdgeShape with a standard visual structure
815
- */
816
791
  export declare interface StructuredEdgeShape extends EdgeShape {
817
792
  readonly group: SVGGElement;
818
793
  readonly line: SVGPathElement;
@@ -903,10 +878,6 @@ export declare interface VerticalEdgeParams {
903
878
  readonly detourDirection?: number | undefined;
904
879
  }
905
880
 
906
- /**
907
- * Responsibility: Providing edge shape connecting ports with vertical angled
908
- * line
909
- */
910
881
  export declare class VerticalEdgeShape implements StructuredEdgeShape {
911
882
  readonly svg: SVGSVGElement;
912
883
  readonly group: SVGGElement;
@@ -934,9 +905,6 @@ declare type VerticalEdgeShapeConfig = {
934
905
  readonly type: "vertical";
935
906
  } & VerticalEdgeParams;
936
907
 
937
- /**
938
- * Responsibility: Provides access to viewport state for end user
939
- */
940
908
  export declare class Viewport {
941
909
  private readonly viewportStore;
942
910
  readonly onBeforeUpdated: EventHandler<void>;
@@ -946,9 +914,6 @@ export declare class Viewport {
946
914
  getContentMatrix(): TransformState;
947
915
  }
948
916
 
949
- /**
950
- * Responsibility: Stores viewport transformation state
951
- */
952
917
  declare class ViewportStore {
953
918
  private viewportMatrix;
954
919
  private contentMatrix;