@html-graph/html-graph 0.0.61 → 0.1.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 +28 -41
- package/dist/main.d.ts +204 -217
- package/dist/main.js +1604 -1484
- package/dist/main.umd.cjs +1 -1
- package/package.json +2 -1
package/dist/main.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare interface AddEdgeRequest {
|
|
|
2
2
|
readonly id?: unknown;
|
|
3
3
|
readonly from: string;
|
|
4
4
|
readonly to: string;
|
|
5
|
-
readonly shape?:
|
|
5
|
+
readonly shape?: EdgeShape;
|
|
6
6
|
readonly priority?: number;
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -39,22 +39,42 @@ declare interface AddPortRequest {
|
|
|
39
39
|
readonly portId: unknown;
|
|
40
40
|
readonly nodeId: unknown;
|
|
41
41
|
readonly element: HTMLElement;
|
|
42
|
-
readonly centerFn: CenterFn;
|
|
43
42
|
readonly direction: number;
|
|
44
43
|
}
|
|
45
44
|
|
|
45
|
+
export declare type BeforeTransformStartedFn = () => void;
|
|
46
|
+
|
|
47
|
+
export declare interface BezierEdgeParams {
|
|
48
|
+
readonly color?: string | undefined;
|
|
49
|
+
readonly width?: number | undefined;
|
|
50
|
+
readonly arrowLength?: number | undefined;
|
|
51
|
+
readonly arrowWidth?: number | undefined;
|
|
52
|
+
readonly curvature?: number | undefined;
|
|
53
|
+
readonly hasSourceArrow?: boolean | undefined;
|
|
54
|
+
readonly hasTargetArrow?: boolean | undefined;
|
|
55
|
+
readonly cycleRadius?: number | undefined;
|
|
56
|
+
readonly smallCycleRadius?: number | undefined;
|
|
57
|
+
readonly detourDistance?: number | undefined;
|
|
58
|
+
readonly detourDirection?: number | undefined;
|
|
59
|
+
}
|
|
60
|
+
|
|
46
61
|
export declare class BezierEdgeShape implements EdgeShape {
|
|
47
|
-
private readonly curvature;
|
|
48
|
-
private readonly arrowLength;
|
|
49
|
-
private readonly arrowWidth;
|
|
50
62
|
readonly svg: SVGSVGElement;
|
|
51
63
|
private readonly group;
|
|
52
64
|
private readonly line;
|
|
53
65
|
private readonly sourceArrow;
|
|
54
66
|
private readonly targetArrow;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
private
|
|
67
|
+
private readonly arrowLength;
|
|
68
|
+
private readonly arrowWidth;
|
|
69
|
+
private readonly curvature;
|
|
70
|
+
private readonly portCycleRadius;
|
|
71
|
+
private readonly portCycleSmallRadius;
|
|
72
|
+
private readonly detourDirection;
|
|
73
|
+
private readonly detourDistance;
|
|
74
|
+
private readonly hasSourceArrow;
|
|
75
|
+
private readonly hasTargetArrow;
|
|
76
|
+
constructor(params?: BezierEdgeParams);
|
|
77
|
+
render(params: EdgeRenderParams): void;
|
|
58
78
|
}
|
|
59
79
|
|
|
60
80
|
declare interface BezierEdgeShape_2 {
|
|
@@ -102,12 +122,12 @@ export declare interface Canvas {
|
|
|
102
122
|
/**
|
|
103
123
|
* updates port and attached edges
|
|
104
124
|
*/
|
|
105
|
-
updatePort(portId:
|
|
125
|
+
updatePort(portId: unknown, request?: UpdatePortRequest): Canvas;
|
|
106
126
|
/**
|
|
107
127
|
* ummarks element as port of node
|
|
108
128
|
* all the edges adjacent to port get removed
|
|
109
129
|
*/
|
|
110
|
-
unmarkPort(portId:
|
|
130
|
+
unmarkPort(portId: unknown): Canvas;
|
|
111
131
|
/**
|
|
112
132
|
* adds edge to graph
|
|
113
133
|
*/
|
|
@@ -157,26 +177,23 @@ export declare class CanvasCore implements Canvas {
|
|
|
157
177
|
private readonly apiOptions?;
|
|
158
178
|
readonly transformation: PublicViewportTransformer;
|
|
159
179
|
readonly model: PublicGraphStore;
|
|
160
|
-
private readonly
|
|
180
|
+
private readonly canvasController;
|
|
161
181
|
private readonly edgeShapeFactory;
|
|
162
|
-
private readonly nodes;
|
|
163
|
-
private readonly nodeIdGenerator;
|
|
164
|
-
private readonly nodesResizeObserver;
|
|
165
182
|
constructor(apiOptions?: CoreOptions | undefined);
|
|
183
|
+
attach(element: HTMLElement): CanvasCore;
|
|
184
|
+
detach(): CanvasCore;
|
|
166
185
|
addNode(request: AddNodeRequest): CanvasCore;
|
|
167
186
|
updateNode(nodeId: unknown, request?: UpdateNodeRequest): CanvasCore;
|
|
168
187
|
removeNode(nodeId: unknown): CanvasCore;
|
|
169
|
-
markPort(port: MarkPortRequest): CanvasCore;
|
|
170
|
-
updatePort(portId: string, request?: UpdatePortRequest): CanvasCore;
|
|
171
|
-
unmarkPort(portId: string): CanvasCore;
|
|
172
188
|
addEdge(edge: AddEdgeRequest): CanvasCore;
|
|
173
189
|
updateEdge(edgeId: unknown, request?: UpdateEdgeRequest): CanvasCore;
|
|
174
190
|
removeEdge(edgeId: unknown): CanvasCore;
|
|
191
|
+
markPort(port: MarkPortRequest): CanvasCore;
|
|
192
|
+
updatePort(portId: string, request?: UpdatePortRequest): CanvasCore;
|
|
193
|
+
unmarkPort(portId: string): CanvasCore;
|
|
175
194
|
patchViewportMatrix(request: PatchMatrixRequest): CanvasCore;
|
|
176
195
|
patchContentMatrix(request: PatchMatrixRequest): CanvasCore;
|
|
177
196
|
clear(): CanvasCore;
|
|
178
|
-
attach(element: HTMLElement): CanvasCore;
|
|
179
|
-
detach(): CanvasCore;
|
|
180
197
|
destroy(): void;
|
|
181
198
|
}
|
|
182
199
|
|
|
@@ -203,11 +220,6 @@ export declare interface CoreOptions {
|
|
|
203
220
|
* ports related behavior
|
|
204
221
|
*/
|
|
205
222
|
readonly ports?: {
|
|
206
|
-
/**
|
|
207
|
-
* specifies how to determine center of port
|
|
208
|
-
* center of port determines point to which edge attaches
|
|
209
|
-
*/
|
|
210
|
-
readonly centerFn?: CenterFn;
|
|
211
223
|
/**
|
|
212
224
|
* specifies default direction of port
|
|
213
225
|
*/
|
|
@@ -228,136 +240,14 @@ export declare interface CoreOptions {
|
|
|
228
240
|
};
|
|
229
241
|
}
|
|
230
242
|
|
|
231
|
-
export declare const createBezierEdgeShapeFactory: (options: {
|
|
232
|
-
color: string;
|
|
233
|
-
width: number;
|
|
234
|
-
arrowLength: number;
|
|
235
|
-
arrowWidth: number;
|
|
236
|
-
curvature: number;
|
|
237
|
-
hasSourceArrow: boolean;
|
|
238
|
-
hasTargetArrow: boolean;
|
|
239
|
-
cycleRadius: number;
|
|
240
|
-
smallCycleRadius: number;
|
|
241
|
-
detourDistance: number;
|
|
242
|
-
detourDirection: number;
|
|
243
|
-
}) => EdgeShapeFactory;
|
|
244
|
-
|
|
245
|
-
export declare const createHorizontalEdgeShapeFactory: (options: {
|
|
246
|
-
color: string;
|
|
247
|
-
width: number;
|
|
248
|
-
arrowLength: number;
|
|
249
|
-
arrowWidth: number;
|
|
250
|
-
arrowOffset: number;
|
|
251
|
-
hasSourceArrow: boolean;
|
|
252
|
-
hasTargetArrow: boolean;
|
|
253
|
-
cycleSquareSide: number;
|
|
254
|
-
roundness: number;
|
|
255
|
-
detourDistance: number;
|
|
256
|
-
detourDirection: number;
|
|
257
|
-
}) => EdgeShapeFactory;
|
|
258
|
-
|
|
259
|
-
export declare const createStraightEdgeShareFactory: (options: {
|
|
260
|
-
color: string;
|
|
261
|
-
width: number;
|
|
262
|
-
arrowLength: number;
|
|
263
|
-
arrowWidth: number;
|
|
264
|
-
arrowOffset: number;
|
|
265
|
-
hasSourceArrow: boolean;
|
|
266
|
-
hasTargetArrow: boolean;
|
|
267
|
-
cycleSquareSide: number;
|
|
268
|
-
roundness: number;
|
|
269
|
-
detourDistance: number;
|
|
270
|
-
detourDirection: number;
|
|
271
|
-
}) => EdgeShapeFactory;
|
|
272
|
-
|
|
273
|
-
export declare const createVerticalEdgeShapeFactory: (options: {
|
|
274
|
-
color: string;
|
|
275
|
-
width: number;
|
|
276
|
-
arrowLength: number;
|
|
277
|
-
arrowWidth: number;
|
|
278
|
-
arrowOffset: number;
|
|
279
|
-
hasSourceArrow: boolean;
|
|
280
|
-
hasTargetArrow: boolean;
|
|
281
|
-
cycleSquareSide: number;
|
|
282
|
-
roundness: number;
|
|
283
|
-
detourDistance: number;
|
|
284
|
-
detourDirection: number;
|
|
285
|
-
}) => EdgeShapeFactory;
|
|
286
|
-
|
|
287
|
-
declare interface CustomEdgeShape {
|
|
288
|
-
readonly type: "custom";
|
|
289
|
-
readonly factory: EdgeShapeFactory;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
243
|
declare type CustomPriority = PriorityFn;
|
|
293
244
|
|
|
294
|
-
export declare class CycleCircleEdgeShape implements EdgeShape {
|
|
295
|
-
private readonly arrowLength;
|
|
296
|
-
private readonly arrowWidth;
|
|
297
|
-
private readonly radius;
|
|
298
|
-
private readonly smallRadius;
|
|
299
|
-
readonly svg: SVGSVGElement;
|
|
300
|
-
private readonly line;
|
|
301
|
-
private readonly arrow;
|
|
302
|
-
constructor(color: string, width: number, arrowLength: number, arrowWidth: number, hasArrow: boolean, radius: number, smallRadius: number);
|
|
303
|
-
update(_to: Point, flipX: number, flipY: number, fromDir: number): void;
|
|
304
|
-
private createLinePath;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
export declare class CycleSquareEdgeShape implements EdgeShape {
|
|
308
|
-
private readonly arrowLength;
|
|
309
|
-
private readonly arrowWidth;
|
|
310
|
-
private readonly side;
|
|
311
|
-
private readonly minPortOffset;
|
|
312
|
-
readonly svg: SVGSVGElement;
|
|
313
|
-
private readonly line;
|
|
314
|
-
private readonly arrow;
|
|
315
|
-
private readonly roundness;
|
|
316
|
-
private readonly linePoints;
|
|
317
|
-
constructor(color: string, width: number, arrowLength: number, arrowWidth: number, hasArrow: boolean, side: number, minPortOffset: number, roundness: number);
|
|
318
|
-
update(_to: Point, flipX: number, flipY: number, fromDir: number): void;
|
|
319
|
-
private createLinePath;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
export declare class DetourBezierEdgeShape implements EdgeShape {
|
|
323
|
-
private readonly curvature;
|
|
324
|
-
private readonly arrowLength;
|
|
325
|
-
private readonly arrowWidth;
|
|
326
|
-
readonly svg: SVGSVGElement;
|
|
327
|
-
private readonly group;
|
|
328
|
-
private readonly line;
|
|
329
|
-
private readonly sourceArrow;
|
|
330
|
-
private readonly targetArrow;
|
|
331
|
-
private readonly detourX;
|
|
332
|
-
private readonly detourY;
|
|
333
|
-
constructor(color: string, width: number, curvature: number, arrowLength: number, arrowWidth: number, hasSourceArrow: boolean, hasTargetArrow: boolean, detourDistance: number, detourDirection: number);
|
|
334
|
-
update(to: Point, flipX: number, flipY: number, fromDir: number, toDir: number): void;
|
|
335
|
-
private createLinePath;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
export declare class DetourStraightEdgeShape implements EdgeShape {
|
|
339
|
-
private readonly arrowLength;
|
|
340
|
-
private readonly arrowWidth;
|
|
341
|
-
private readonly arrowOffset;
|
|
342
|
-
private readonly roundness;
|
|
343
|
-
readonly svg: SVGSVGElement;
|
|
344
|
-
private readonly group;
|
|
345
|
-
private readonly line;
|
|
346
|
-
private readonly sourceArrow;
|
|
347
|
-
private readonly targetArrow;
|
|
348
|
-
private readonly detourX;
|
|
349
|
-
private readonly detourY;
|
|
350
|
-
constructor(color: string, width: number, arrowLength: number, arrowWidth: number, arrowOffset: number, hasSourceArrow: boolean, hasTargetArrow: boolean, roundness: number, detourDistance: number, detourDirection: number);
|
|
351
|
-
update(to: Point, flipX: number, flipY: number, fromDir: number, toDir: number): void;
|
|
352
|
-
private createLinePath;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
245
|
export declare interface DragOptions {
|
|
356
|
-
|
|
357
|
-
dragCursor?: string | null;
|
|
358
|
-
events?: {
|
|
359
|
-
onNodeDrag?: (payload: NodeDragPayload) => void;
|
|
360
|
-
onBeforeNodeDrag?: (payload: NodeDragPayload) => boolean;
|
|
246
|
+
readonly moveOnTop?: boolean;
|
|
247
|
+
readonly dragCursor?: string | null;
|
|
248
|
+
readonly events?: {
|
|
249
|
+
readonly onNodeDrag?: (payload: NodeDragPayload) => void;
|
|
250
|
+
readonly onBeforeNodeDrag?: (payload: NodeDragPayload) => boolean;
|
|
361
251
|
};
|
|
362
252
|
}
|
|
363
253
|
|
|
@@ -368,20 +258,29 @@ declare interface EdgePayload {
|
|
|
368
258
|
priority: number;
|
|
369
259
|
}
|
|
370
260
|
|
|
261
|
+
export declare interface EdgeRenderParams {
|
|
262
|
+
readonly source: EdgeRenderPort;
|
|
263
|
+
readonly target: EdgeRenderPort;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export declare interface EdgeRenderPort {
|
|
267
|
+
readonly x: number;
|
|
268
|
+
readonly y: number;
|
|
269
|
+
readonly width: number;
|
|
270
|
+
readonly height: number;
|
|
271
|
+
readonly direction: number;
|
|
272
|
+
readonly portId: unknown;
|
|
273
|
+
readonly nodeId: unknown;
|
|
274
|
+
}
|
|
275
|
+
|
|
371
276
|
export declare interface EdgeShape {
|
|
372
277
|
readonly svg: SVGSVGElement;
|
|
373
|
-
|
|
278
|
+
render(params: EdgeRenderParams): void;
|
|
374
279
|
}
|
|
375
280
|
|
|
376
|
-
declare type EdgeShape_2 = BezierEdgeShape_2 | StraightEdgeShape_2 |
|
|
281
|
+
declare type EdgeShape_2 = BezierEdgeShape_2 | StraightEdgeShape_2 | HorizontalEdgeShape_2 | VerticalEdgeShape_2 | EdgeShapeFactory;
|
|
377
282
|
|
|
378
|
-
declare type EdgeShapeFactory = (
|
|
379
|
-
|
|
380
|
-
export declare enum EdgeType {
|
|
381
|
-
Regular = "regular",
|
|
382
|
-
PortCycle = "port-cycle",
|
|
383
|
-
NodeCycle = "node-cycle"
|
|
384
|
-
}
|
|
283
|
+
declare type EdgeShapeFactory = () => EdgeShape;
|
|
385
284
|
|
|
386
285
|
export declare interface GraphEdge {
|
|
387
286
|
readonly from: unknown;
|
|
@@ -399,7 +298,6 @@ export declare interface GraphNode {
|
|
|
399
298
|
|
|
400
299
|
export declare interface GraphPort {
|
|
401
300
|
readonly element: HTMLElement;
|
|
402
|
-
readonly centerFn: CenterFn;
|
|
403
301
|
readonly direction: number;
|
|
404
302
|
}
|
|
405
303
|
|
|
@@ -423,6 +321,8 @@ declare class GraphStore {
|
|
|
423
321
|
getPortNodeId(portId: unknown): unknown | undefined;
|
|
424
322
|
removePort(portId: unknown): void;
|
|
425
323
|
addEdge(request: AddEdgeRequest_2): void;
|
|
324
|
+
updateEdgeFrom(edgeId: unknown, from: unknown): void;
|
|
325
|
+
updateEdgeTo(edgeId: unknown, to: unknown): void;
|
|
426
326
|
getAllEdgeIds(): readonly unknown[];
|
|
427
327
|
getEdge(edgeId: unknown): EdgePayload | undefined;
|
|
428
328
|
removeEdge(edgeId: unknown): void;
|
|
@@ -437,19 +337,37 @@ declare class GraphStore {
|
|
|
437
337
|
getNodeAdjacentEdgeIds(nodeId: unknown): readonly unknown[];
|
|
438
338
|
}
|
|
439
339
|
|
|
340
|
+
export declare interface HorizontalEdgeParams {
|
|
341
|
+
readonly color?: string | undefined;
|
|
342
|
+
readonly width?: number | undefined;
|
|
343
|
+
readonly arrowLength?: number | undefined;
|
|
344
|
+
readonly arrowWidth?: number | undefined;
|
|
345
|
+
readonly arrowOffset?: number | undefined;
|
|
346
|
+
readonly hasSourceArrow?: boolean | undefined;
|
|
347
|
+
readonly hasTargetArrow?: boolean | undefined;
|
|
348
|
+
readonly cycleSquareSide?: number | undefined;
|
|
349
|
+
readonly roundness?: number | undefined;
|
|
350
|
+
readonly detourDistance?: number | undefined;
|
|
351
|
+
readonly detourDirection?: number | undefined;
|
|
352
|
+
}
|
|
353
|
+
|
|
440
354
|
export declare class HorizontalEdgeShape implements EdgeShape {
|
|
441
|
-
private readonly arrowLength;
|
|
442
|
-
private readonly arrowWidth;
|
|
443
|
-
private readonly arrowOffset;
|
|
444
|
-
private readonly roundness;
|
|
445
355
|
readonly svg: SVGSVGElement;
|
|
446
356
|
private readonly group;
|
|
447
357
|
private readonly line;
|
|
448
358
|
private readonly sourceArrow;
|
|
449
359
|
private readonly targetArrow;
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
private
|
|
360
|
+
private readonly arrowLength;
|
|
361
|
+
private readonly arrowWidth;
|
|
362
|
+
private readonly arrowOffset;
|
|
363
|
+
private readonly roundness;
|
|
364
|
+
private readonly cycleSquareSide;
|
|
365
|
+
private readonly detourDirection;
|
|
366
|
+
private readonly detourDistance;
|
|
367
|
+
private readonly hasSourceArrow;
|
|
368
|
+
private readonly hasTargetArrow;
|
|
369
|
+
constructor(params?: HorizontalEdgeParams);
|
|
370
|
+
render(params: EdgeRenderParams): void;
|
|
453
371
|
}
|
|
454
372
|
|
|
455
373
|
declare interface HorizontalEdgeShape_2 {
|
|
@@ -473,9 +391,11 @@ export declare class HtmlGraphBuilder {
|
|
|
473
391
|
private transformOptions;
|
|
474
392
|
private isDraggable;
|
|
475
393
|
private isTransformable;
|
|
394
|
+
private hasResizeReactiveNodes;
|
|
476
395
|
setOptions(options: CoreOptions): HtmlGraphBuilder;
|
|
477
396
|
setUserDraggableNodes(options?: DragOptions): HtmlGraphBuilder;
|
|
478
397
|
setUserTransformableCanvas(options?: TransformOptions): HtmlGraphBuilder;
|
|
398
|
+
setResizeReactiveNodes(): HtmlGraphBuilder;
|
|
479
399
|
build(): Canvas;
|
|
480
400
|
}
|
|
481
401
|
|
|
@@ -488,7 +408,6 @@ declare type IncrementalPriority = "incremental";
|
|
|
488
408
|
export declare type MarkNodePortRequest = {
|
|
489
409
|
readonly id?: unknown;
|
|
490
410
|
readonly element: HTMLElement;
|
|
491
|
-
readonly centerFn?: CenterFn;
|
|
492
411
|
readonly direction?: number;
|
|
493
412
|
};
|
|
494
413
|
|
|
@@ -496,7 +415,6 @@ export declare interface MarkPortRequest {
|
|
|
496
415
|
readonly id?: unknown;
|
|
497
416
|
readonly element: HTMLElement;
|
|
498
417
|
readonly nodeId: unknown;
|
|
499
|
-
readonly centerFn?: CenterFn;
|
|
500
418
|
readonly direction?: number;
|
|
501
419
|
}
|
|
502
420
|
|
|
@@ -534,7 +452,6 @@ export declare interface Point {
|
|
|
534
452
|
|
|
535
453
|
declare interface PortPayload {
|
|
536
454
|
readonly element: HTMLElement;
|
|
537
|
-
centerFn: CenterFn;
|
|
538
455
|
direction: number;
|
|
539
456
|
}
|
|
540
457
|
|
|
@@ -570,21 +487,77 @@ export declare class PublicViewportTransformer {
|
|
|
570
487
|
getContentMatrix(): TransformState;
|
|
571
488
|
}
|
|
572
489
|
|
|
490
|
+
export declare class ResizeReactiveNodesCanvas implements Canvas {
|
|
491
|
+
private readonly canvas;
|
|
492
|
+
readonly transformation: PublicViewportTransformer;
|
|
493
|
+
readonly model: PublicGraphStore;
|
|
494
|
+
private readonly nodes;
|
|
495
|
+
private readonly nodeIdGenerator;
|
|
496
|
+
private readonly nodesResizeObserver;
|
|
497
|
+
constructor(canvas: Canvas);
|
|
498
|
+
attach(element: HTMLElement): ResizeReactiveNodesCanvas;
|
|
499
|
+
detach(): ResizeReactiveNodesCanvas;
|
|
500
|
+
addNode(request: AddNodeRequest): ResizeReactiveNodesCanvas;
|
|
501
|
+
updateNode(nodeId: unknown, request?: UpdateNodeRequest): ResizeReactiveNodesCanvas;
|
|
502
|
+
removeNode(nodeId: unknown): ResizeReactiveNodesCanvas;
|
|
503
|
+
markPort(port: MarkPortRequest): ResizeReactiveNodesCanvas;
|
|
504
|
+
updatePort(portId: string, request?: UpdatePortRequest): ResizeReactiveNodesCanvas;
|
|
505
|
+
unmarkPort(portId: string): ResizeReactiveNodesCanvas;
|
|
506
|
+
addEdge(edge: AddEdgeRequest): ResizeReactiveNodesCanvas;
|
|
507
|
+
updateEdge(edgeId: unknown, request?: UpdateEdgeRequest): ResizeReactiveNodesCanvas;
|
|
508
|
+
removeEdge(edgeId: unknown): ResizeReactiveNodesCanvas;
|
|
509
|
+
patchViewportMatrix(request: PatchMatrixRequest): ResizeReactiveNodesCanvas;
|
|
510
|
+
patchContentMatrix(request: PatchMatrixRequest): ResizeReactiveNodesCanvas;
|
|
511
|
+
clear(): ResizeReactiveNodesCanvas;
|
|
512
|
+
destroy(): void;
|
|
513
|
+
private reactNodeChange;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
export declare interface ScaleLimitPreprocessorParams {
|
|
517
|
+
readonly minContentScale: number | null;
|
|
518
|
+
readonly maxContentScale: number | null;
|
|
519
|
+
}
|
|
520
|
+
|
|
573
521
|
declare type SharedIncrementalPriority = "shared-incremental";
|
|
574
522
|
|
|
523
|
+
export declare interface ShiftLimitPreprocessorParams {
|
|
524
|
+
readonly minX: number | null;
|
|
525
|
+
readonly maxX: number | null;
|
|
526
|
+
readonly minY: number | null;
|
|
527
|
+
readonly maxY: number | null;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
export declare interface StraightEdgeParams {
|
|
531
|
+
readonly color?: string | undefined;
|
|
532
|
+
readonly width?: number | undefined;
|
|
533
|
+
readonly arrowLength?: number | undefined;
|
|
534
|
+
readonly arrowWidth?: number | undefined;
|
|
535
|
+
readonly arrowOffset?: number | undefined;
|
|
536
|
+
readonly hasSourceArrow?: boolean | undefined;
|
|
537
|
+
readonly hasTargetArrow?: boolean | undefined;
|
|
538
|
+
readonly cycleSquareSide?: number | undefined;
|
|
539
|
+
readonly roundness?: number | undefined;
|
|
540
|
+
readonly detourDistance?: number | undefined;
|
|
541
|
+
readonly detourDirection?: number | undefined;
|
|
542
|
+
}
|
|
543
|
+
|
|
575
544
|
export declare class StraightEdgeShape implements EdgeShape {
|
|
576
|
-
private readonly arrowLength;
|
|
577
|
-
private readonly arrowWidth;
|
|
578
|
-
private readonly arrowOffset;
|
|
579
|
-
private readonly roundness;
|
|
580
545
|
readonly svg: SVGSVGElement;
|
|
581
546
|
private readonly group;
|
|
582
547
|
private readonly line;
|
|
583
548
|
private readonly sourceArrow;
|
|
584
549
|
private readonly targetArrow;
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
private
|
|
550
|
+
private readonly arrowLength;
|
|
551
|
+
private readonly arrowWidth;
|
|
552
|
+
private readonly arrowOffset;
|
|
553
|
+
private readonly roundness;
|
|
554
|
+
private readonly cycleSquareSide;
|
|
555
|
+
private readonly detourDirection;
|
|
556
|
+
private readonly detourDistance;
|
|
557
|
+
private readonly hasSourceArrow;
|
|
558
|
+
private readonly hasTargetArrow;
|
|
559
|
+
constructor(params?: StraightEdgeParams);
|
|
560
|
+
render(params: EdgeRenderParams): void;
|
|
588
561
|
}
|
|
589
562
|
|
|
590
563
|
declare interface StraightEdgeShape_2 {
|
|
@@ -606,15 +579,14 @@ export declare type TransformFinishedFn = () => void;
|
|
|
606
579
|
|
|
607
580
|
export declare interface TransformOptions {
|
|
608
581
|
readonly scale?: {
|
|
609
|
-
readonly enabled?: boolean;
|
|
610
582
|
readonly wheelSensitivity?: number;
|
|
611
583
|
};
|
|
612
584
|
readonly shift?: {
|
|
613
|
-
readonly enabled?: boolean;
|
|
614
585
|
readonly cursor?: string | null;
|
|
615
586
|
};
|
|
616
587
|
readonly transformPreprocessor?: TransformPreprocessorOption | TransformPreprocessorOption[];
|
|
617
588
|
readonly events?: {
|
|
589
|
+
readonly onBeforeTransformStarted?: BeforeTransformStartedFn;
|
|
618
590
|
readonly onTransformFinished?: TransformFinishedFn;
|
|
619
591
|
};
|
|
620
592
|
}
|
|
@@ -625,7 +597,7 @@ export declare interface TransformPayload {
|
|
|
625
597
|
readonly dy: number;
|
|
626
598
|
}
|
|
627
599
|
|
|
628
|
-
export declare type TransformPreprocessorFn = (
|
|
600
|
+
export declare type TransformPreprocessorFn = (params: TransformPreprocessorParams) => TransformPayload;
|
|
629
601
|
|
|
630
602
|
declare type TransformPreprocessorOption = {
|
|
631
603
|
readonly type: "scale-limit";
|
|
@@ -637,10 +609,14 @@ declare type TransformPreprocessorOption = {
|
|
|
637
609
|
readonly maxX?: number;
|
|
638
610
|
readonly minY?: number;
|
|
639
611
|
readonly maxY?: number;
|
|
640
|
-
} |
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
612
|
+
} | TransformPreprocessorFn;
|
|
613
|
+
|
|
614
|
+
export declare interface TransformPreprocessorParams {
|
|
615
|
+
readonly prevTransform: TransformPayload;
|
|
616
|
+
readonly nextTransform: TransformPayload;
|
|
617
|
+
readonly canvasWidth: number;
|
|
618
|
+
readonly canvasHeight: number;
|
|
619
|
+
}
|
|
644
620
|
|
|
645
621
|
declare interface TransformState {
|
|
646
622
|
readonly scale: number;
|
|
@@ -649,7 +625,9 @@ declare interface TransformState {
|
|
|
649
625
|
}
|
|
650
626
|
|
|
651
627
|
export declare interface UpdateEdgeRequest {
|
|
652
|
-
readonly
|
|
628
|
+
readonly from?: unknown;
|
|
629
|
+
readonly to?: unknown;
|
|
630
|
+
readonly shape?: EdgeShape;
|
|
653
631
|
readonly priority?: number;
|
|
654
632
|
}
|
|
655
633
|
|
|
@@ -660,9 +638,8 @@ declare interface UpdateNodeRequest {
|
|
|
660
638
|
readonly centerFn?: CenterFn;
|
|
661
639
|
}
|
|
662
640
|
|
|
663
|
-
declare interface UpdatePortRequest {
|
|
641
|
+
export declare interface UpdatePortRequest {
|
|
664
642
|
readonly direction?: number;
|
|
665
|
-
readonly centerFn?: CenterFn;
|
|
666
643
|
}
|
|
667
644
|
|
|
668
645
|
export declare class UserDraggableNodesCanvas implements Canvas {
|
|
@@ -676,16 +653,17 @@ export declare class UserDraggableNodesCanvas implements Canvas {
|
|
|
676
653
|
private onBeforeNodeDrag;
|
|
677
654
|
private readonly nodeIdGenerator;
|
|
678
655
|
private element;
|
|
679
|
-
private readonly
|
|
680
|
-
private readonly
|
|
681
|
-
private readonly
|
|
682
|
-
private readonly
|
|
683
|
-
private readonly onCanvasTouchEnd;
|
|
656
|
+
private readonly onWindowMouseMove;
|
|
657
|
+
private readonly onWindowMouseUp;
|
|
658
|
+
private readonly onWindowTouchMove;
|
|
659
|
+
private readonly onWindowTouchFinish;
|
|
684
660
|
private previousTouchCoords;
|
|
685
661
|
private readonly freezePriority;
|
|
686
662
|
private readonly window;
|
|
687
663
|
private readonly dragCursor;
|
|
688
664
|
constructor(canvas: Canvas, dragOptions?: DragOptions);
|
|
665
|
+
attach(element: HTMLElement): UserDraggableNodesCanvas;
|
|
666
|
+
detach(): UserDraggableNodesCanvas;
|
|
689
667
|
addNode(request: AddNodeRequest): UserDraggableNodesCanvas;
|
|
690
668
|
updateNode(nodeId: unknown, request?: UpdateNodeRequest): UserDraggableNodesCanvas;
|
|
691
669
|
removeNode(nodeId: unknown): UserDraggableNodesCanvas;
|
|
@@ -698,8 +676,6 @@ export declare class UserDraggableNodesCanvas implements Canvas {
|
|
|
698
676
|
patchViewportMatrix(request: PatchMatrixRequest): UserDraggableNodesCanvas;
|
|
699
677
|
patchContentMatrix(request: PatchMatrixRequest): UserDraggableNodesCanvas;
|
|
700
678
|
clear(): UserDraggableNodesCanvas;
|
|
701
|
-
attach(element: HTMLElement): UserDraggableNodesCanvas;
|
|
702
|
-
detach(): UserDraggableNodesCanvas;
|
|
703
679
|
destroy(): void;
|
|
704
680
|
private dragNode;
|
|
705
681
|
private updateMaxNodePriority;
|
|
@@ -712,27 +688,23 @@ export declare class UserDraggableNodesCanvas implements Canvas {
|
|
|
712
688
|
|
|
713
689
|
export declare class UserTransformableCanvas implements Canvas {
|
|
714
690
|
private readonly canvas;
|
|
715
|
-
private readonly options?;
|
|
716
691
|
readonly model: PublicGraphStore;
|
|
717
692
|
readonly transformation: PublicViewportTransformer;
|
|
718
693
|
private element;
|
|
719
694
|
private prevTouches;
|
|
720
|
-
private readonly onTransformFinished;
|
|
721
|
-
private readonly transformPreprocessor;
|
|
722
|
-
private readonly isScalable;
|
|
723
|
-
private readonly isShiftable;
|
|
724
|
-
private readonly wheelSensitivity;
|
|
725
695
|
private window;
|
|
726
696
|
private readonly onMouseDown;
|
|
727
|
-
private readonly
|
|
728
|
-
private readonly
|
|
697
|
+
private readonly onWindowMouseMove;
|
|
698
|
+
private readonly onWindowMouseUp;
|
|
729
699
|
private readonly onWheelScroll;
|
|
730
700
|
private readonly onTouchStart;
|
|
731
|
-
private readonly
|
|
732
|
-
private readonly
|
|
701
|
+
private readonly onWindowTouchMove;
|
|
702
|
+
private readonly onWindowTouchFinish;
|
|
733
703
|
private readonly observer;
|
|
734
|
-
private readonly
|
|
735
|
-
constructor(canvas: Canvas,
|
|
704
|
+
private readonly options;
|
|
705
|
+
constructor(canvas: Canvas, transformOptions?: TransformOptions);
|
|
706
|
+
attach(element: HTMLElement): UserTransformableCanvas;
|
|
707
|
+
detach(): UserTransformableCanvas;
|
|
736
708
|
addNode(node: AddNodeRequest): UserTransformableCanvas;
|
|
737
709
|
updateNode(nodeId: unknown, request?: UpdateNodeRequest): UserTransformableCanvas;
|
|
738
710
|
removeNode(nodeId: unknown): UserTransformableCanvas;
|
|
@@ -745,10 +717,7 @@ export declare class UserTransformableCanvas implements Canvas {
|
|
|
745
717
|
patchViewportMatrix(request: PatchMatrixRequest): UserTransformableCanvas;
|
|
746
718
|
patchContentMatrix(request: PatchMatrixRequest): UserTransformableCanvas;
|
|
747
719
|
clear(): UserTransformableCanvas;
|
|
748
|
-
attach(element: HTMLElement): UserTransformableCanvas;
|
|
749
|
-
detach(): UserTransformableCanvas;
|
|
750
720
|
destroy(): void;
|
|
751
|
-
private getAverageTouch;
|
|
752
721
|
private moveViewport;
|
|
753
722
|
private scaleViewport;
|
|
754
723
|
private stopMouseDrag;
|
|
@@ -757,19 +726,37 @@ export declare class UserTransformableCanvas implements Canvas {
|
|
|
757
726
|
private removeTouchDragListeners;
|
|
758
727
|
}
|
|
759
728
|
|
|
729
|
+
export declare interface VerticalEdgeParams {
|
|
730
|
+
readonly color?: string | undefined;
|
|
731
|
+
readonly width?: number | undefined;
|
|
732
|
+
readonly arrowLength?: number | undefined;
|
|
733
|
+
readonly arrowWidth?: number | undefined;
|
|
734
|
+
readonly arrowOffset?: number | undefined;
|
|
735
|
+
readonly hasSourceArrow?: boolean | undefined;
|
|
736
|
+
readonly hasTargetArrow?: boolean | undefined;
|
|
737
|
+
readonly cycleSquareSide?: number | undefined;
|
|
738
|
+
readonly roundness?: number | undefined;
|
|
739
|
+
readonly detourDistance?: number | undefined;
|
|
740
|
+
readonly detourDirection?: number | undefined;
|
|
741
|
+
}
|
|
742
|
+
|
|
760
743
|
export declare class VerticalEdgeShape implements EdgeShape {
|
|
761
|
-
private readonly arrowLength;
|
|
762
|
-
private readonly arrowWidth;
|
|
763
|
-
private readonly arrowOffset;
|
|
764
|
-
private readonly roundness;
|
|
765
744
|
readonly svg: SVGSVGElement;
|
|
766
745
|
private readonly group;
|
|
767
746
|
private readonly line;
|
|
768
747
|
private readonly sourceArrow;
|
|
769
748
|
private readonly targetArrow;
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
private
|
|
749
|
+
private readonly arrowLength;
|
|
750
|
+
private readonly arrowWidth;
|
|
751
|
+
private readonly arrowOffset;
|
|
752
|
+
private readonly roundness;
|
|
753
|
+
private readonly cycleSquareSide;
|
|
754
|
+
private readonly detourDirection;
|
|
755
|
+
private readonly detourDistance;
|
|
756
|
+
private readonly hasSourceArrow;
|
|
757
|
+
private readonly hasTargetArrow;
|
|
758
|
+
constructor(params?: VerticalEdgeParams);
|
|
759
|
+
render(params: EdgeRenderParams): void;
|
|
773
760
|
}
|
|
774
761
|
|
|
775
762
|
declare interface VerticalEdgeShape_2 {
|