@html-graph/html-graph 3.2.0 → 3.3.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 +39 -7
- package/dist/html-graph.js +669 -410
- package/dist/html-graph.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/html-graph.d.ts
CHANGED
|
@@ -124,12 +124,15 @@ export declare class Canvas {
|
|
|
124
124
|
private readonly onBeforeEdgeRemoved;
|
|
125
125
|
private readonly onBeforeClear;
|
|
126
126
|
private readonly onBeforeDestroyEmitter;
|
|
127
|
+
/**
|
|
128
|
+
* emits event just before destruction of canvas
|
|
129
|
+
*/
|
|
127
130
|
readonly onBeforeDestroy: EventHandler<void>;
|
|
128
131
|
constructor(
|
|
129
132
|
/**
|
|
130
133
|
* @deprecated access element directly instead
|
|
131
134
|
*/
|
|
132
|
-
element: HTMLElement, graphStore: GraphStore, viewportStore: ViewportStore, htmlView: HtmlView,
|
|
135
|
+
element: HTMLElement, graphStore: GraphStore, viewportStore: ViewportStore, htmlView: HtmlView, defaults: CanvasDefaults);
|
|
133
136
|
/**
|
|
134
137
|
* adds new node
|
|
135
138
|
*/
|
|
@@ -198,12 +201,15 @@ export declare class CanvasBuilder {
|
|
|
198
201
|
private dragOptions;
|
|
199
202
|
private transformOptions;
|
|
200
203
|
private backgroundOptions;
|
|
204
|
+
private connectablePortsOptions;
|
|
201
205
|
private virtualScrollOptions;
|
|
202
206
|
private hasDraggableNode;
|
|
203
207
|
private hasTransformableViewport;
|
|
204
208
|
private hasResizeReactiveNodes;
|
|
205
209
|
private hasBackground;
|
|
210
|
+
private hasUserConnectablePorts;
|
|
206
211
|
private boxRenderingTrigger;
|
|
212
|
+
private readonly window;
|
|
207
213
|
setElement(element: HTMLElement): CanvasBuilder;
|
|
208
214
|
/**
|
|
209
215
|
* specifies default values for graph entities
|
|
@@ -225,8 +231,19 @@ export declare class CanvasBuilder {
|
|
|
225
231
|
* sets emitter for rendering graph inside bounded area
|
|
226
232
|
*/
|
|
227
233
|
enableBoxAreaRendering(trigger: EventSubject<RenderingBox>): CanvasBuilder;
|
|
234
|
+
/**
|
|
235
|
+
* enables built-in virtual scroll behavior, when only nodes and edges close
|
|
236
|
+
* to viewport are rendered
|
|
237
|
+
*/
|
|
228
238
|
enableVirtualScroll(options: VirtualScrollOptions): CanvasBuilder;
|
|
239
|
+
/**
|
|
240
|
+
* enables built-in background rendering
|
|
241
|
+
*/
|
|
229
242
|
enableBackground(options?: BackgroundOptions): CanvasBuilder;
|
|
243
|
+
/**
|
|
244
|
+
* enables edge creation by dragging one port to another
|
|
245
|
+
*/
|
|
246
|
+
enableUserConnectablePorts(options?: ConnectablePortsOptions): CanvasBuilder;
|
|
230
247
|
/**
|
|
231
248
|
* builds final canvas
|
|
232
249
|
*/
|
|
@@ -279,6 +296,19 @@ export declare interface CanvasDefaults {
|
|
|
279
296
|
|
|
280
297
|
export declare type CenterFn = (width: number, height: number) => Point;
|
|
281
298
|
|
|
299
|
+
export declare interface ConnectablePortsOptions {
|
|
300
|
+
readonly connectionTypeResolver?: ConnectionTypeResolver;
|
|
301
|
+
readonly connectionPreprocessor?: ConnectionPreprocessor;
|
|
302
|
+
readonly mouseDownEventVerifier?: MouseEventVerifier;
|
|
303
|
+
readonly events?: {
|
|
304
|
+
readonly onAfterEdgeCreated?: (edgeId: unknown) => void;
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export declare type ConnectionPreprocessor = (request: AddEdgeRequest) => AddEdgeRequest | null;
|
|
309
|
+
|
|
310
|
+
export declare type ConnectionTypeResolver = (portId: unknown) => "direct" | "reverse" | null;
|
|
311
|
+
|
|
282
312
|
declare type ConstantPriority = number;
|
|
283
313
|
|
|
284
314
|
declare type CustomPriority = PriorityFn;
|
|
@@ -292,8 +322,8 @@ export declare interface DragOptions {
|
|
|
292
322
|
readonly moveOnTop?: boolean;
|
|
293
323
|
readonly mouse?: {
|
|
294
324
|
readonly dragCursor?: string | null;
|
|
295
|
-
readonly mouseDownEventVerifier?:
|
|
296
|
-
readonly mouseUpEventVerifier?:
|
|
325
|
+
readonly mouseDownEventVerifier?: MouseEventVerifier;
|
|
326
|
+
readonly mouseUpEventVerifier?: MouseEventVerifier;
|
|
297
327
|
};
|
|
298
328
|
readonly events?: {
|
|
299
329
|
readonly onNodeDrag?: (payload: NodeDragPayload) => void;
|
|
@@ -560,6 +590,8 @@ export declare interface MarkPortRequest {
|
|
|
560
590
|
readonly direction?: number;
|
|
561
591
|
}
|
|
562
592
|
|
|
593
|
+
export declare type MouseEventVerifier = (event: MouseEvent) => boolean;
|
|
594
|
+
|
|
563
595
|
export declare interface NodeDragPayload {
|
|
564
596
|
readonly nodeId: unknown;
|
|
565
597
|
readonly element: HTMLElement;
|
|
@@ -673,8 +705,8 @@ export declare interface TransformOptions {
|
|
|
673
705
|
};
|
|
674
706
|
readonly shift?: {
|
|
675
707
|
readonly cursor?: string | null;
|
|
676
|
-
readonly mouseDownEventVerifier?:
|
|
677
|
-
readonly mouseUpEventVerifier?:
|
|
708
|
+
readonly mouseDownEventVerifier?: MouseEventVerifier;
|
|
709
|
+
readonly mouseUpEventVerifier?: MouseEventVerifier;
|
|
678
710
|
};
|
|
679
711
|
readonly transformPreprocessor?: TransformPreprocessorOption | TransformPreprocessorOption[];
|
|
680
712
|
readonly events?: {
|
|
@@ -797,10 +829,10 @@ declare type VerticalEdgeShapeConfig = {
|
|
|
797
829
|
* Responsibility: Provides access to viewport state for end user
|
|
798
830
|
*/
|
|
799
831
|
export declare class Viewport {
|
|
800
|
-
private readonly
|
|
832
|
+
private readonly viewportStore;
|
|
801
833
|
readonly onBeforeUpdated: EventHandler<void>;
|
|
802
834
|
readonly onAfterUpdated: EventHandler<void>;
|
|
803
|
-
constructor(
|
|
835
|
+
constructor(viewportStore: ViewportStore);
|
|
804
836
|
getViewportMatrix(): TransformState;
|
|
805
837
|
getContentMatrix(): TransformState;
|
|
806
838
|
}
|