@html-graph/html-graph 8.17.0 → 8.18.1
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/README.md +3 -3
- package/dist/html-graph.d.ts +26 -13
- package/dist/html-graph.js +306 -226
- package/dist/html-graph.min.js +893 -841
- package/dist/html-graph.min.umd.cjs +1 -1
- package/dist/html-graph.umd.cjs +306 -226
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,9 +30,9 @@ import { CanvasBuilder } from "@html-graph/html-graph";
|
|
|
30
30
|
const element = document.getElementById("canvas");
|
|
31
31
|
|
|
32
32
|
const canvas = new CanvasBuilder(element)
|
|
33
|
-
.enableUserTransformableViewport()
|
|
34
|
-
.enableUserDraggableNodes()
|
|
35
|
-
.enableBackground()
|
|
33
|
+
.enableUserTransformableViewport() // Enables viewport pan and zoom
|
|
34
|
+
.enableUserDraggableNodes() // Enables draggable nodes
|
|
35
|
+
.enableBackground() // Renders background
|
|
36
36
|
.build();
|
|
37
37
|
```
|
|
38
38
|
|
package/dist/html-graph.d.ts
CHANGED
|
@@ -291,17 +291,14 @@ export declare type CenterFn = (width: number, height: number) => Point;
|
|
|
291
291
|
export declare interface ConnectablePortsConfig {
|
|
292
292
|
readonly edgeShape?: EdgeShapeConfig;
|
|
293
293
|
readonly connectionTypeResolver?: ConnectionTypeResolver;
|
|
294
|
-
readonly connectionPreprocessor?: ConnectionPreprocessor;
|
|
295
294
|
readonly connectionAllowedVerifier?: ConnectionAllowedVerifier;
|
|
295
|
+
readonly connectionPreprocessor?: ConnectionPreprocessor;
|
|
296
296
|
readonly mouseDownEventVerifier?: MouseEventVerifier;
|
|
297
297
|
readonly mouseUpEventVerifier?: MouseEventVerifier;
|
|
298
|
-
readonly dragPortDirection?:
|
|
298
|
+
readonly dragPortDirection?: DraggingPortDirectionConfig;
|
|
299
299
|
readonly events?: {
|
|
300
300
|
readonly onAfterEdgeCreated?: (edgeId: Identifier) => void;
|
|
301
|
-
readonly onEdgeCreationInterrupted?: (params:
|
|
302
|
-
readonly staticPortId: Identifier;
|
|
303
|
-
readonly isDirect: boolean;
|
|
304
|
-
}) => void;
|
|
301
|
+
readonly onEdgeCreationInterrupted?: (params: EdgeCreationInProgressParams) => void;
|
|
305
302
|
readonly onEdgeCreationPrevented?: (request: AddEdgeRequest) => void;
|
|
306
303
|
};
|
|
307
304
|
}
|
|
@@ -380,13 +377,14 @@ declare interface DotsRenderer {
|
|
|
380
377
|
readonly color?: string;
|
|
381
378
|
}
|
|
382
379
|
|
|
383
|
-
declare interface DraggableEdgesConfig {
|
|
380
|
+
export declare interface DraggableEdgesConfig {
|
|
384
381
|
readonly connectionPreprocessor?: ConnectionPreprocessor;
|
|
385
382
|
readonly connectionAllowedVerifier?: ConnectionAllowedVerifier;
|
|
386
383
|
readonly mouseDownEventVerifier?: MouseEventVerifier;
|
|
387
384
|
readonly mouseUpEventVerifier?: MouseEventVerifier;
|
|
388
385
|
readonly draggingEdgeResolver?: DraggingEdgeResolver;
|
|
389
386
|
readonly draggingEdgeShape?: EdgeShapeConfig;
|
|
387
|
+
readonly dragPortDirection?: DraggingPortDirectionConfig;
|
|
390
388
|
readonly events?: {
|
|
391
389
|
readonly onAfterEdgeReattached?: (edgeId: Identifier) => void;
|
|
392
390
|
readonly onEdgeReattachInterrupted?: (edge: GraphEdge & {
|
|
@@ -415,6 +413,13 @@ export declare interface DraggableNodesConfig {
|
|
|
415
413
|
|
|
416
414
|
export declare type DraggingEdgeResolver = (portId: Identifier) => Identifier | null;
|
|
417
415
|
|
|
416
|
+
export declare type DraggingPortDirectionConfig = number | undefined | "closest-connectable-port";
|
|
417
|
+
|
|
418
|
+
export declare interface EdgeCreationInProgressParams {
|
|
419
|
+
readonly staticPortId: Identifier;
|
|
420
|
+
readonly isDirect: boolean;
|
|
421
|
+
}
|
|
422
|
+
|
|
418
423
|
declare interface EdgePath {
|
|
419
424
|
readonly path: string;
|
|
420
425
|
readonly midpoint: Point;
|
|
@@ -771,11 +776,7 @@ export declare interface LayoutAlgorithmParams {
|
|
|
771
776
|
readonly viewport: Viewport;
|
|
772
777
|
}
|
|
773
778
|
|
|
774
|
-
export declare type LayoutApplyOn =
|
|
775
|
-
type: "topologyChangeMacrotask";
|
|
776
|
-
} | {
|
|
777
|
-
type: "topologyChangeMicrotask";
|
|
778
|
-
} | EventSubject<void>;
|
|
779
|
+
export declare type LayoutApplyOn = TopologyChangeMacrotask | TopologyChangeMicrotask | EventSubject<void>;
|
|
779
780
|
|
|
780
781
|
export declare interface LayoutConfig {
|
|
781
782
|
readonly algorithm?: LayoutAlgorithmConfig | undefined;
|
|
@@ -946,6 +947,18 @@ export declare interface StructuredEdgeShape extends EdgeShape {
|
|
|
946
947
|
readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
|
|
947
948
|
}
|
|
948
949
|
|
|
950
|
+
/**
|
|
951
|
+
* @deprecated
|
|
952
|
+
* use topologyChangeMicrotask instead
|
|
953
|
+
*/
|
|
954
|
+
declare type TopologyChangeMacrotask = {
|
|
955
|
+
type: "topologyChangeMacrotask";
|
|
956
|
+
};
|
|
957
|
+
|
|
958
|
+
declare type TopologyChangeMicrotask = {
|
|
959
|
+
type: "topologyChangeMicrotask";
|
|
960
|
+
};
|
|
961
|
+
|
|
949
962
|
export declare type TransformDeclaration = {
|
|
950
963
|
readonly a?: number | undefined;
|
|
951
964
|
readonly b?: number | undefined;
|
|
@@ -1024,7 +1037,7 @@ declare interface UpdateNodeRequest_2 {
|
|
|
1024
1037
|
}
|
|
1025
1038
|
|
|
1026
1039
|
export declare interface UpdatePortRequest {
|
|
1027
|
-
readonly direction?: number;
|
|
1040
|
+
readonly direction?: number | undefined;
|
|
1028
1041
|
}
|
|
1029
1042
|
|
|
1030
1043
|
declare interface UpdatePortRequest_2 {
|