@html-graph/html-graph 0.0.49 → 0.0.50
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 +3 -3
- package/dist/main.d.ts +18 -18
- package/dist/main.js +375 -389
- package/dist/main.umd.cjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
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
|
-
Instead of connecting nodes dirrectly this library uses concept of ports, which provide greater fexibility at managing
|
|
14
|
-
Port is an entity of the node to which
|
|
13
|
+
Instead of connecting nodes dirrectly this library uses concept of ports, which provide greater fexibility at managing edges.
|
|
14
|
+
Port is an entity of the node to which edge can be attached to.
|
|
15
15
|
|
|
16
16
|
This library fits for tasks where easy nodes customization and interactiveness are required.
|
|
17
17
|
|
|
@@ -38,7 +38,7 @@ import { MarkNodePortRequest, HtmlGraphBuilder } from "@html-graph/html-graph";
|
|
|
38
38
|
const canvas = new HtmlGraphBuilder()
|
|
39
39
|
.setOptions({
|
|
40
40
|
background: { type: "dots" },
|
|
41
|
-
|
|
41
|
+
edges: { hasTargetArrow: true },
|
|
42
42
|
})
|
|
43
43
|
.setUserDraggableNodes()
|
|
44
44
|
.setUserTransformableCanvas()
|
package/dist/main.d.ts
CHANGED
|
@@ -111,7 +111,7 @@ export declare interface Canvas {
|
|
|
111
111
|
/**
|
|
112
112
|
* updates edge
|
|
113
113
|
*/
|
|
114
|
-
|
|
114
|
+
updateEdge(edgeId: string, request: UpdateEdgeRequest): Canvas;
|
|
115
115
|
/**
|
|
116
116
|
* moves specified node on top
|
|
117
117
|
*/
|
|
@@ -145,7 +145,7 @@ export declare class CanvasCore implements Canvas {
|
|
|
145
145
|
private readonly apiOptions?;
|
|
146
146
|
readonly transformation: PublicViewportTransformer;
|
|
147
147
|
private readonly di;
|
|
148
|
-
private readonly
|
|
148
|
+
private readonly edgeControllerFactory;
|
|
149
149
|
constructor(apiOptions?: CoreOptions | undefined);
|
|
150
150
|
addNode(node: AddNodeRequest): CanvasCore;
|
|
151
151
|
moveNodeOnTop(nodeId: string): CanvasCore;
|
|
@@ -153,12 +153,12 @@ export declare class CanvasCore implements Canvas {
|
|
|
153
153
|
markPort(port: MarkPortRequest): CanvasCore;
|
|
154
154
|
updatePortEdges(portId: string): CanvasCore;
|
|
155
155
|
unmarkPort(portId: string): CanvasCore;
|
|
156
|
-
addEdge(
|
|
157
|
-
removeEdge(
|
|
156
|
+
addEdge(edge: AddEdgeRequest): CanvasCore;
|
|
157
|
+
removeEdge(edgeId: string): CanvasCore;
|
|
158
158
|
patchViewportState(request: PatchViewportRequest): CanvasCore;
|
|
159
159
|
moveToNodes(nodeIds: readonly string[]): CanvasCore;
|
|
160
160
|
updateNodeCoordinates(nodeId: string, x: number, y: number): CanvasCore;
|
|
161
|
-
|
|
161
|
+
updateEdge(edgeId: string, request: UpdateEdgeRequest): CanvasCore;
|
|
162
162
|
clear(): CanvasCore;
|
|
163
163
|
attach(element: HTMLElement): CanvasCore;
|
|
164
164
|
detach(): CanvasCore;
|
|
@@ -188,12 +188,12 @@ export declare interface CoreOptions {
|
|
|
188
188
|
readonly ports?: {
|
|
189
189
|
/**
|
|
190
190
|
* specifies how to determine center of port
|
|
191
|
-
* center of port determines point to which
|
|
191
|
+
* center of port determines point to which edge attaches
|
|
192
192
|
*/
|
|
193
193
|
readonly centerFn?: CenterFn;
|
|
194
194
|
};
|
|
195
195
|
/**
|
|
196
|
-
*
|
|
196
|
+
*edges related behavior
|
|
197
197
|
*/
|
|
198
198
|
readonly edges?: EdgeOptions;
|
|
199
199
|
/**
|
|
@@ -224,7 +224,7 @@ export declare const createStraightEdgeControllerFactory: (options: {
|
|
|
224
224
|
width: number;
|
|
225
225
|
arrowLength: number;
|
|
226
226
|
arrowWidth: number;
|
|
227
|
-
|
|
227
|
+
arrowOffset: number;
|
|
228
228
|
hasSourceArrow: boolean;
|
|
229
229
|
hasTargetArrow: boolean;
|
|
230
230
|
cycleSquareSide: number;
|
|
@@ -390,14 +390,14 @@ export declare class StraightEdgeController implements EdgeController {
|
|
|
390
390
|
private readonly width;
|
|
391
391
|
private readonly arrowLength;
|
|
392
392
|
private readonly arrowWidth;
|
|
393
|
-
private readonly
|
|
393
|
+
private readonly arrowOffset;
|
|
394
394
|
readonly svg: SVGSVGElement;
|
|
395
395
|
private readonly group;
|
|
396
396
|
private readonly line;
|
|
397
397
|
private readonly sourceArrow;
|
|
398
398
|
private readonly targetArrow;
|
|
399
399
|
private readonly roundness;
|
|
400
|
-
constructor(color: string, width: number, arrowLength: number, arrowWidth: number,
|
|
400
|
+
constructor(color: string, width: number, arrowLength: number, arrowWidth: number, arrowOffset: number, hasSourceArrow: boolean, hasTargetArrow: boolean, roundness: number);
|
|
401
401
|
update(x: number, y: number, width: number, height: number, from: PortPayload, to: PortPayload): void;
|
|
402
402
|
}
|
|
403
403
|
|
|
@@ -407,7 +407,7 @@ declare interface StraightEdgeOptions {
|
|
|
407
407
|
readonly width?: number;
|
|
408
408
|
readonly arrowLength?: number;
|
|
409
409
|
readonly arrowWidth?: number;
|
|
410
|
-
readonly
|
|
410
|
+
readonly arrowOffset?: number;
|
|
411
411
|
readonly hasSourceArrow?: boolean;
|
|
412
412
|
readonly hasTargetArrow?: boolean;
|
|
413
413
|
readonly cycleSquareSide?: number;
|
|
@@ -436,7 +436,7 @@ export declare interface TransformPayload {
|
|
|
436
436
|
readonly y: number;
|
|
437
437
|
}
|
|
438
438
|
|
|
439
|
-
declare interface
|
|
439
|
+
export declare interface UpdateEdgeRequest {
|
|
440
440
|
readonly controller?: EdgeController;
|
|
441
441
|
}
|
|
442
442
|
|
|
@@ -461,12 +461,12 @@ export declare class UserDraggableNodesCanvas implements Canvas {
|
|
|
461
461
|
markPort(port: MarkPortRequest): UserDraggableNodesCanvas;
|
|
462
462
|
updatePortEdges(portId: string): UserDraggableNodesCanvas;
|
|
463
463
|
unmarkPort(portId: string): UserDraggableNodesCanvas;
|
|
464
|
-
addEdge(
|
|
465
|
-
removeEdge(
|
|
464
|
+
addEdge(edge: AddEdgeRequest): UserDraggableNodesCanvas;
|
|
465
|
+
removeEdge(edgeId: string): UserDraggableNodesCanvas;
|
|
466
466
|
patchViewportState(request: PatchViewportRequest): UserDraggableNodesCanvas;
|
|
467
467
|
moveToNodes(nodeIds: readonly string[]): UserDraggableNodesCanvas;
|
|
468
468
|
updateNodeCoordinates(nodeId: string, x: number, y: number): UserDraggableNodesCanvas;
|
|
469
|
-
|
|
469
|
+
updateEdge(edgeId: string, request: UpdateEdgeRequest): UserDraggableNodesCanvas;
|
|
470
470
|
moveNodeOnTop(nodeId: string): UserDraggableNodesCanvas;
|
|
471
471
|
clear(): UserDraggableNodesCanvas;
|
|
472
472
|
attach(element: HTMLElement): UserDraggableNodesCanvas;
|
|
@@ -503,12 +503,12 @@ export declare class UserTransformableCanvas implements Canvas {
|
|
|
503
503
|
markPort(port: MarkPortRequest): UserTransformableCanvas;
|
|
504
504
|
updatePortEdges(portId: string): UserTransformableCanvas;
|
|
505
505
|
unmarkPort(portId: string): UserTransformableCanvas;
|
|
506
|
-
addEdge(
|
|
507
|
-
removeEdge(
|
|
506
|
+
addEdge(edge: AddEdgeRequest): UserTransformableCanvas;
|
|
507
|
+
removeEdge(edgeId: string): UserTransformableCanvas;
|
|
508
508
|
patchViewportState(request: PatchViewportRequest): UserTransformableCanvas;
|
|
509
509
|
moveToNodes(nodeIds: readonly string[]): UserTransformableCanvas;
|
|
510
510
|
updateNodeCoordinates(nodeId: string, x: number, y: number): UserTransformableCanvas;
|
|
511
|
-
|
|
511
|
+
updateEdge(edgeId: string, request: UpdateEdgeRequest): UserTransformableCanvas;
|
|
512
512
|
moveNodeOnTop(nodeId: string): UserTransformableCanvas;
|
|
513
513
|
clear(): UserTransformableCanvas;
|
|
514
514
|
attach(element: HTMLElement): UserTransformableCanvas;
|