@html-graph/html-graph 1.1.1 → 1.2.0
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/dist/main.d.ts +41 -4
- package/dist/main.js +505 -391
- package/dist/main.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare interface AddEdgeRequest {
|
|
2
2
|
readonly id?: unknown | undefined;
|
|
3
|
-
readonly from:
|
|
4
|
-
readonly to:
|
|
3
|
+
readonly from: unknown;
|
|
4
|
+
readonly to: unknown;
|
|
5
5
|
readonly shape?: EdgeShape | undefined;
|
|
6
6
|
readonly priority?: number | undefined;
|
|
7
7
|
}
|
|
@@ -190,15 +190,35 @@ declare class CanvasBuilder {
|
|
|
190
190
|
private hasDraggableNode;
|
|
191
191
|
private hasTransformableViewport;
|
|
192
192
|
private hasResizeReactiveNodes;
|
|
193
|
+
private boxRenderingTrigger;
|
|
194
|
+
/**
|
|
195
|
+
* specifies options for fundamental aspects of visualization
|
|
196
|
+
*/
|
|
193
197
|
setOptions(options: CoreOptions): CanvasBuilder;
|
|
198
|
+
/**
|
|
199
|
+
* enables nodes draggable bu user
|
|
200
|
+
*/
|
|
194
201
|
setUserDraggableNodes(options?: DragOptions): CanvasBuilder;
|
|
195
202
|
/**
|
|
196
203
|
* @deprecated
|
|
197
204
|
* use setUserTransformableViewport instead
|
|
198
205
|
*/
|
|
199
206
|
setUserTransformableCanvas(options?: TransformOptions): CanvasBuilder;
|
|
207
|
+
/**
|
|
208
|
+
* enables viewport transformable by user
|
|
209
|
+
*/
|
|
200
210
|
setUserTransformableViewport(options?: TransformOptions): CanvasBuilder;
|
|
211
|
+
/**
|
|
212
|
+
* enables automatic edges update on node resize
|
|
213
|
+
*/
|
|
201
214
|
setResizeReactiveNodes(): CanvasBuilder;
|
|
215
|
+
/**
|
|
216
|
+
* sets emitter for rendering graph inside bounded area
|
|
217
|
+
*/
|
|
218
|
+
setBoxRenderingTrigger(trigger: EventSubject<RenderingBox>): CanvasBuilder;
|
|
219
|
+
/**
|
|
220
|
+
* builds final canvas
|
|
221
|
+
*/
|
|
202
222
|
build(): Canvas;
|
|
203
223
|
}
|
|
204
224
|
export { CanvasBuilder }
|
|
@@ -213,7 +233,7 @@ export declare class CanvasCore implements Canvas {
|
|
|
213
233
|
private readonly internalTransformation;
|
|
214
234
|
private readonly internalModel;
|
|
215
235
|
private readonly graphStoreController;
|
|
216
|
-
private readonly
|
|
236
|
+
private readonly htmlView;
|
|
217
237
|
private readonly onAfterNodeAdded;
|
|
218
238
|
private readonly onAfterEdgeAdded;
|
|
219
239
|
private readonly onAfterEdgeShapeUpdated;
|
|
@@ -224,7 +244,6 @@ export declare class CanvasCore implements Canvas {
|
|
|
224
244
|
private readonly onAfterNodeUpdated;
|
|
225
245
|
private readonly onBeforeEdgeRemoved;
|
|
226
246
|
private readonly onBeforeNodeRemoved;
|
|
227
|
-
private readonly onAfterTransformUpdate;
|
|
228
247
|
constructor(apiOptions?: CoreOptions_2);
|
|
229
248
|
attach(element: HTMLElement): CanvasCore;
|
|
230
249
|
detach(): CanvasCore;
|
|
@@ -380,11 +399,22 @@ declare type EdgeShapeFactory = () => EdgeShape;
|
|
|
380
399
|
|
|
381
400
|
declare type EdgeShapeFactory_2 = () => EdgeShape;
|
|
382
401
|
|
|
402
|
+
declare interface EventEmitter<T> {
|
|
403
|
+
emit(payload: T): void;
|
|
404
|
+
}
|
|
405
|
+
|
|
383
406
|
declare interface EventHandler<T> {
|
|
384
407
|
subscribe(callback: (payload: T) => void): void;
|
|
385
408
|
unsubscribe(callback: (payload: T) => void): void;
|
|
386
409
|
}
|
|
387
410
|
|
|
411
|
+
export declare class EventSubject<T> implements EventEmitter<T>, EventHandler<T> {
|
|
412
|
+
private readonly callbacks;
|
|
413
|
+
subscribe(callback: (payload: T) => void): void;
|
|
414
|
+
unsubscribe(callback: (payload: T) => void): void;
|
|
415
|
+
emit(payload: T): void;
|
|
416
|
+
}
|
|
417
|
+
|
|
388
418
|
export declare interface GraphEdge {
|
|
389
419
|
readonly from: unknown;
|
|
390
420
|
readonly to: unknown;
|
|
@@ -605,6 +635,13 @@ export declare class PublicViewportTransformer {
|
|
|
605
635
|
getContentMatrix(): TransformState;
|
|
606
636
|
}
|
|
607
637
|
|
|
638
|
+
export declare interface RenderingBox {
|
|
639
|
+
readonly x: number;
|
|
640
|
+
readonly y: number;
|
|
641
|
+
readonly width: number;
|
|
642
|
+
readonly height: number;
|
|
643
|
+
}
|
|
644
|
+
|
|
608
645
|
export declare class ResizeReactiveNodesCanvas implements Canvas {
|
|
609
646
|
private readonly canvas;
|
|
610
647
|
readonly transformation: PublicViewportTransformer;
|