@html-graph/html-graph 8.23.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.
- package/dist/html-graph.d.ts +20 -186
- package/dist/html-graph.js +61 -385
- package/dist/html-graph.min.js +479 -721
- package/dist/html-graph.min.umd.cjs +1 -1
- package/dist/html-graph.umd.cjs +60 -387
- package/package.json +1 -1
package/dist/html-graph.d.ts
CHANGED
|
@@ -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
|
|
60
|
+
readonly stopVelocity?: number;
|
|
61
61
|
readonly maxForce?: number;
|
|
62
62
|
readonly nodeForceCoefficient?: number;
|
|
63
63
|
readonly barnesHut?: {
|
|
@@ -126,7 +126,7 @@ export declare interface BezierEdgeParams {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
export declare class BezierEdgeShape implements StructuredEdgeShape {
|
|
129
|
-
readonly
|
|
129
|
+
readonly element: SVGSVGElement;
|
|
130
130
|
readonly group: SVGGElement;
|
|
131
131
|
readonly line: SVGPathElement;
|
|
132
132
|
readonly sourceArrow: SVGPathElement | null;
|
|
@@ -152,8 +152,6 @@ declare type BezierEdgeShapeConfig = {
|
|
|
152
152
|
readonly type?: "bezier" | undefined;
|
|
153
153
|
} & BezierEdgeParams;
|
|
154
154
|
|
|
155
|
-
export declare const boxPortOffsetFn: PortOffsetFn;
|
|
156
|
-
|
|
157
155
|
export declare class Canvas {
|
|
158
156
|
readonly graph: Graph;
|
|
159
157
|
readonly viewport: Viewport;
|
|
@@ -231,49 +229,19 @@ export declare class CanvasBuilderError extends Error {
|
|
|
231
229
|
}
|
|
232
230
|
|
|
233
231
|
export declare interface CanvasDefaults {
|
|
234
|
-
/**
|
|
235
|
-
* nodes related behavior
|
|
236
|
-
*/
|
|
237
232
|
readonly nodes?: {
|
|
238
|
-
/**
|
|
239
|
-
* specifies how to determine center of node
|
|
240
|
-
* center of nodes specified in addNode method by x and y
|
|
241
|
-
*/
|
|
242
233
|
readonly centerFn?: CenterFn;
|
|
243
|
-
/**
|
|
244
|
-
* specifies default z-index value
|
|
245
|
-
*/
|
|
246
234
|
readonly priority?: Priority;
|
|
247
235
|
};
|
|
248
|
-
/**
|
|
249
|
-
* ports related behavior
|
|
250
|
-
*/
|
|
251
236
|
readonly ports?: {
|
|
252
|
-
/**
|
|
253
|
-
* specifies default direction of port
|
|
254
|
-
*/
|
|
255
237
|
readonly direction?: number;
|
|
256
238
|
};
|
|
257
|
-
/**
|
|
258
|
-
*edges related behavior
|
|
259
|
-
*/
|
|
260
239
|
readonly edges?: {
|
|
261
|
-
/**
|
|
262
|
-
* specifies default controller
|
|
263
|
-
*/
|
|
264
240
|
readonly shape?: EdgeShapeConfig;
|
|
265
|
-
/**
|
|
266
|
-
* specifies default z-index value
|
|
267
|
-
*/
|
|
268
241
|
readonly priority?: Priority;
|
|
269
242
|
};
|
|
270
243
|
readonly focus?: {
|
|
271
244
|
readonly contentPadding?: number;
|
|
272
|
-
/**
|
|
273
|
-
* @deprecated
|
|
274
|
-
* use contentPadding instead
|
|
275
|
-
*/
|
|
276
|
-
readonly contentOffset?: number;
|
|
277
245
|
readonly minContentScale?: number;
|
|
278
246
|
readonly animationDuration?: number;
|
|
279
247
|
};
|
|
@@ -318,13 +286,7 @@ export declare enum ConnectionCategory {
|
|
|
318
286
|
PortCycle = "port-cycle"
|
|
319
287
|
}
|
|
320
288
|
|
|
321
|
-
export declare type ConnectionPreprocessor = (request: AddEdgeRequest) => AddEdgeRequest
|
|
322
|
-
|
|
323
|
-
/**
|
|
324
|
-
* @deprecated
|
|
325
|
-
* connection preprocessor should not return null
|
|
326
|
-
*/
|
|
327
|
-
declare type ConnectionPreprocessorNullResponse = null;
|
|
289
|
+
export declare type ConnectionPreprocessor = (request: AddEdgeRequest) => AddEdgeRequest;
|
|
328
290
|
|
|
329
291
|
export declare type ConnectionTypeResolver = (portId: Identifier) => "direct" | "reverse" | null;
|
|
330
292
|
|
|
@@ -353,7 +315,7 @@ export declare interface DirectEdgeParams {
|
|
|
353
315
|
}
|
|
354
316
|
|
|
355
317
|
export declare class DirectEdgeShape implements StructuredEdgeShape {
|
|
356
|
-
readonly
|
|
318
|
+
readonly element: SVGSVGElement;
|
|
357
319
|
readonly group: SVGGElement;
|
|
358
320
|
readonly line: SVGPathElement;
|
|
359
321
|
readonly sourceArrow: SVGPathElement | null;
|
|
@@ -416,12 +378,7 @@ export declare interface DraggableNodesConfig {
|
|
|
416
378
|
|
|
417
379
|
export declare type DraggingEdgeResolver = (portId: Identifier) => Identifier | null;
|
|
418
380
|
|
|
419
|
-
export declare type DraggingPortDirectionConfig = number |
|
|
420
|
-
/**
|
|
421
|
-
* @deprecated
|
|
422
|
-
* use "nearest-connectable-port" instead
|
|
423
|
-
*/
|
|
424
|
-
| "closest-connectable-port" | "nearest-connectable-port";
|
|
381
|
+
export declare type DraggingPortDirectionConfig = number | "inherit" | "nearest-connectable-port";
|
|
425
382
|
|
|
426
383
|
export declare interface EdgeCreationInProgressParams {
|
|
427
384
|
readonly staticPortId: Identifier;
|
|
@@ -448,11 +405,11 @@ export declare interface EdgeRenderPort {
|
|
|
448
405
|
}
|
|
449
406
|
|
|
450
407
|
export declare interface EdgeShape {
|
|
451
|
-
readonly
|
|
408
|
+
readonly element: SVGSVGElement;
|
|
452
409
|
render(params: EdgeRenderParams): void;
|
|
453
410
|
}
|
|
454
411
|
|
|
455
|
-
declare type EdgeShapeConfig = BezierEdgeShapeConfig | StraightEdgeShapeConfig |
|
|
412
|
+
declare type EdgeShapeConfig = BezierEdgeShapeConfig | StraightEdgeShapeConfig | DirectEdgeShapeConfig | OrthogonalEdgeShapeConfig | EdgeShapeFactory;
|
|
456
413
|
|
|
457
414
|
declare type EdgeShapeFactory = (edgeId: Identifier) => EdgeShape;
|
|
458
415
|
|
|
@@ -474,11 +431,6 @@ export declare class EventSubject<T> implements EventEmitter<T>, EventHandler<T>
|
|
|
474
431
|
|
|
475
432
|
export declare type FocusConfig = {
|
|
476
433
|
readonly contentPadding?: number | undefined;
|
|
477
|
-
/**
|
|
478
|
-
* @deprecated
|
|
479
|
-
* use contentPadding instead
|
|
480
|
-
*/
|
|
481
|
-
readonly contentOffset?: number | undefined;
|
|
482
434
|
readonly nodes?: Iterable<Identifier> | undefined;
|
|
483
435
|
readonly minContentScale?: number | undefined;
|
|
484
436
|
readonly animationDuration?: number | undefined;
|
|
@@ -663,57 +615,6 @@ declare class GraphStore {
|
|
|
663
615
|
private removeEdgeInternal;
|
|
664
616
|
}
|
|
665
617
|
|
|
666
|
-
/**
|
|
667
|
-
* @deprecated
|
|
668
|
-
* use OrthogonalEdgeShape instead
|
|
669
|
-
*/
|
|
670
|
-
export declare interface HorizontalEdgeParams {
|
|
671
|
-
readonly color?: string | undefined;
|
|
672
|
-
readonly width?: number | undefined;
|
|
673
|
-
readonly arrowLength?: number | undefined;
|
|
674
|
-
readonly arrowRenderer?: ArrowRendererConfig | undefined;
|
|
675
|
-
readonly arrowOffset?: number | undefined;
|
|
676
|
-
readonly hasSourceArrow?: boolean | undefined;
|
|
677
|
-
readonly hasTargetArrow?: boolean | undefined;
|
|
678
|
-
readonly cycleSquareSide?: number | undefined;
|
|
679
|
-
readonly roundness?: number | undefined;
|
|
680
|
-
readonly detourDistance?: number | undefined;
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
/**
|
|
684
|
-
* @deprecated
|
|
685
|
-
* use OrthogonalEdgeShape instead
|
|
686
|
-
*/
|
|
687
|
-
export declare class HorizontalEdgeShape implements StructuredEdgeShape {
|
|
688
|
-
readonly svg: SVGSVGElement;
|
|
689
|
-
readonly group: SVGGElement;
|
|
690
|
-
readonly line: SVGPathElement;
|
|
691
|
-
readonly sourceArrow: SVGPathElement | null;
|
|
692
|
-
readonly targetArrow: SVGPathElement | null;
|
|
693
|
-
readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
|
|
694
|
-
private readonly arrowLength;
|
|
695
|
-
private readonly arrowOffset;
|
|
696
|
-
private readonly roundness;
|
|
697
|
-
private readonly cycleSquareSide;
|
|
698
|
-
private readonly detourDistance;
|
|
699
|
-
private readonly hasSourceArrow;
|
|
700
|
-
private readonly hasTargetArrow;
|
|
701
|
-
private readonly pathShape;
|
|
702
|
-
private readonly createCyclePath;
|
|
703
|
-
private readonly createDetourPath;
|
|
704
|
-
private readonly createLinePath;
|
|
705
|
-
constructor(params?: HorizontalEdgeParams);
|
|
706
|
-
render(params: EdgeRenderParams): void;
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
/**
|
|
710
|
-
* @deprecated
|
|
711
|
-
* use type: "orthogonal" instead
|
|
712
|
-
*/
|
|
713
|
-
declare type HorizontalEdgeShapeConfig = {
|
|
714
|
-
readonly type: "horizontal";
|
|
715
|
-
} & HorizontalEdgeParams;
|
|
716
|
-
|
|
717
618
|
declare interface HtmlView {
|
|
718
619
|
attachNode(nodeId: Identifier): void;
|
|
719
620
|
detachNode(nodeId: Identifier): void;
|
|
@@ -742,16 +643,12 @@ export declare interface InteractiveEdgeParams {
|
|
|
742
643
|
|
|
743
644
|
export declare class InteractiveEdgeShape implements StructuredEdgeShape {
|
|
744
645
|
private readonly baseEdge;
|
|
745
|
-
readonly
|
|
646
|
+
readonly element: SVGSVGElement;
|
|
746
647
|
readonly group: SVGGElement;
|
|
747
648
|
readonly line: SVGPathElement;
|
|
748
649
|
readonly sourceArrow: SVGPathElement | null;
|
|
749
650
|
readonly targetArrow: SVGPathElement | null;
|
|
750
|
-
|
|
751
|
-
* @deprecated
|
|
752
|
-
* use shape.svg instead
|
|
753
|
-
*/
|
|
754
|
-
readonly handle: SVGGElement;
|
|
651
|
+
private readonly handle;
|
|
755
652
|
readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
|
|
756
653
|
private readonly interactiveLine;
|
|
757
654
|
private readonly interactiveSourceArrow;
|
|
@@ -776,7 +673,7 @@ declare type LayoutAlgorithmConfig = {
|
|
|
776
673
|
readonly nodeMass?: number | undefined;
|
|
777
674
|
readonly edgeEquilibriumLength?: number | undefined;
|
|
778
675
|
readonly edgeStiffness?: number | undefined;
|
|
779
|
-
readonly
|
|
676
|
+
readonly stopVelocity?: number | undefined;
|
|
780
677
|
readonly maxForce?: number | undefined;
|
|
781
678
|
readonly nodeForceCoefficient?: number | undefined;
|
|
782
679
|
readonly barnesHut?: {
|
|
@@ -796,7 +693,7 @@ export declare interface LayoutAlgorithmParams {
|
|
|
796
693
|
readonly viewport: Viewport;
|
|
797
694
|
}
|
|
798
695
|
|
|
799
|
-
export declare type LayoutApplyOn =
|
|
696
|
+
export declare type LayoutApplyOn = "topologyChangeMicrotask" | EventSubject<void>;
|
|
800
697
|
|
|
801
698
|
export declare interface LayoutConfig {
|
|
802
699
|
readonly algorithm?: LayoutAlgorithmConfig | undefined;
|
|
@@ -829,7 +726,7 @@ export declare class MidpointEdgeShape implements StructuredEdgeShape {
|
|
|
829
726
|
readonly sourceArrow: SVGPathElement | null;
|
|
830
727
|
readonly targetArrow: SVGPathElement | null;
|
|
831
728
|
readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
|
|
832
|
-
readonly
|
|
729
|
+
readonly element: SVGSVGElement;
|
|
833
730
|
constructor(baseShape: StructuredEdgeShape, midpointElement: SVGElement);
|
|
834
731
|
render(params: EdgeRenderParams): void;
|
|
835
732
|
}
|
|
@@ -861,7 +758,7 @@ export declare interface OrthogonalEdgeParams {
|
|
|
861
758
|
}
|
|
862
759
|
|
|
863
760
|
export declare class OrthogonalEdgeShape implements StructuredEdgeShape {
|
|
864
|
-
readonly
|
|
761
|
+
readonly element: SVGSVGElement;
|
|
865
762
|
readonly group: SVGGElement;
|
|
866
763
|
readonly line: SVGPathElement;
|
|
867
764
|
readonly sourceArrow: SVGPathElement | null;
|
|
@@ -980,7 +877,7 @@ export declare interface StraightEdgeParams {
|
|
|
980
877
|
}
|
|
981
878
|
|
|
982
879
|
export declare class StraightEdgeShape implements StructuredEdgeShape {
|
|
983
|
-
readonly
|
|
880
|
+
readonly element: SVGSVGElement;
|
|
984
881
|
readonly group: SVGGElement;
|
|
985
882
|
readonly line: SVGPathElement;
|
|
986
883
|
readonly sourceArrow: SVGPathElement | null;
|
|
@@ -1020,18 +917,6 @@ export declare interface StructuredEdgeShape extends EdgeShape {
|
|
|
1020
917
|
readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
|
|
1021
918
|
}
|
|
1022
919
|
|
|
1023
|
-
/**
|
|
1024
|
-
* @deprecated
|
|
1025
|
-
* use "topologyChangeMicrotask" instead
|
|
1026
|
-
*/
|
|
1027
|
-
declare type TopologyChangeMacrotask = {
|
|
1028
|
-
type: "topologyChangeMacrotask";
|
|
1029
|
-
};
|
|
1030
|
-
|
|
1031
|
-
declare type TopologyChangeMicrotask = {
|
|
1032
|
-
type: "topologyChangeMicrotask";
|
|
1033
|
-
};
|
|
1034
|
-
|
|
1035
920
|
export declare type TransformDeclaration = {
|
|
1036
921
|
readonly a?: number | undefined;
|
|
1037
922
|
readonly b?: number | undefined;
|
|
@@ -1069,17 +954,17 @@ export declare type TransformPreprocessorFn = (params: TransformPreprocessorPara
|
|
|
1069
954
|
export declare interface TransformPreprocessorParams {
|
|
1070
955
|
readonly prevTransform: TransformState;
|
|
1071
956
|
readonly nextTransform: TransformState;
|
|
1072
|
-
readonly
|
|
1073
|
-
|
|
957
|
+
readonly viewport: {
|
|
958
|
+
readonly width: number;
|
|
959
|
+
readonly height: number;
|
|
960
|
+
};
|
|
1074
961
|
}
|
|
1075
962
|
|
|
1076
|
-
declare interface TransformState {
|
|
963
|
+
export declare interface TransformState {
|
|
1077
964
|
readonly scale: number;
|
|
1078
965
|
readonly x: number;
|
|
1079
966
|
readonly y: number;
|
|
1080
967
|
}
|
|
1081
|
-
export { TransformState as TransformPayload }
|
|
1082
|
-
export { TransformState }
|
|
1083
968
|
|
|
1084
969
|
export declare interface UpdateEdgeRequest {
|
|
1085
970
|
readonly from?: Identifier | undefined;
|
|
@@ -1138,57 +1023,6 @@ export declare interface UserSelectableNodesConfig {
|
|
|
1138
1023
|
readonly movementThreshold?: number | undefined;
|
|
1139
1024
|
}
|
|
1140
1025
|
|
|
1141
|
-
/**
|
|
1142
|
-
* @deprecated
|
|
1143
|
-
* use OrthogonalEdgeShape instead
|
|
1144
|
-
*/
|
|
1145
|
-
export declare interface VerticalEdgeParams {
|
|
1146
|
-
readonly color?: string | undefined;
|
|
1147
|
-
readonly width?: number | undefined;
|
|
1148
|
-
readonly arrowLength?: number | undefined;
|
|
1149
|
-
readonly arrowOffset?: number | undefined;
|
|
1150
|
-
readonly arrowRenderer?: ArrowRendererConfig | undefined;
|
|
1151
|
-
readonly hasSourceArrow?: boolean | undefined;
|
|
1152
|
-
readonly hasTargetArrow?: boolean | undefined;
|
|
1153
|
-
readonly cycleSquareSide?: number | undefined;
|
|
1154
|
-
readonly roundness?: number | undefined;
|
|
1155
|
-
readonly detourDistance?: number | undefined;
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
/**
|
|
1159
|
-
* @deprecated
|
|
1160
|
-
* use OrthogonalEdgeShape instead
|
|
1161
|
-
*/
|
|
1162
|
-
export declare class VerticalEdgeShape implements StructuredEdgeShape {
|
|
1163
|
-
readonly svg: SVGSVGElement;
|
|
1164
|
-
readonly group: SVGGElement;
|
|
1165
|
-
readonly line: SVGPathElement;
|
|
1166
|
-
readonly sourceArrow: SVGPathElement | null;
|
|
1167
|
-
readonly targetArrow: SVGPathElement | null;
|
|
1168
|
-
readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
|
|
1169
|
-
private readonly arrowLength;
|
|
1170
|
-
private readonly arrowOffset;
|
|
1171
|
-
private readonly roundness;
|
|
1172
|
-
private readonly cycleSquareSide;
|
|
1173
|
-
private readonly detourDistance;
|
|
1174
|
-
private readonly hasSourceArrow;
|
|
1175
|
-
private readonly hasTargetArrow;
|
|
1176
|
-
private readonly pathShape;
|
|
1177
|
-
private readonly createCyclePath;
|
|
1178
|
-
private readonly createDetourPath;
|
|
1179
|
-
private readonly createLinePath;
|
|
1180
|
-
constructor(params?: VerticalEdgeParams);
|
|
1181
|
-
render(params: EdgeRenderParams): void;
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
/**
|
|
1185
|
-
* @deprecated
|
|
1186
|
-
* use type: "orthogonal" instead
|
|
1187
|
-
*/
|
|
1188
|
-
declare type VerticalEdgeShapeConfig = {
|
|
1189
|
-
readonly type: "vertical";
|
|
1190
|
-
} & VerticalEdgeParams;
|
|
1191
|
-
|
|
1192
1026
|
export declare class Viewport {
|
|
1193
1027
|
private readonly viewportStore;
|
|
1194
1028
|
readonly onBeforeUpdated: EventHandler<void>;
|
|
@@ -1254,7 +1088,7 @@ export declare interface ViewportTransformConfig {
|
|
|
1254
1088
|
readonly mouseWheelEventVerifier?: (event: WheelEvent) => boolean;
|
|
1255
1089
|
readonly wheelFinishTimeout?: number;
|
|
1256
1090
|
};
|
|
1257
|
-
readonly
|
|
1091
|
+
readonly pan?: {
|
|
1258
1092
|
readonly cursor?: string | null;
|
|
1259
1093
|
readonly mouseDownEventVerifier?: MouseEventVerifier;
|
|
1260
1094
|
readonly mouseUpEventVerifier?: MouseEventVerifier;
|