@html-graph/html-graph 3.16.0 → 3.18.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/README.md +1 -5
- package/dist/html-graph.d.ts +34 -0
- package/dist/html-graph.js +566 -504
- package/dist/html-graph.umd.cjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,16 +2,12 @@
|
|
|
2
2
|
<img src="/media/favicon.png" alt="HTMLGraph" width="25" height="25"/> HTMLGraph
|
|
3
3
|
</h1>
|
|
4
4
|
|
|
5
|
-
### Graph visualization library that enables nodes customization using HTML
|
|
5
|
+
### Graph visualization library that enables rich nodes customization using HTML
|
|
6
6
|
|
|
7
7
|
<a target="_blank" href="https://html-graph.github.io/use-cases/advanced-demo/">
|
|
8
8
|
<img width="100%" src="https://raw.githubusercontent.com/html-graph/html-graph/master/media/full-demo.gif"/>
|
|
9
9
|
</a>
|
|
10
10
|
|
|
11
|
-
Instead of connecting nodes directly, this library utilizes the concept of ports,
|
|
12
|
-
which provide greater flexibility in managing edges. A port is an entity on a
|
|
13
|
-
node to which edges can be attached.
|
|
14
|
-
|
|
15
11
|
Visit the <a target="_blank" href="https://html-graph.github.io">DOCUMENTATION</a> for more details.
|
|
16
12
|
|
|
17
13
|
## Getting started:
|
package/dist/html-graph.d.ts
CHANGED
|
@@ -126,6 +126,7 @@ export declare class Canvas {
|
|
|
126
126
|
private readonly onBeforeEdgeRemoved;
|
|
127
127
|
private readonly onBeforeClear;
|
|
128
128
|
private readonly onBeforeDestroyEmitter;
|
|
129
|
+
private destroyed;
|
|
129
130
|
/**
|
|
130
131
|
* emits event just before destruction of canvas
|
|
131
132
|
*/
|
|
@@ -234,6 +235,8 @@ export declare class CanvasBuilder {
|
|
|
234
235
|
*/
|
|
235
236
|
enableResizeReactiveNodes(): CanvasBuilder;
|
|
236
237
|
/**
|
|
238
|
+
* @deprecated
|
|
239
|
+
* do not use
|
|
237
240
|
* sets emitter for rendering graph inside bounded area
|
|
238
241
|
*/
|
|
239
242
|
enableBoxAreaRendering(trigger: EventSubject<RenderingBox>): CanvasBuilder;
|
|
@@ -333,6 +336,12 @@ declare interface ConnectablePortsConfig {
|
|
|
333
336
|
export { ConnectablePortsConfig }
|
|
334
337
|
export { ConnectablePortsConfig as ConnectablePortsOptions }
|
|
335
338
|
|
|
339
|
+
export declare enum ConnectionCategory {
|
|
340
|
+
Line = "line",
|
|
341
|
+
NodeCycle = "node-cycle",
|
|
342
|
+
PortCycle = "port-cycle"
|
|
343
|
+
}
|
|
344
|
+
|
|
336
345
|
export declare type ConnectionPreprocessor = (request: AddEdgeRequest) => AddEdgeRequest | null;
|
|
337
346
|
|
|
338
347
|
export declare type ConnectionTypeResolver = (portId: unknown) => "direct" | "reverse" | null;
|
|
@@ -400,6 +409,7 @@ declare interface DraggableNodesConfig {
|
|
|
400
409
|
readonly mouseDownEventVerifier?: MouseEventVerifier;
|
|
401
410
|
readonly mouseUpEventVerifier?: MouseEventVerifier;
|
|
402
411
|
};
|
|
412
|
+
readonly gridSize?: number | null;
|
|
403
413
|
readonly events?: {
|
|
404
414
|
readonly onNodeDrag?: (payload: NodeDragPayload) => void;
|
|
405
415
|
readonly onBeforeNodeDrag?: (payload: NodeDragPayload) => boolean;
|
|
@@ -428,6 +438,7 @@ declare interface EdgePayload {
|
|
|
428
438
|
export declare interface EdgeRenderParams {
|
|
429
439
|
readonly from: EdgeRenderPort;
|
|
430
440
|
readonly to: EdgeRenderPort;
|
|
441
|
+
readonly category: ConnectionCategory;
|
|
431
442
|
}
|
|
432
443
|
|
|
433
444
|
export declare interface EdgeRenderPort {
|
|
@@ -436,7 +447,15 @@ export declare interface EdgeRenderPort {
|
|
|
436
447
|
readonly width: number;
|
|
437
448
|
readonly height: number;
|
|
438
449
|
readonly direction: number;
|
|
450
|
+
/**
|
|
451
|
+
* @deprecated
|
|
452
|
+
* use category instead
|
|
453
|
+
*/
|
|
439
454
|
readonly portId: unknown;
|
|
455
|
+
/**
|
|
456
|
+
* @deprecated
|
|
457
|
+
* use category instead
|
|
458
|
+
*/
|
|
440
459
|
readonly nodeId: unknown;
|
|
441
460
|
}
|
|
442
461
|
|
|
@@ -752,6 +771,9 @@ export { MidpointEdgeShape }
|
|
|
752
771
|
|
|
753
772
|
export declare type MouseEventVerifier = (event: MouseEvent) => boolean;
|
|
754
773
|
|
|
774
|
+
/**
|
|
775
|
+
* TODO: replace with node ID
|
|
776
|
+
*/
|
|
755
777
|
export declare interface NodeDragPayload {
|
|
756
778
|
readonly nodeId: unknown;
|
|
757
779
|
readonly element: HTMLElement;
|
|
@@ -983,6 +1005,10 @@ declare type VerticalEdgeShapeConfig = {
|
|
|
983
1005
|
|
|
984
1006
|
export declare class Viewport {
|
|
985
1007
|
private readonly viewportStore;
|
|
1008
|
+
/**
|
|
1009
|
+
* @deprecated
|
|
1010
|
+
* do not use
|
|
1011
|
+
*/
|
|
986
1012
|
readonly onBeforeUpdated: EventHandler<void>;
|
|
987
1013
|
readonly onAfterUpdated: EventHandler<void>;
|
|
988
1014
|
constructor(viewportStore: ViewportStore);
|
|
@@ -996,6 +1022,10 @@ declare class ViewportStore {
|
|
|
996
1022
|
private readonly afterUpdateEmitter;
|
|
997
1023
|
readonly onAfterUpdated: EventHandler<void>;
|
|
998
1024
|
private readonly beforeUpdateEmitter;
|
|
1025
|
+
/**
|
|
1026
|
+
* @deprecated
|
|
1027
|
+
* do not use
|
|
1028
|
+
*/
|
|
999
1029
|
readonly onBeforeUpdated: EventHandler<void>;
|
|
1000
1030
|
constructor();
|
|
1001
1031
|
getViewportMatrix(): TransformState;
|
|
@@ -1033,6 +1063,10 @@ export declare interface VirtualScrollConfig {
|
|
|
1033
1063
|
readonly vertical: number;
|
|
1034
1064
|
readonly horizontal: number;
|
|
1035
1065
|
};
|
|
1066
|
+
readonly events?: {
|
|
1067
|
+
readonly onBeforeNodeAttached?: (nodeId: unknown) => void;
|
|
1068
|
+
readonly onAfterNodeDetached?: (nodeId: unknown) => void;
|
|
1069
|
+
};
|
|
1036
1070
|
}
|
|
1037
1071
|
|
|
1038
1072
|
export { }
|