@html-graph/html-graph 0.1.0 → 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 +26 -41
- package/dist/main.d.ts +131 -178
- package/dist/main.js +1412 -1338
- package/dist/main.umd.cjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,16 +15,6 @@ Port is an entity of a node to which edge can be attached to.
|
|
|
15
15
|
|
|
16
16
|
Visit <a target="_blank" href="https://html-graph.github.io/use-cases/">use cases</a> and [use cases implementation](use-cases).
|
|
17
17
|
|
|
18
|
-
## Features:
|
|
19
|
-
|
|
20
|
-
- easy nodes customization using HTML
|
|
21
|
-
- wide configuration options out of the box
|
|
22
|
-
- draggable and scalable canvas
|
|
23
|
-
- draggable and resizable nodes
|
|
24
|
-
- exhaustive set of use cases
|
|
25
|
-
- typescript support
|
|
26
|
-
- mobile devices support
|
|
27
|
-
|
|
28
18
|
## Getting started:
|
|
29
19
|
|
|
30
20
|
```
|
|
@@ -34,19 +24,6 @@ npm i @html-graph/html-graph
|
|
|
34
24
|
```javascript
|
|
35
25
|
import { HtmlGraphBuilder } from "@html-graph/html-graph";
|
|
36
26
|
|
|
37
|
-
const canvas = new HtmlGraphBuilder()
|
|
38
|
-
.setOptions({
|
|
39
|
-
edges: {
|
|
40
|
-
shape: {
|
|
41
|
-
hasTargetArrow: true,
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
})
|
|
45
|
-
.setUserDraggableNodes()
|
|
46
|
-
.setUserTransformableCanvas()
|
|
47
|
-
.setResizeReactiveNodes()
|
|
48
|
-
.build();
|
|
49
|
-
|
|
50
27
|
function createNode({ name, x, y, frontPortId, backPortId }) {
|
|
51
28
|
const node = document.createElement("div");
|
|
52
29
|
const text = document.createElement("div");
|
|
@@ -73,20 +50,33 @@ function createNode({ name, x, y, frontPortId, backPortId }) {
|
|
|
73
50
|
};
|
|
74
51
|
}
|
|
75
52
|
|
|
53
|
+
const canvas = new HtmlGraphBuilder()
|
|
54
|
+
.setOptions({
|
|
55
|
+
edges: {
|
|
56
|
+
shape: {
|
|
57
|
+
hasTargetArrow: true,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
})
|
|
61
|
+
.setUserDraggableNodes()
|
|
62
|
+
.setUserTransformableCanvas()
|
|
63
|
+
.setResizeReactiveNodes()
|
|
64
|
+
.build();
|
|
65
|
+
|
|
76
66
|
const node1 = createNode({
|
|
77
67
|
name: "Node 1",
|
|
78
68
|
x: 200,
|
|
79
69
|
y: 400,
|
|
80
|
-
frontPortId: "
|
|
81
|
-
backPortId: "
|
|
70
|
+
frontPortId: "node-1-in",
|
|
71
|
+
backPortId: "node-1-out",
|
|
82
72
|
});
|
|
83
73
|
|
|
84
74
|
const node2 = createNode({
|
|
85
75
|
name: "Node 2",
|
|
86
76
|
x: 600,
|
|
87
77
|
y: 500,
|
|
88
|
-
frontPortId: "
|
|
89
|
-
backPortId: "
|
|
78
|
+
frontPortId: "node-2-in",
|
|
79
|
+
backPortId: "node-2-out",
|
|
90
80
|
});
|
|
91
81
|
|
|
92
82
|
const canvasElement = document.getElementById("canvas");
|
|
@@ -95,20 +85,15 @@ canvas
|
|
|
95
85
|
.attach(canvasElement)
|
|
96
86
|
.addNode(node1)
|
|
97
87
|
.addNode(node2)
|
|
98
|
-
.addEdge({ from: "
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
## Run use cases
|
|
102
|
-
|
|
103
|
-
```
|
|
104
|
-
npm install
|
|
105
|
-
npm run start
|
|
88
|
+
.addEdge({ from: "node-1-out", to: "node-2-in" });
|
|
106
89
|
```
|
|
107
90
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
docker compose up
|
|
112
|
-
```
|
|
91
|
+
## Features:
|
|
113
92
|
|
|
114
|
-
|
|
93
|
+
- easy nodes customization using HTML
|
|
94
|
+
- wide configuration options out of the box
|
|
95
|
+
- draggable and scalable canvas
|
|
96
|
+
- draggable and resize responsive nodes
|
|
97
|
+
- exhaustive set of use cases
|
|
98
|
+
- typescript support
|
|
99
|
+
- mobile devices support
|
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,24 +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
|
|
|
46
45
|
export declare type BeforeTransformStartedFn = () => void;
|
|
47
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
|
+
|
|
48
61
|
export declare class BezierEdgeShape implements EdgeShape {
|
|
49
|
-
private readonly curvature;
|
|
50
|
-
private readonly arrowLength;
|
|
51
|
-
private readonly arrowWidth;
|
|
52
62
|
readonly svg: SVGSVGElement;
|
|
53
63
|
private readonly group;
|
|
54
64
|
private readonly line;
|
|
55
65
|
private readonly sourceArrow;
|
|
56
66
|
private readonly targetArrow;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
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;
|
|
60
78
|
}
|
|
61
79
|
|
|
62
80
|
declare interface BezierEdgeShape_2 {
|
|
@@ -104,7 +122,7 @@ export declare interface Canvas {
|
|
|
104
122
|
/**
|
|
105
123
|
* updates port and attached edges
|
|
106
124
|
*/
|
|
107
|
-
|
|
125
|
+
updatePort(portId: unknown, request?: UpdatePortRequest): Canvas;
|
|
108
126
|
/**
|
|
109
127
|
* ummarks element as port of node
|
|
110
128
|
* all the edges adjacent to port get removed
|
|
@@ -171,7 +189,7 @@ export declare class CanvasCore implements Canvas {
|
|
|
171
189
|
updateEdge(edgeId: unknown, request?: UpdateEdgeRequest): CanvasCore;
|
|
172
190
|
removeEdge(edgeId: unknown): CanvasCore;
|
|
173
191
|
markPort(port: MarkPortRequest): CanvasCore;
|
|
174
|
-
|
|
192
|
+
updatePort(portId: string, request?: UpdatePortRequest): CanvasCore;
|
|
175
193
|
unmarkPort(portId: string): CanvasCore;
|
|
176
194
|
patchViewportMatrix(request: PatchMatrixRequest): CanvasCore;
|
|
177
195
|
patchContentMatrix(request: PatchMatrixRequest): CanvasCore;
|
|
@@ -202,11 +220,6 @@ export declare interface CoreOptions {
|
|
|
202
220
|
* ports related behavior
|
|
203
221
|
*/
|
|
204
222
|
readonly ports?: {
|
|
205
|
-
/**
|
|
206
|
-
* specifies how to determine center of port
|
|
207
|
-
* center of port determines point to which edge attaches
|
|
208
|
-
*/
|
|
209
|
-
readonly centerFn?: CenterFn;
|
|
210
223
|
/**
|
|
211
224
|
* specifies default direction of port
|
|
212
225
|
*/
|
|
@@ -227,130 +240,8 @@ export declare interface CoreOptions {
|
|
|
227
240
|
};
|
|
228
241
|
}
|
|
229
242
|
|
|
230
|
-
export declare const createBezierEdgeShapeFactory: (options: {
|
|
231
|
-
readonly color: string;
|
|
232
|
-
readonly width: number;
|
|
233
|
-
readonly arrowLength: number;
|
|
234
|
-
readonly arrowWidth: number;
|
|
235
|
-
readonly curvature: number;
|
|
236
|
-
readonly hasSourceArrow: boolean;
|
|
237
|
-
readonly hasTargetArrow: boolean;
|
|
238
|
-
readonly cycleRadius: number;
|
|
239
|
-
readonly smallCycleRadius: number;
|
|
240
|
-
readonly detourDistance: number;
|
|
241
|
-
readonly detourDirection: number;
|
|
242
|
-
}) => EdgeShapeFactory;
|
|
243
|
-
|
|
244
|
-
export declare const createHorizontalEdgeShapeFactory: (options: {
|
|
245
|
-
readonly color: string;
|
|
246
|
-
readonly width: number;
|
|
247
|
-
readonly arrowLength: number;
|
|
248
|
-
readonly arrowWidth: number;
|
|
249
|
-
readonly arrowOffset: number;
|
|
250
|
-
readonly hasSourceArrow: boolean;
|
|
251
|
-
readonly hasTargetArrow: boolean;
|
|
252
|
-
readonly cycleSquareSide: number;
|
|
253
|
-
readonly roundness: number;
|
|
254
|
-
readonly detourDistance: number;
|
|
255
|
-
readonly detourDirection: number;
|
|
256
|
-
}) => EdgeShapeFactory;
|
|
257
|
-
|
|
258
|
-
export declare const createStraightEdgeShareFactory: (options: {
|
|
259
|
-
readonly color: string;
|
|
260
|
-
readonly width: number;
|
|
261
|
-
readonly arrowLength: number;
|
|
262
|
-
readonly arrowWidth: number;
|
|
263
|
-
readonly arrowOffset: number;
|
|
264
|
-
readonly hasSourceArrow: boolean;
|
|
265
|
-
readonly hasTargetArrow: boolean;
|
|
266
|
-
readonly cycleSquareSide: number;
|
|
267
|
-
readonly roundness: number;
|
|
268
|
-
readonly detourDistance: number;
|
|
269
|
-
readonly detourDirection: number;
|
|
270
|
-
}) => EdgeShapeFactory;
|
|
271
|
-
|
|
272
|
-
export declare const createVerticalEdgeShapeFactory: (options: {
|
|
273
|
-
readonly color: string;
|
|
274
|
-
readonly width: number;
|
|
275
|
-
readonly arrowLength: number;
|
|
276
|
-
readonly arrowWidth: number;
|
|
277
|
-
readonly arrowOffset: number;
|
|
278
|
-
readonly hasSourceArrow: boolean;
|
|
279
|
-
readonly hasTargetArrow: boolean;
|
|
280
|
-
readonly cycleSquareSide: number;
|
|
281
|
-
readonly roundness: number;
|
|
282
|
-
readonly detourDistance: number;
|
|
283
|
-
readonly detourDirection: number;
|
|
284
|
-
}) => EdgeShapeFactory;
|
|
285
|
-
|
|
286
|
-
declare interface CustomEdgeShape {
|
|
287
|
-
readonly type: "custom";
|
|
288
|
-
readonly factory: EdgeShapeFactory;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
243
|
declare type CustomPriority = PriorityFn;
|
|
292
244
|
|
|
293
|
-
export declare class CycleCircleEdgeShape implements EdgeShape {
|
|
294
|
-
private readonly arrowLength;
|
|
295
|
-
private readonly arrowWidth;
|
|
296
|
-
private readonly radius;
|
|
297
|
-
private readonly smallRadius;
|
|
298
|
-
readonly svg: SVGSVGElement;
|
|
299
|
-
private readonly line;
|
|
300
|
-
private readonly arrow;
|
|
301
|
-
constructor(color: string, width: number, arrowLength: number, arrowWidth: number, hasArrow: boolean, radius: number, smallRadius: number);
|
|
302
|
-
update(_to: Point, flipX: number, flipY: number, fromDir: number): void;
|
|
303
|
-
private createLinePath;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
export declare class CycleSquareEdgeShape implements EdgeShape {
|
|
307
|
-
private readonly arrowLength;
|
|
308
|
-
private readonly arrowWidth;
|
|
309
|
-
private readonly side;
|
|
310
|
-
private readonly minPortOffset;
|
|
311
|
-
readonly svg: SVGSVGElement;
|
|
312
|
-
private readonly line;
|
|
313
|
-
private readonly arrow;
|
|
314
|
-
private readonly roundness;
|
|
315
|
-
private readonly linePoints;
|
|
316
|
-
constructor(color: string, width: number, arrowLength: number, arrowWidth: number, hasArrow: boolean, side: number, minPortOffset: number, roundness: number);
|
|
317
|
-
update(_to: Point, flipX: number, flipY: number, fromDir: number): void;
|
|
318
|
-
private createLinePath;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
export declare class DetourBezierEdgeShape implements EdgeShape {
|
|
322
|
-
private readonly curvature;
|
|
323
|
-
private readonly arrowLength;
|
|
324
|
-
private readonly arrowWidth;
|
|
325
|
-
readonly svg: SVGSVGElement;
|
|
326
|
-
private readonly group;
|
|
327
|
-
private readonly line;
|
|
328
|
-
private readonly sourceArrow;
|
|
329
|
-
private readonly targetArrow;
|
|
330
|
-
private readonly detourX;
|
|
331
|
-
private readonly detourY;
|
|
332
|
-
constructor(color: string, width: number, curvature: number, arrowLength: number, arrowWidth: number, hasSourceArrow: boolean, hasTargetArrow: boolean, detourDistance: number, detourDirection: number);
|
|
333
|
-
update(to: Point, flipX: number, flipY: number, fromDir: number, toDir: number): void;
|
|
334
|
-
private createLinePath;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
export declare class DetourStraightEdgeShape implements EdgeShape {
|
|
338
|
-
private readonly arrowLength;
|
|
339
|
-
private readonly arrowWidth;
|
|
340
|
-
private readonly arrowOffset;
|
|
341
|
-
private readonly roundness;
|
|
342
|
-
readonly svg: SVGSVGElement;
|
|
343
|
-
private readonly group;
|
|
344
|
-
private readonly line;
|
|
345
|
-
private readonly sourceArrow;
|
|
346
|
-
private readonly targetArrow;
|
|
347
|
-
private readonly detourX;
|
|
348
|
-
private readonly detourY;
|
|
349
|
-
constructor(color: string, width: number, arrowLength: number, arrowWidth: number, arrowOffset: number, hasSourceArrow: boolean, hasTargetArrow: boolean, roundness: number, detourDistance: number, detourDirection: number);
|
|
350
|
-
update(to: Point, flipX: number, flipY: number, fromDir: number, toDir: number): void;
|
|
351
|
-
private createLinePath;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
245
|
export declare interface DragOptions {
|
|
355
246
|
readonly moveOnTop?: boolean;
|
|
356
247
|
readonly dragCursor?: string | null;
|
|
@@ -367,20 +258,29 @@ declare interface EdgePayload {
|
|
|
367
258
|
priority: number;
|
|
368
259
|
}
|
|
369
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
|
+
|
|
370
276
|
export declare interface EdgeShape {
|
|
371
277
|
readonly svg: SVGSVGElement;
|
|
372
|
-
|
|
278
|
+
render(params: EdgeRenderParams): void;
|
|
373
279
|
}
|
|
374
280
|
|
|
375
|
-
declare type EdgeShape_2 = BezierEdgeShape_2 | StraightEdgeShape_2 |
|
|
281
|
+
declare type EdgeShape_2 = BezierEdgeShape_2 | StraightEdgeShape_2 | HorizontalEdgeShape_2 | VerticalEdgeShape_2 | EdgeShapeFactory;
|
|
376
282
|
|
|
377
|
-
declare type EdgeShapeFactory = (
|
|
378
|
-
|
|
379
|
-
export declare enum EdgeType {
|
|
380
|
-
Regular = "regular",
|
|
381
|
-
PortCycle = "port-cycle",
|
|
382
|
-
NodeCycle = "node-cycle"
|
|
383
|
-
}
|
|
283
|
+
declare type EdgeShapeFactory = () => EdgeShape;
|
|
384
284
|
|
|
385
285
|
export declare interface GraphEdge {
|
|
386
286
|
readonly from: unknown;
|
|
@@ -398,7 +298,6 @@ export declare interface GraphNode {
|
|
|
398
298
|
|
|
399
299
|
export declare interface GraphPort {
|
|
400
300
|
readonly element: HTMLElement;
|
|
401
|
-
readonly centerFn: CenterFn;
|
|
402
301
|
readonly direction: number;
|
|
403
302
|
}
|
|
404
303
|
|
|
@@ -422,6 +321,8 @@ declare class GraphStore {
|
|
|
422
321
|
getPortNodeId(portId: unknown): unknown | undefined;
|
|
423
322
|
removePort(portId: unknown): void;
|
|
424
323
|
addEdge(request: AddEdgeRequest_2): void;
|
|
324
|
+
updateEdgeFrom(edgeId: unknown, from: unknown): void;
|
|
325
|
+
updateEdgeTo(edgeId: unknown, to: unknown): void;
|
|
425
326
|
getAllEdgeIds(): readonly unknown[];
|
|
426
327
|
getEdge(edgeId: unknown): EdgePayload | undefined;
|
|
427
328
|
removeEdge(edgeId: unknown): void;
|
|
@@ -436,19 +337,37 @@ declare class GraphStore {
|
|
|
436
337
|
getNodeAdjacentEdgeIds(nodeId: unknown): readonly unknown[];
|
|
437
338
|
}
|
|
438
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
|
+
|
|
439
354
|
export declare class HorizontalEdgeShape implements EdgeShape {
|
|
440
|
-
private readonly arrowLength;
|
|
441
|
-
private readonly arrowWidth;
|
|
442
|
-
private readonly arrowOffset;
|
|
443
|
-
private readonly roundness;
|
|
444
355
|
readonly svg: SVGSVGElement;
|
|
445
356
|
private readonly group;
|
|
446
357
|
private readonly line;
|
|
447
358
|
private readonly sourceArrow;
|
|
448
359
|
private readonly targetArrow;
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
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;
|
|
452
371
|
}
|
|
453
372
|
|
|
454
373
|
declare interface HorizontalEdgeShape_2 {
|
|
@@ -476,7 +395,7 @@ export declare class HtmlGraphBuilder {
|
|
|
476
395
|
setOptions(options: CoreOptions): HtmlGraphBuilder;
|
|
477
396
|
setUserDraggableNodes(options?: DragOptions): HtmlGraphBuilder;
|
|
478
397
|
setUserTransformableCanvas(options?: TransformOptions): HtmlGraphBuilder;
|
|
479
|
-
|
|
398
|
+
setResizeReactiveNodes(): HtmlGraphBuilder;
|
|
480
399
|
build(): Canvas;
|
|
481
400
|
}
|
|
482
401
|
|
|
@@ -489,7 +408,6 @@ declare type IncrementalPriority = "incremental";
|
|
|
489
408
|
export declare type MarkNodePortRequest = {
|
|
490
409
|
readonly id?: unknown;
|
|
491
410
|
readonly element: HTMLElement;
|
|
492
|
-
readonly centerFn?: CenterFn;
|
|
493
411
|
readonly direction?: number;
|
|
494
412
|
};
|
|
495
413
|
|
|
@@ -497,7 +415,6 @@ export declare interface MarkPortRequest {
|
|
|
497
415
|
readonly id?: unknown;
|
|
498
416
|
readonly element: HTMLElement;
|
|
499
417
|
readonly nodeId: unknown;
|
|
500
|
-
readonly centerFn?: CenterFn;
|
|
501
418
|
readonly direction?: number;
|
|
502
419
|
}
|
|
503
420
|
|
|
@@ -535,7 +452,6 @@ export declare interface Point {
|
|
|
535
452
|
|
|
536
453
|
declare interface PortPayload {
|
|
537
454
|
readonly element: HTMLElement;
|
|
538
|
-
centerFn: CenterFn;
|
|
539
455
|
direction: number;
|
|
540
456
|
}
|
|
541
457
|
|
|
@@ -585,7 +501,7 @@ export declare class ResizeReactiveNodesCanvas implements Canvas {
|
|
|
585
501
|
updateNode(nodeId: unknown, request?: UpdateNodeRequest): ResizeReactiveNodesCanvas;
|
|
586
502
|
removeNode(nodeId: unknown): ResizeReactiveNodesCanvas;
|
|
587
503
|
markPort(port: MarkPortRequest): ResizeReactiveNodesCanvas;
|
|
588
|
-
|
|
504
|
+
updatePort(portId: string, request?: UpdatePortRequest): ResizeReactiveNodesCanvas;
|
|
589
505
|
unmarkPort(portId: string): ResizeReactiveNodesCanvas;
|
|
590
506
|
addEdge(edge: AddEdgeRequest): ResizeReactiveNodesCanvas;
|
|
591
507
|
updateEdge(edgeId: unknown, request?: UpdateEdgeRequest): ResizeReactiveNodesCanvas;
|
|
@@ -611,19 +527,37 @@ export declare interface ShiftLimitPreprocessorParams {
|
|
|
611
527
|
readonly maxY: number | null;
|
|
612
528
|
}
|
|
613
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
|
+
|
|
614
544
|
export declare class StraightEdgeShape implements EdgeShape {
|
|
615
|
-
private readonly arrowLength;
|
|
616
|
-
private readonly arrowWidth;
|
|
617
|
-
private readonly arrowOffset;
|
|
618
|
-
private readonly roundness;
|
|
619
545
|
readonly svg: SVGSVGElement;
|
|
620
546
|
private readonly group;
|
|
621
547
|
private readonly line;
|
|
622
548
|
private readonly sourceArrow;
|
|
623
549
|
private readonly targetArrow;
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
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;
|
|
627
561
|
}
|
|
628
562
|
|
|
629
563
|
declare interface StraightEdgeShape_2 {
|
|
@@ -691,7 +625,9 @@ declare interface TransformState {
|
|
|
691
625
|
}
|
|
692
626
|
|
|
693
627
|
export declare interface UpdateEdgeRequest {
|
|
694
|
-
readonly
|
|
628
|
+
readonly from?: unknown;
|
|
629
|
+
readonly to?: unknown;
|
|
630
|
+
readonly shape?: EdgeShape;
|
|
695
631
|
readonly priority?: number;
|
|
696
632
|
}
|
|
697
633
|
|
|
@@ -702,9 +638,8 @@ declare interface UpdateNodeRequest {
|
|
|
702
638
|
readonly centerFn?: CenterFn;
|
|
703
639
|
}
|
|
704
640
|
|
|
705
|
-
export declare interface
|
|
641
|
+
export declare interface UpdatePortRequest {
|
|
706
642
|
readonly direction?: number;
|
|
707
|
-
readonly centerFn?: CenterFn;
|
|
708
643
|
}
|
|
709
644
|
|
|
710
645
|
export declare class UserDraggableNodesCanvas implements Canvas {
|
|
@@ -733,7 +668,7 @@ export declare class UserDraggableNodesCanvas implements Canvas {
|
|
|
733
668
|
updateNode(nodeId: unknown, request?: UpdateNodeRequest): UserDraggableNodesCanvas;
|
|
734
669
|
removeNode(nodeId: unknown): UserDraggableNodesCanvas;
|
|
735
670
|
markPort(port: MarkPortRequest): UserDraggableNodesCanvas;
|
|
736
|
-
|
|
671
|
+
updatePort(portId: string, request?: UpdatePortRequest): UserDraggableNodesCanvas;
|
|
737
672
|
unmarkPort(portId: string): UserDraggableNodesCanvas;
|
|
738
673
|
addEdge(edge: AddEdgeRequest): UserDraggableNodesCanvas;
|
|
739
674
|
updateEdge(edgeId: unknown, request?: UpdateEdgeRequest): UserDraggableNodesCanvas;
|
|
@@ -774,7 +709,7 @@ export declare class UserTransformableCanvas implements Canvas {
|
|
|
774
709
|
updateNode(nodeId: unknown, request?: UpdateNodeRequest): UserTransformableCanvas;
|
|
775
710
|
removeNode(nodeId: unknown): UserTransformableCanvas;
|
|
776
711
|
markPort(port: MarkPortRequest): UserTransformableCanvas;
|
|
777
|
-
|
|
712
|
+
updatePort(portId: string, request?: UpdatePortRequest): UserTransformableCanvas;
|
|
778
713
|
unmarkPort(portId: string): UserTransformableCanvas;
|
|
779
714
|
addEdge(edge: AddEdgeRequest): UserTransformableCanvas;
|
|
780
715
|
updateEdge(edgeId: unknown, request?: UpdateEdgeRequest): UserTransformableCanvas;
|
|
@@ -791,19 +726,37 @@ export declare class UserTransformableCanvas implements Canvas {
|
|
|
791
726
|
private removeTouchDragListeners;
|
|
792
727
|
}
|
|
793
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
|
+
|
|
794
743
|
export declare class VerticalEdgeShape implements EdgeShape {
|
|
795
|
-
private readonly arrowLength;
|
|
796
|
-
private readonly arrowWidth;
|
|
797
|
-
private readonly arrowOffset;
|
|
798
|
-
private readonly roundness;
|
|
799
744
|
readonly svg: SVGSVGElement;
|
|
800
745
|
private readonly group;
|
|
801
746
|
private readonly line;
|
|
802
747
|
private readonly sourceArrow;
|
|
803
748
|
private readonly targetArrow;
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
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;
|
|
807
760
|
}
|
|
808
761
|
|
|
809
762
|
declare interface VerticalEdgeShape_2 {
|