@html-graph/html-graph 0.0.55 → 0.0.57
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 +40 -34
- package/dist/main.d.ts +84 -84
- package/dist/main.js +905 -834
- package/dist/main.umd.cjs +1 -1
- package/package.json +12 -4
package/README.md
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
9
|
-
<a target="_blank" href="https://html-graph.github.io/">
|
|
9
|
+
<a target="_blank" href="https://html-graph.github.io/use-cases/20-advanced-demo/index.html">
|
|
10
10
|
<img width="100%" src="https://raw.githubusercontent.com/html-graph/html-graph/master/media/full-demo.gif"/>
|
|
11
11
|
</a>
|
|
12
12
|
|
|
13
|
-
Visit <a target="_blank" href="https://html-graph.github.io">
|
|
13
|
+
Visit <a target="_blank" href="https://html-graph.github.io">use cases</a> and [use cases implementation](use-cases).
|
|
14
14
|
|
|
15
15
|
Instead of connecting nodes directly this library uses concept of ports, which provide greater fexibility at managing edges.
|
|
16
16
|
Port is an entity of a node to which edge can be attached to.
|
|
@@ -20,7 +20,7 @@ Port is an entity of a node to which edge can be attached to.
|
|
|
20
20
|
- easy nodes customization using HTML
|
|
21
21
|
- wide configuration options out of the box
|
|
22
22
|
- draggable and scalable canvas with draggable nodes
|
|
23
|
-
- exhaustive set of
|
|
23
|
+
- exhaustive set of use cases
|
|
24
24
|
- typescript support
|
|
25
25
|
- mobile devices support
|
|
26
26
|
|
|
@@ -30,8 +30,8 @@ Port is an entity of a node to which edge can be attached to.
|
|
|
30
30
|
npm i @html-graph/html-graph
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
```
|
|
34
|
-
import {
|
|
33
|
+
```javascript
|
|
34
|
+
import { HtmlGraphBuilder } from "@html-graph/html-graph";
|
|
35
35
|
|
|
36
36
|
const canvas = new HtmlGraphBuilder()
|
|
37
37
|
.setOptions({
|
|
@@ -48,52 +48,58 @@ const canvas = new HtmlGraphBuilder()
|
|
|
48
48
|
.setUserTransformableCanvas()
|
|
49
49
|
.build();
|
|
50
50
|
|
|
51
|
-
function createNode(
|
|
52
|
-
name: string,
|
|
53
|
-
frontPortId: string,
|
|
54
|
-
backPortId: string,
|
|
55
|
-
): [HTMLElement, AddNodePorts] {
|
|
51
|
+
function createNode({ name, x, y, frontPortId, backPortId }) {
|
|
56
52
|
const node = document.createElement("div");
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
const text = document.createElement("div");
|
|
59
54
|
const frontPort = document.createElement("div");
|
|
60
|
-
|
|
61
|
-
node.appendChild(frontPort);
|
|
55
|
+
const backPort = document.createElement("div");
|
|
62
56
|
|
|
63
|
-
|
|
57
|
+
node.classList.add("node");
|
|
58
|
+
frontPort.classList.add("port");
|
|
59
|
+
backPort.classList.add("port");
|
|
64
60
|
text.innerText = name;
|
|
65
|
-
node.appendChild(text);
|
|
66
61
|
|
|
67
|
-
const backPort = document.createElement("div");
|
|
68
|
-
backPort.classList.add("port");
|
|
69
62
|
node.appendChild(backPort);
|
|
63
|
+
node.appendChild(text);
|
|
64
|
+
node.appendChild(frontPort);
|
|
70
65
|
|
|
71
|
-
return
|
|
72
|
-
node,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
return {
|
|
67
|
+
element: node,
|
|
68
|
+
x: x,
|
|
69
|
+
y: y,
|
|
70
|
+
ports: [
|
|
71
|
+
{ id: frontPortId, element: frontPort },
|
|
72
|
+
{ id: backPortId, element: backPort },
|
|
76
73
|
],
|
|
77
|
-
|
|
74
|
+
};
|
|
78
75
|
}
|
|
79
76
|
|
|
80
|
-
const
|
|
81
|
-
|
|
77
|
+
const node1 = createNode({
|
|
78
|
+
name: "Node 1",
|
|
79
|
+
x: 200,
|
|
80
|
+
y: 400,
|
|
81
|
+
frontPortId: "port-1-1",
|
|
82
|
+
backPortId: "port-1-2",
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const node2 = createNode({
|
|
86
|
+
name: "Node 2",
|
|
87
|
+
x: 600,
|
|
88
|
+
y: 500,
|
|
89
|
+
frontPortId: "port-2-1",
|
|
90
|
+
backPortId: "port-2-2",
|
|
91
|
+
});
|
|
82
92
|
|
|
83
|
-
const canvasElement = document.getElementById("canvas")
|
|
93
|
+
const canvasElement = document.getElementById("canvas");
|
|
84
94
|
|
|
85
95
|
canvas
|
|
86
96
|
.attach(canvasElement)
|
|
87
|
-
.addNode(
|
|
88
|
-
.addNode(
|
|
97
|
+
.addNode(node1)
|
|
98
|
+
.addNode(node2)
|
|
89
99
|
.addEdge({ from: "port-1-2", to: "port-2-1" });
|
|
90
100
|
```
|
|
91
101
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
## Run examples
|
|
95
|
-
|
|
96
|
-
Use node version >= 20
|
|
102
|
+
## Run use cases
|
|
97
103
|
|
|
98
104
|
```
|
|
99
105
|
npm install
|
package/dist/main.d.ts
CHANGED
|
@@ -1,21 +1,28 @@
|
|
|
1
|
+
declare interface AbstractViewportTransformer {
|
|
2
|
+
getViewportMatrix(): TransformState;
|
|
3
|
+
getContentMatrix(): TransformState;
|
|
4
|
+
patchViewportMatrix(scale: number | null, x: number | null, y: number | null): void;
|
|
5
|
+
patchContentMatrix(scale: number | null, dx: number | null, dy: number | null): void;
|
|
6
|
+
}
|
|
7
|
+
|
|
1
8
|
export declare interface AddEdgeRequest {
|
|
2
|
-
id?: unknown;
|
|
3
|
-
from: string;
|
|
4
|
-
to: string;
|
|
5
|
-
|
|
6
|
-
priority?: number;
|
|
9
|
+
readonly id?: unknown;
|
|
10
|
+
readonly from: string;
|
|
11
|
+
readonly to: string;
|
|
12
|
+
readonly shape?: EdgeShape_2;
|
|
13
|
+
readonly priority?: number;
|
|
7
14
|
}
|
|
8
15
|
|
|
9
|
-
export declare type AddNodePorts = Iterable<
|
|
16
|
+
export declare type AddNodePorts = Iterable<MarkNodePortRequest>;
|
|
10
17
|
|
|
11
18
|
export declare interface AddNodeRequest {
|
|
12
|
-
id?: unknown;
|
|
13
|
-
element: HTMLElement;
|
|
14
|
-
x: number;
|
|
15
|
-
y: number;
|
|
16
|
-
ports?: AddNodePorts;
|
|
17
|
-
centerFn?: CenterFn;
|
|
18
|
-
priority?: number;
|
|
19
|
+
readonly id?: unknown;
|
|
20
|
+
readonly element: HTMLElement;
|
|
21
|
+
readonly x: number;
|
|
22
|
+
readonly y: number;
|
|
23
|
+
readonly ports?: AddNodePorts;
|
|
24
|
+
readonly centerFn?: CenterFn;
|
|
25
|
+
readonly priority?: number;
|
|
19
26
|
}
|
|
20
27
|
|
|
21
28
|
export declare type BackgroundDrawingFn = (ctx: CanvasRenderingContext2D, transformer: PublicViewportTransformer) => void;
|
|
@@ -28,14 +35,13 @@ declare type BackgroundOptions = {
|
|
|
28
35
|
readonly dotGap?: number;
|
|
29
36
|
readonly dotRadius?: number;
|
|
30
37
|
readonly color?: string;
|
|
38
|
+
readonly limit?: number;
|
|
31
39
|
} | {
|
|
32
40
|
readonly type: "custom";
|
|
33
41
|
readonly drawingFn: BackgroundDrawingFn;
|
|
34
42
|
};
|
|
35
43
|
|
|
36
44
|
export declare class BezierEdgeShape implements EdgeShape {
|
|
37
|
-
private readonly color;
|
|
38
|
-
private readonly width;
|
|
39
45
|
private readonly curvature;
|
|
40
46
|
private readonly arrowLength;
|
|
41
47
|
private readonly arrowWidth;
|
|
@@ -45,7 +51,7 @@ export declare class BezierEdgeShape implements EdgeShape {
|
|
|
45
51
|
private readonly sourceArrow;
|
|
46
52
|
private readonly targetArrow;
|
|
47
53
|
constructor(color: string, width: number, curvature: number, arrowLength: number, arrowWidth: number, hasSourceArrow: boolean, hasTargetArrow: boolean);
|
|
48
|
-
update(x: number, y: number, width: number, height: number, from:
|
|
54
|
+
update(x: number, y: number, width: number, height: number, from: GraphPort, to: GraphPort): void;
|
|
49
55
|
}
|
|
50
56
|
|
|
51
57
|
declare interface BezierEdgeShape_2 {
|
|
@@ -278,14 +284,12 @@ export declare const createVerticalEdgeShapeFactory: (options: {
|
|
|
278
284
|
|
|
279
285
|
declare interface CustomEdgeShape {
|
|
280
286
|
readonly type: "custom";
|
|
281
|
-
readonly
|
|
287
|
+
readonly factory: EdgeShapeFactory;
|
|
282
288
|
}
|
|
283
289
|
|
|
284
290
|
declare type CustomPriority = PriorityFn;
|
|
285
291
|
|
|
286
292
|
export declare class CycleCircleEdgeShape implements EdgeShape {
|
|
287
|
-
private readonly color;
|
|
288
|
-
private readonly width;
|
|
289
293
|
private readonly arrowLength;
|
|
290
294
|
private readonly arrowWidth;
|
|
291
295
|
private readonly radius;
|
|
@@ -295,12 +299,10 @@ export declare class CycleCircleEdgeShape implements EdgeShape {
|
|
|
295
299
|
private readonly line;
|
|
296
300
|
private readonly arrow;
|
|
297
301
|
constructor(color: string, width: number, arrowLength: number, arrowWidth: number, hasArrow: boolean, radius: number, smallRadius: number);
|
|
298
|
-
update(x: number, y: number, _width: number, _height: number, from:
|
|
302
|
+
update(x: number, y: number, _width: number, _height: number, from: GraphPort): void;
|
|
299
303
|
}
|
|
300
304
|
|
|
301
305
|
export declare class CycleSquareEdgeShape implements EdgeShape {
|
|
302
|
-
private readonly color;
|
|
303
|
-
private readonly width;
|
|
304
306
|
private readonly arrowLength;
|
|
305
307
|
private readonly arrowWidth;
|
|
306
308
|
private readonly side;
|
|
@@ -312,12 +314,10 @@ export declare class CycleSquareEdgeShape implements EdgeShape {
|
|
|
312
314
|
private readonly roundness;
|
|
313
315
|
private readonly linePoints;
|
|
314
316
|
constructor(color: string, width: number, arrowLength: number, arrowWidth: number, hasArrow: boolean, side: number, minPortOffset: number, roundness: number);
|
|
315
|
-
update(x: number, y: number, _width: number, _height: number, from:
|
|
317
|
+
update(x: number, y: number, _width: number, _height: number, from: GraphPort): void;
|
|
316
318
|
}
|
|
317
319
|
|
|
318
320
|
export declare class DetourStraightEdgeShape implements EdgeShape {
|
|
319
|
-
private readonly color;
|
|
320
|
-
private readonly width;
|
|
321
321
|
private readonly arrowLength;
|
|
322
322
|
private readonly arrowWidth;
|
|
323
323
|
private readonly arrowOffset;
|
|
@@ -330,11 +330,12 @@ export declare class DetourStraightEdgeShape implements EdgeShape {
|
|
|
330
330
|
private readonly detourX;
|
|
331
331
|
private readonly detourY;
|
|
332
332
|
constructor(color: string, width: number, arrowLength: number, arrowWidth: number, arrowOffset: number, hasSourceArrow: boolean, hasTargetArrow: boolean, roundness: number, detourDistance: number, detourDirection: number);
|
|
333
|
-
update(x: number, y: number, width: number, height: number, from:
|
|
333
|
+
update(x: number, y: number, width: number, height: number, from: GraphPort, to: GraphPort): void;
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
export declare interface DragOptions {
|
|
337
337
|
grabPriorityStrategy?: "freeze" | "move-on-top";
|
|
338
|
+
dragCursor?: string | null;
|
|
338
339
|
events?: {
|
|
339
340
|
onNodeDrag?: (payload: NodeDragPayload) => void;
|
|
340
341
|
onBeforeNodeDrag?: (payload: NodeDragPayload) => boolean;
|
|
@@ -342,15 +343,15 @@ export declare interface DragOptions {
|
|
|
342
343
|
}
|
|
343
344
|
|
|
344
345
|
declare interface EdgePayload {
|
|
345
|
-
from:
|
|
346
|
-
to:
|
|
346
|
+
readonly from: unknown;
|
|
347
|
+
readonly to: unknown;
|
|
347
348
|
shape: EdgeShape;
|
|
348
349
|
priority: number;
|
|
349
350
|
}
|
|
350
351
|
|
|
351
352
|
export declare interface EdgeShape {
|
|
352
353
|
readonly svg: SVGSVGElement;
|
|
353
|
-
update(x: number, y: number, width: number, height: number, from:
|
|
354
|
+
update(x: number, y: number, width: number, height: number, from: GraphPort, to: GraphPort): void;
|
|
354
355
|
}
|
|
355
356
|
|
|
356
357
|
declare type EdgeShape_2 = BezierEdgeShape_2 | StraightEdgeShape_2 | CustomEdgeShape | HorizontalEdgeShape_2 | VerticalEdgeShape_2;
|
|
@@ -393,33 +394,31 @@ declare class GraphStore {
|
|
|
393
394
|
private readonly outcommingEdges;
|
|
394
395
|
private readonly cycleEdges;
|
|
395
396
|
addNode(nodeId: unknown, element: HTMLElement, x: number, y: number, centerFn: CenterFn, priority: number): void;
|
|
396
|
-
|
|
397
|
+
getAllNodeIds(): readonly unknown[];
|
|
397
398
|
getNode(nodeId: unknown): NodePayload | undefined;
|
|
398
|
-
getNodePorts(nodeId: unknown): readonly unknown[] | undefined;
|
|
399
399
|
removeNode(nodeId: unknown): void;
|
|
400
400
|
addPort(portId: unknown, element: HTMLElement, nodeId: unknown, centerFn: CenterFn, dir: number): void;
|
|
401
|
-
getAllPorts(): readonly unknown[];
|
|
402
401
|
getPort(portId: unknown): PortPayload | undefined;
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
402
|
+
getAllPortIds(): readonly unknown[];
|
|
403
|
+
getNodePortIds(nodeId: unknown): readonly unknown[] | undefined;
|
|
404
|
+
getPortNodeId(portId: unknown): unknown | undefined;
|
|
405
|
+
removePort(portId: unknown): void;
|
|
406
|
+
addEdge(edgeId: unknown, fromPortId: unknown, toPortId: unknown, shape: EdgeShape, priority: number): void;
|
|
407
|
+
getAllEdgeIds(): readonly unknown[];
|
|
407
408
|
getEdge(edgeId: unknown): EdgePayload | undefined;
|
|
408
409
|
removeEdge(edgeId: unknown): void;
|
|
409
|
-
getPortAdjacentEdges(portId: string): readonly unknown[];
|
|
410
|
-
getNodeAdjacentEdges(nodeId: unknown): readonly unknown[];
|
|
411
410
|
clear(): void;
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
411
|
+
getPortIncomingEdgeIds(portId: unknown): readonly unknown[];
|
|
412
|
+
getPortOutcomingEdgeIds(portId: unknown): readonly unknown[];
|
|
413
|
+
getPortCycleEdgeIds(portId: unknown): readonly unknown[];
|
|
414
|
+
getPortAdjacentEdgeIds(portId: unknown): readonly unknown[];
|
|
415
|
+
getNodeIncomingEdgeIds(nodeId: unknown): readonly unknown[];
|
|
416
|
+
getNodeOutcomingEdgeIds(nodeId: unknown): readonly unknown[];
|
|
417
|
+
getNodeCycleEdgeIds(nodeId: unknown): readonly unknown[];
|
|
418
|
+
getNodeAdjacentEdgeIds(nodeId: unknown): readonly unknown[];
|
|
418
419
|
}
|
|
419
420
|
|
|
420
421
|
export declare class HorizontalEdgeShape implements EdgeShape {
|
|
421
|
-
private readonly color;
|
|
422
|
-
private readonly width;
|
|
423
422
|
private readonly arrowLength;
|
|
424
423
|
private readonly arrowWidth;
|
|
425
424
|
private readonly arrowOffset;
|
|
@@ -430,7 +429,7 @@ export declare class HorizontalEdgeShape implements EdgeShape {
|
|
|
430
429
|
private readonly sourceArrow;
|
|
431
430
|
private readonly targetArrow;
|
|
432
431
|
constructor(color: string, width: number, arrowLength: number, arrowWidth: number, arrowOffset: number, hasSourceArrow: boolean, hasTargetArrow: boolean, roundness: number);
|
|
433
|
-
update(x: number, y: number, width: number, height: number, from:
|
|
432
|
+
update(x: number, y: number, width: number, height: number, from: GraphPort, to: GraphPort): void;
|
|
434
433
|
}
|
|
435
434
|
|
|
436
435
|
declare interface HorizontalEdgeShape_2 {
|
|
@@ -460,9 +459,14 @@ export declare class HtmlGraphBuilder {
|
|
|
460
459
|
build(): Canvas;
|
|
461
460
|
}
|
|
462
461
|
|
|
462
|
+
export declare class HtmlGraphError extends Error {
|
|
463
|
+
readonly name = "HtmlGraphError";
|
|
464
|
+
}
|
|
465
|
+
|
|
463
466
|
declare type IncrementalPriority = "incremental";
|
|
464
467
|
|
|
465
|
-
export declare type MarkNodePortRequest =
|
|
468
|
+
export declare type MarkNodePortRequest = {
|
|
469
|
+
readonly id?: unknown;
|
|
466
470
|
readonly element: HTMLElement;
|
|
467
471
|
readonly centerFn?: CenterFn;
|
|
468
472
|
readonly direction?: number;
|
|
@@ -502,7 +506,7 @@ export declare interface Point {
|
|
|
502
506
|
readonly y: number;
|
|
503
507
|
}
|
|
504
508
|
|
|
505
|
-
|
|
509
|
+
declare interface PortPayload {
|
|
506
510
|
readonly element: HTMLElement;
|
|
507
511
|
centerFn: CenterFn;
|
|
508
512
|
direction: number;
|
|
@@ -515,27 +519,27 @@ export declare type PriorityFn = () => number;
|
|
|
515
519
|
declare class PublicGraphStore {
|
|
516
520
|
private readonly graphStore;
|
|
517
521
|
constructor(graphStore: GraphStore);
|
|
518
|
-
|
|
519
|
-
|
|
522
|
+
getAllNodeIds(): readonly unknown[];
|
|
523
|
+
getAllPortIds(): readonly unknown[];
|
|
520
524
|
getNode(nodeId: unknown): GraphNode | null;
|
|
521
|
-
|
|
525
|
+
getNodePortIds(nodeId: unknown): readonly unknown[] | undefined;
|
|
522
526
|
getPort(portId: unknown): GraphPort | null;
|
|
523
|
-
|
|
524
|
-
|
|
527
|
+
getPortNodeId(portId: string): unknown | null;
|
|
528
|
+
getAllEdgeIds(): readonly unknown[];
|
|
525
529
|
getEdge(edgeId: unknown): GraphEdge | null;
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
530
|
+
getPortAdjacentEdgeIds(portId: string): readonly unknown[];
|
|
531
|
+
getNodeAdjacentEdgeIds(nodeId: unknown): readonly unknown[];
|
|
532
|
+
getPortIncomingEdgeIds(portId: unknown): readonly unknown[];
|
|
533
|
+
getPortOutcomingEdgeIds(portId: unknown): readonly unknown[];
|
|
534
|
+
getPortCycleEdgeIds(portId: unknown): readonly unknown[];
|
|
535
|
+
getNodeIncomingEdgeIds(nodeId: unknown): readonly unknown[];
|
|
536
|
+
getNodeOutcomingEdgeIds(nodeId: unknown): readonly unknown[];
|
|
537
|
+
getNodeCycleEdgeIds(nodeId: unknown): readonly unknown[];
|
|
534
538
|
}
|
|
535
539
|
|
|
536
540
|
export declare class PublicViewportTransformer {
|
|
537
541
|
private readonly transformer;
|
|
538
|
-
constructor(transformer:
|
|
542
|
+
constructor(transformer: AbstractViewportTransformer);
|
|
539
543
|
getViewportMatrix(): TransformState;
|
|
540
544
|
getContentMatrix(): TransformState;
|
|
541
545
|
}
|
|
@@ -543,8 +547,6 @@ export declare class PublicViewportTransformer {
|
|
|
543
547
|
declare type SharedIncrementalPriority = "shared-incremental";
|
|
544
548
|
|
|
545
549
|
export declare class StraightEdgeShape implements EdgeShape {
|
|
546
|
-
private readonly color;
|
|
547
|
-
private readonly width;
|
|
548
550
|
private readonly arrowLength;
|
|
549
551
|
private readonly arrowWidth;
|
|
550
552
|
private readonly arrowOffset;
|
|
@@ -555,7 +557,7 @@ export declare class StraightEdgeShape implements EdgeShape {
|
|
|
555
557
|
private readonly sourceArrow;
|
|
556
558
|
private readonly targetArrow;
|
|
557
559
|
constructor(color: string, width: number, arrowLength: number, arrowWidth: number, arrowOffset: number, hasSourceArrow: boolean, hasTargetArrow: boolean, roundness: number);
|
|
558
|
-
update(x: number, y: number, width: number, height: number, from:
|
|
560
|
+
update(x: number, y: number, width: number, height: number, from: GraphPort, to: GraphPort): void;
|
|
559
561
|
}
|
|
560
562
|
|
|
561
563
|
declare interface StraightEdgeShape_2 {
|
|
@@ -582,6 +584,7 @@ export declare interface TransformOptions {
|
|
|
582
584
|
};
|
|
583
585
|
readonly shift?: {
|
|
584
586
|
readonly enabled?: boolean;
|
|
587
|
+
readonly cursor?: string | null;
|
|
585
588
|
};
|
|
586
589
|
readonly transformPreprocessor?: TransformPreprocessorOption | TransformPreprocessorOption[];
|
|
587
590
|
readonly events?: {
|
|
@@ -619,7 +622,7 @@ declare interface TransformState {
|
|
|
619
622
|
}
|
|
620
623
|
|
|
621
624
|
export declare interface UpdateEdgeRequest {
|
|
622
|
-
readonly
|
|
625
|
+
readonly shape?: EdgeShape_2;
|
|
623
626
|
readonly priority?: number;
|
|
624
627
|
}
|
|
625
628
|
|
|
@@ -652,7 +655,9 @@ export declare class UserDraggableNodesCanvas implements Canvas {
|
|
|
652
655
|
private readonly onCanvasTouchMove;
|
|
653
656
|
private readonly onCanvasTouchEnd;
|
|
654
657
|
private previousTouchCoords;
|
|
655
|
-
private freezePriority;
|
|
658
|
+
private readonly freezePriority;
|
|
659
|
+
private readonly window;
|
|
660
|
+
private readonly dragCursor;
|
|
656
661
|
constructor(canvas: Canvas, dragOptions?: DragOptions);
|
|
657
662
|
addNode(request: AddNodeRequest): UserDraggableNodesCanvas;
|
|
658
663
|
updateNode(nodeId: unknown, request: UpdateNodeRequest): UserDraggableNodesCanvas;
|
|
@@ -669,10 +674,13 @@ export declare class UserDraggableNodesCanvas implements Canvas {
|
|
|
669
674
|
attach(element: HTMLElement): UserDraggableNodesCanvas;
|
|
670
675
|
detach(): UserDraggableNodesCanvas;
|
|
671
676
|
destroy(): void;
|
|
672
|
-
private setCursor;
|
|
673
677
|
private dragNode;
|
|
674
678
|
private updateMaxNodePriority;
|
|
675
679
|
private moveNodeOnTop;
|
|
680
|
+
private cancelMouseDrag;
|
|
681
|
+
private removeMouseDragListeners;
|
|
682
|
+
private cancelTouchDrag;
|
|
683
|
+
private removeTouchDragListeners;
|
|
676
684
|
}
|
|
677
685
|
|
|
678
686
|
export declare class UserTransformableCanvas implements Canvas {
|
|
@@ -681,13 +689,13 @@ export declare class UserTransformableCanvas implements Canvas {
|
|
|
681
689
|
readonly model: PublicGraphStore;
|
|
682
690
|
readonly transformation: PublicViewportTransformer;
|
|
683
691
|
private element;
|
|
684
|
-
private isMoving;
|
|
685
692
|
private prevTouches;
|
|
686
693
|
private readonly onTransformFinished;
|
|
687
694
|
private readonly transformPreprocessor;
|
|
688
695
|
private readonly isScalable;
|
|
689
696
|
private readonly isShiftable;
|
|
690
697
|
private readonly wheelSensitivity;
|
|
698
|
+
private window;
|
|
691
699
|
private readonly onMouseDown;
|
|
692
700
|
private readonly onMouseMove;
|
|
693
701
|
private readonly onMouseUp;
|
|
@@ -696,6 +704,7 @@ export declare class UserTransformableCanvas implements Canvas {
|
|
|
696
704
|
private readonly onTouchMove;
|
|
697
705
|
private readonly onTouchEnd;
|
|
698
706
|
private readonly observer;
|
|
707
|
+
private readonly shiftCursor;
|
|
699
708
|
constructor(canvas: Canvas, options?: TransformOptions | undefined);
|
|
700
709
|
addNode(node: AddNodeRequest): UserTransformableCanvas;
|
|
701
710
|
updateNode(nodeId: unknown, request: UpdateNodeRequest): UserTransformableCanvas;
|
|
@@ -713,14 +722,15 @@ export declare class UserTransformableCanvas implements Canvas {
|
|
|
713
722
|
detach(): UserTransformableCanvas;
|
|
714
723
|
destroy(): void;
|
|
715
724
|
private getAverageTouch;
|
|
716
|
-
private setCursor;
|
|
717
725
|
private moveViewport;
|
|
718
726
|
private scaleViewport;
|
|
727
|
+
private stopMouseDrag;
|
|
728
|
+
private removeMouseDragListeners;
|
|
729
|
+
private stopTouchDrag;
|
|
730
|
+
private removeTouchDragListeners;
|
|
719
731
|
}
|
|
720
732
|
|
|
721
733
|
export declare class VerticalEdgeShape implements EdgeShape {
|
|
722
|
-
private readonly color;
|
|
723
|
-
private readonly width;
|
|
724
734
|
private readonly arrowLength;
|
|
725
735
|
private readonly arrowWidth;
|
|
726
736
|
private readonly arrowOffset;
|
|
@@ -731,7 +741,7 @@ export declare class VerticalEdgeShape implements EdgeShape {
|
|
|
731
741
|
private readonly sourceArrow;
|
|
732
742
|
private readonly targetArrow;
|
|
733
743
|
constructor(color: string, width: number, arrowLength: number, arrowWidth: number, arrowOffset: number, hasSourceArrow: boolean, hasTargetArrow: boolean, roundness: number);
|
|
734
|
-
update(x: number, y: number, width: number, height: number, from:
|
|
744
|
+
update(x: number, y: number, width: number, height: number, from: GraphPort, to: GraphPort): void;
|
|
735
745
|
}
|
|
736
746
|
|
|
737
747
|
declare interface VerticalEdgeShape_2 {
|
|
@@ -749,14 +759,4 @@ declare interface VerticalEdgeShape_2 {
|
|
|
749
759
|
readonly detourDirection?: number;
|
|
750
760
|
}
|
|
751
761
|
|
|
752
|
-
declare class ViewportTransformer {
|
|
753
|
-
private viewportMatrix;
|
|
754
|
-
private contentMatrix;
|
|
755
|
-
getViewportMatrix(): TransformState;
|
|
756
|
-
getContentMatrix(): TransformState;
|
|
757
|
-
patchViewportMatrix(scale: number | null, x: number | null, y: number | null): void;
|
|
758
|
-
patchContentMatrix(scale: number | null, dx: number | null, dy: number | null): void;
|
|
759
|
-
private calculateReverseMatrix;
|
|
760
|
-
}
|
|
761
|
-
|
|
762
762
|
export { }
|