@html-graph/html-graph 0.1.0 → 0.1.2
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 +135 -180
- package/dist/main.js +1417 -1327
- 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,136 +240,15 @@ 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;
|
|
357
248
|
readonly events?: {
|
|
358
249
|
readonly onNodeDrag?: (payload: NodeDragPayload) => void;
|
|
359
250
|
readonly onBeforeNodeDrag?: (payload: NodeDragPayload) => boolean;
|
|
251
|
+
readonly onNodeDragFinished?: (nodeId: NodeDragPayload) => void;
|
|
360
252
|
};
|
|
361
253
|
}
|
|
362
254
|
|
|
@@ -367,20 +259,29 @@ declare interface EdgePayload {
|
|
|
367
259
|
priority: number;
|
|
368
260
|
}
|
|
369
261
|
|
|
262
|
+
export declare interface EdgeRenderParams {
|
|
263
|
+
readonly source: EdgeRenderPort;
|
|
264
|
+
readonly target: EdgeRenderPort;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export declare interface EdgeRenderPort {
|
|
268
|
+
readonly x: number;
|
|
269
|
+
readonly y: number;
|
|
270
|
+
readonly width: number;
|
|
271
|
+
readonly height: number;
|
|
272
|
+
readonly direction: number;
|
|
273
|
+
readonly portId: unknown;
|
|
274
|
+
readonly nodeId: unknown;
|
|
275
|
+
}
|
|
276
|
+
|
|
370
277
|
export declare interface EdgeShape {
|
|
371
278
|
readonly svg: SVGSVGElement;
|
|
372
|
-
|
|
279
|
+
render(params: EdgeRenderParams): void;
|
|
373
280
|
}
|
|
374
281
|
|
|
375
|
-
declare type EdgeShape_2 = BezierEdgeShape_2 | StraightEdgeShape_2 |
|
|
282
|
+
declare type EdgeShape_2 = BezierEdgeShape_2 | StraightEdgeShape_2 | HorizontalEdgeShape_2 | VerticalEdgeShape_2 | EdgeShapeFactory;
|
|
376
283
|
|
|
377
|
-
declare type EdgeShapeFactory = (
|
|
378
|
-
|
|
379
|
-
export declare enum EdgeType {
|
|
380
|
-
Regular = "regular",
|
|
381
|
-
PortCycle = "port-cycle",
|
|
382
|
-
NodeCycle = "node-cycle"
|
|
383
|
-
}
|
|
284
|
+
declare type EdgeShapeFactory = () => EdgeShape;
|
|
384
285
|
|
|
385
286
|
export declare interface GraphEdge {
|
|
386
287
|
readonly from: unknown;
|
|
@@ -398,7 +299,6 @@ export declare interface GraphNode {
|
|
|
398
299
|
|
|
399
300
|
export declare interface GraphPort {
|
|
400
301
|
readonly element: HTMLElement;
|
|
401
|
-
readonly centerFn: CenterFn;
|
|
402
302
|
readonly direction: number;
|
|
403
303
|
}
|
|
404
304
|
|
|
@@ -422,6 +322,8 @@ declare class GraphStore {
|
|
|
422
322
|
getPortNodeId(portId: unknown): unknown | undefined;
|
|
423
323
|
removePort(portId: unknown): void;
|
|
424
324
|
addEdge(request: AddEdgeRequest_2): void;
|
|
325
|
+
updateEdgeFrom(edgeId: unknown, from: unknown): void;
|
|
326
|
+
updateEdgeTo(edgeId: unknown, to: unknown): void;
|
|
425
327
|
getAllEdgeIds(): readonly unknown[];
|
|
426
328
|
getEdge(edgeId: unknown): EdgePayload | undefined;
|
|
427
329
|
removeEdge(edgeId: unknown): void;
|
|
@@ -436,19 +338,37 @@ declare class GraphStore {
|
|
|
436
338
|
getNodeAdjacentEdgeIds(nodeId: unknown): readonly unknown[];
|
|
437
339
|
}
|
|
438
340
|
|
|
341
|
+
export declare interface HorizontalEdgeParams {
|
|
342
|
+
readonly color?: string | undefined;
|
|
343
|
+
readonly width?: number | undefined;
|
|
344
|
+
readonly arrowLength?: number | undefined;
|
|
345
|
+
readonly arrowWidth?: number | undefined;
|
|
346
|
+
readonly arrowOffset?: number | undefined;
|
|
347
|
+
readonly hasSourceArrow?: boolean | undefined;
|
|
348
|
+
readonly hasTargetArrow?: boolean | undefined;
|
|
349
|
+
readonly cycleSquareSide?: number | undefined;
|
|
350
|
+
readonly roundness?: number | undefined;
|
|
351
|
+
readonly detourDistance?: number | undefined;
|
|
352
|
+
readonly detourDirection?: number | undefined;
|
|
353
|
+
}
|
|
354
|
+
|
|
439
355
|
export declare class HorizontalEdgeShape implements EdgeShape {
|
|
440
|
-
private readonly arrowLength;
|
|
441
|
-
private readonly arrowWidth;
|
|
442
|
-
private readonly arrowOffset;
|
|
443
|
-
private readonly roundness;
|
|
444
356
|
readonly svg: SVGSVGElement;
|
|
445
357
|
private readonly group;
|
|
446
358
|
private readonly line;
|
|
447
359
|
private readonly sourceArrow;
|
|
448
360
|
private readonly targetArrow;
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
private
|
|
361
|
+
private readonly arrowLength;
|
|
362
|
+
private readonly arrowWidth;
|
|
363
|
+
private readonly arrowOffset;
|
|
364
|
+
private readonly roundness;
|
|
365
|
+
private readonly cycleSquareSide;
|
|
366
|
+
private readonly detourDirection;
|
|
367
|
+
private readonly detourDistance;
|
|
368
|
+
private readonly hasSourceArrow;
|
|
369
|
+
private readonly hasTargetArrow;
|
|
370
|
+
constructor(params?: HorizontalEdgeParams);
|
|
371
|
+
render(params: EdgeRenderParams): void;
|
|
452
372
|
}
|
|
453
373
|
|
|
454
374
|
declare interface HorizontalEdgeShape_2 {
|
|
@@ -476,7 +396,7 @@ export declare class HtmlGraphBuilder {
|
|
|
476
396
|
setOptions(options: CoreOptions): HtmlGraphBuilder;
|
|
477
397
|
setUserDraggableNodes(options?: DragOptions): HtmlGraphBuilder;
|
|
478
398
|
setUserTransformableCanvas(options?: TransformOptions): HtmlGraphBuilder;
|
|
479
|
-
|
|
399
|
+
setResizeReactiveNodes(): HtmlGraphBuilder;
|
|
480
400
|
build(): Canvas;
|
|
481
401
|
}
|
|
482
402
|
|
|
@@ -489,7 +409,6 @@ declare type IncrementalPriority = "incremental";
|
|
|
489
409
|
export declare type MarkNodePortRequest = {
|
|
490
410
|
readonly id?: unknown;
|
|
491
411
|
readonly element: HTMLElement;
|
|
492
|
-
readonly centerFn?: CenterFn;
|
|
493
412
|
readonly direction?: number;
|
|
494
413
|
};
|
|
495
414
|
|
|
@@ -497,7 +416,6 @@ export declare interface MarkPortRequest {
|
|
|
497
416
|
readonly id?: unknown;
|
|
498
417
|
readonly element: HTMLElement;
|
|
499
418
|
readonly nodeId: unknown;
|
|
500
|
-
readonly centerFn?: CenterFn;
|
|
501
419
|
readonly direction?: number;
|
|
502
420
|
}
|
|
503
421
|
|
|
@@ -535,7 +453,6 @@ export declare interface Point {
|
|
|
535
453
|
|
|
536
454
|
declare interface PortPayload {
|
|
537
455
|
readonly element: HTMLElement;
|
|
538
|
-
centerFn: CenterFn;
|
|
539
456
|
direction: number;
|
|
540
457
|
}
|
|
541
458
|
|
|
@@ -585,7 +502,7 @@ export declare class ResizeReactiveNodesCanvas implements Canvas {
|
|
|
585
502
|
updateNode(nodeId: unknown, request?: UpdateNodeRequest): ResizeReactiveNodesCanvas;
|
|
586
503
|
removeNode(nodeId: unknown): ResizeReactiveNodesCanvas;
|
|
587
504
|
markPort(port: MarkPortRequest): ResizeReactiveNodesCanvas;
|
|
588
|
-
|
|
505
|
+
updatePort(portId: string, request?: UpdatePortRequest): ResizeReactiveNodesCanvas;
|
|
589
506
|
unmarkPort(portId: string): ResizeReactiveNodesCanvas;
|
|
590
507
|
addEdge(edge: AddEdgeRequest): ResizeReactiveNodesCanvas;
|
|
591
508
|
updateEdge(edgeId: unknown, request?: UpdateEdgeRequest): ResizeReactiveNodesCanvas;
|
|
@@ -611,19 +528,37 @@ export declare interface ShiftLimitPreprocessorParams {
|
|
|
611
528
|
readonly maxY: number | null;
|
|
612
529
|
}
|
|
613
530
|
|
|
531
|
+
export declare interface StraightEdgeParams {
|
|
532
|
+
readonly color?: string | undefined;
|
|
533
|
+
readonly width?: number | undefined;
|
|
534
|
+
readonly arrowLength?: number | undefined;
|
|
535
|
+
readonly arrowWidth?: number | undefined;
|
|
536
|
+
readonly arrowOffset?: number | undefined;
|
|
537
|
+
readonly hasSourceArrow?: boolean | undefined;
|
|
538
|
+
readonly hasTargetArrow?: boolean | undefined;
|
|
539
|
+
readonly cycleSquareSide?: number | undefined;
|
|
540
|
+
readonly roundness?: number | undefined;
|
|
541
|
+
readonly detourDistance?: number | undefined;
|
|
542
|
+
readonly detourDirection?: number | undefined;
|
|
543
|
+
}
|
|
544
|
+
|
|
614
545
|
export declare class StraightEdgeShape implements EdgeShape {
|
|
615
|
-
private readonly arrowLength;
|
|
616
|
-
private readonly arrowWidth;
|
|
617
|
-
private readonly arrowOffset;
|
|
618
|
-
private readonly roundness;
|
|
619
546
|
readonly svg: SVGSVGElement;
|
|
620
547
|
private readonly group;
|
|
621
548
|
private readonly line;
|
|
622
549
|
private readonly sourceArrow;
|
|
623
550
|
private readonly targetArrow;
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
private
|
|
551
|
+
private readonly arrowLength;
|
|
552
|
+
private readonly arrowWidth;
|
|
553
|
+
private readonly arrowOffset;
|
|
554
|
+
private readonly roundness;
|
|
555
|
+
private readonly cycleSquareSide;
|
|
556
|
+
private readonly detourDirection;
|
|
557
|
+
private readonly detourDistance;
|
|
558
|
+
private readonly hasSourceArrow;
|
|
559
|
+
private readonly hasTargetArrow;
|
|
560
|
+
constructor(params?: StraightEdgeParams);
|
|
561
|
+
render(params: EdgeRenderParams): void;
|
|
627
562
|
}
|
|
628
563
|
|
|
629
564
|
declare interface StraightEdgeShape_2 {
|
|
@@ -645,7 +580,7 @@ export declare type TransformFinishedFn = () => void;
|
|
|
645
580
|
|
|
646
581
|
export declare interface TransformOptions {
|
|
647
582
|
readonly scale?: {
|
|
648
|
-
readonly
|
|
583
|
+
readonly mouseWheelSensitivity?: number;
|
|
649
584
|
};
|
|
650
585
|
readonly shift?: {
|
|
651
586
|
readonly cursor?: string | null;
|
|
@@ -691,20 +626,21 @@ declare interface TransformState {
|
|
|
691
626
|
}
|
|
692
627
|
|
|
693
628
|
export declare interface UpdateEdgeRequest {
|
|
694
|
-
readonly
|
|
629
|
+
readonly from?: unknown;
|
|
630
|
+
readonly to?: unknown;
|
|
631
|
+
readonly shape?: EdgeShape;
|
|
695
632
|
readonly priority?: number;
|
|
696
633
|
}
|
|
697
634
|
|
|
698
|
-
declare interface UpdateNodeRequest {
|
|
635
|
+
export declare interface UpdateNodeRequest {
|
|
699
636
|
readonly x?: number;
|
|
700
637
|
readonly y?: number;
|
|
701
638
|
readonly priority?: number;
|
|
702
639
|
readonly centerFn?: CenterFn;
|
|
703
640
|
}
|
|
704
641
|
|
|
705
|
-
export declare interface
|
|
642
|
+
export declare interface UpdatePortRequest {
|
|
706
643
|
readonly direction?: number;
|
|
707
|
-
readonly centerFn?: CenterFn;
|
|
708
644
|
}
|
|
709
645
|
|
|
710
646
|
export declare class UserDraggableNodesCanvas implements Canvas {
|
|
@@ -716,6 +652,7 @@ export declare class UserDraggableNodesCanvas implements Canvas {
|
|
|
716
652
|
private grabbedNodeId;
|
|
717
653
|
private onNodeDrag;
|
|
718
654
|
private onBeforeNodeDrag;
|
|
655
|
+
private onNodeDragFinished;
|
|
719
656
|
private readonly nodeIdGenerator;
|
|
720
657
|
private element;
|
|
721
658
|
private readonly onWindowMouseMove;
|
|
@@ -733,7 +670,7 @@ export declare class UserDraggableNodesCanvas implements Canvas {
|
|
|
733
670
|
updateNode(nodeId: unknown, request?: UpdateNodeRequest): UserDraggableNodesCanvas;
|
|
734
671
|
removeNode(nodeId: unknown): UserDraggableNodesCanvas;
|
|
735
672
|
markPort(port: MarkPortRequest): UserDraggableNodesCanvas;
|
|
736
|
-
|
|
673
|
+
updatePort(portId: string, request?: UpdatePortRequest): UserDraggableNodesCanvas;
|
|
737
674
|
unmarkPort(portId: string): UserDraggableNodesCanvas;
|
|
738
675
|
addEdge(edge: AddEdgeRequest): UserDraggableNodesCanvas;
|
|
739
676
|
updateEdge(edgeId: unknown, request?: UpdateEdgeRequest): UserDraggableNodesCanvas;
|
|
@@ -774,7 +711,7 @@ export declare class UserTransformableCanvas implements Canvas {
|
|
|
774
711
|
updateNode(nodeId: unknown, request?: UpdateNodeRequest): UserTransformableCanvas;
|
|
775
712
|
removeNode(nodeId: unknown): UserTransformableCanvas;
|
|
776
713
|
markPort(port: MarkPortRequest): UserTransformableCanvas;
|
|
777
|
-
|
|
714
|
+
updatePort(portId: string, request?: UpdatePortRequest): UserTransformableCanvas;
|
|
778
715
|
unmarkPort(portId: string): UserTransformableCanvas;
|
|
779
716
|
addEdge(edge: AddEdgeRequest): UserTransformableCanvas;
|
|
780
717
|
updateEdge(edgeId: unknown, request?: UpdateEdgeRequest): UserTransformableCanvas;
|
|
@@ -791,19 +728,37 @@ export declare class UserTransformableCanvas implements Canvas {
|
|
|
791
728
|
private removeTouchDragListeners;
|
|
792
729
|
}
|
|
793
730
|
|
|
731
|
+
export declare interface VerticalEdgeParams {
|
|
732
|
+
readonly color?: string | undefined;
|
|
733
|
+
readonly width?: number | undefined;
|
|
734
|
+
readonly arrowLength?: number | undefined;
|
|
735
|
+
readonly arrowWidth?: number | undefined;
|
|
736
|
+
readonly arrowOffset?: number | undefined;
|
|
737
|
+
readonly hasSourceArrow?: boolean | undefined;
|
|
738
|
+
readonly hasTargetArrow?: boolean | undefined;
|
|
739
|
+
readonly cycleSquareSide?: number | undefined;
|
|
740
|
+
readonly roundness?: number | undefined;
|
|
741
|
+
readonly detourDistance?: number | undefined;
|
|
742
|
+
readonly detourDirection?: number | undefined;
|
|
743
|
+
}
|
|
744
|
+
|
|
794
745
|
export declare class VerticalEdgeShape implements EdgeShape {
|
|
795
|
-
private readonly arrowLength;
|
|
796
|
-
private readonly arrowWidth;
|
|
797
|
-
private readonly arrowOffset;
|
|
798
|
-
private readonly roundness;
|
|
799
746
|
readonly svg: SVGSVGElement;
|
|
800
747
|
private readonly group;
|
|
801
748
|
private readonly line;
|
|
802
749
|
private readonly sourceArrow;
|
|
803
750
|
private readonly targetArrow;
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
private
|
|
751
|
+
private readonly arrowLength;
|
|
752
|
+
private readonly arrowWidth;
|
|
753
|
+
private readonly arrowOffset;
|
|
754
|
+
private readonly roundness;
|
|
755
|
+
private readonly cycleSquareSide;
|
|
756
|
+
private readonly detourDirection;
|
|
757
|
+
private readonly detourDistance;
|
|
758
|
+
private readonly hasSourceArrow;
|
|
759
|
+
private readonly hasTargetArrow;
|
|
760
|
+
constructor(params?: VerticalEdgeParams);
|
|
761
|
+
render(params: EdgeRenderParams): void;
|
|
807
762
|
}
|
|
808
763
|
|
|
809
764
|
declare interface VerticalEdgeShape_2 {
|