ngx-vflow 0.7.0 → 0.9.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/esm2022/lib/vflow/components/background/background.component.mjs +4 -4
- package/esm2022/lib/vflow/components/connection/connection.component.mjs +2 -2
- package/esm2022/lib/vflow/components/handle/handle.component.mjs +5 -5
- package/esm2022/lib/vflow/components/node/node.component.mjs +31 -82
- package/esm2022/lib/vflow/components/vflow/vflow.component.mjs +32 -16
- package/esm2022/lib/vflow/directives/connection-controller.directive.mjs +91 -12
- package/esm2022/lib/vflow/directives/flow-size-controller.directive.mjs +36 -0
- package/esm2022/lib/vflow/directives/map-context.directive.mjs +16 -12
- package/esm2022/lib/vflow/directives/space-point-context.directive.mjs +11 -5
- package/esm2022/lib/vflow/interfaces/box.mjs +2 -0
- package/esm2022/lib/vflow/interfaces/connection-settings.interface.mjs +1 -1
- package/esm2022/lib/vflow/interfaces/connection.internal.interface.mjs +2 -0
- package/esm2022/lib/vflow/interfaces/fit-view-options.interface.mjs +2 -0
- package/esm2022/lib/vflow/interfaces/rect.mjs +2 -0
- package/esm2022/lib/vflow/interfaces/viewport.interface.mjs +1 -1
- package/esm2022/lib/vflow/models/connection.model.mjs +28 -6
- package/esm2022/lib/vflow/models/handle.model.mjs +1 -1
- package/esm2022/lib/vflow/services/flow-entities.service.mjs +2 -2
- package/esm2022/lib/vflow/services/flow-settings.service.mjs +12 -4
- package/esm2022/lib/vflow/services/flow-status.service.mjs +7 -7
- package/esm2022/lib/vflow/services/handle.service.mjs +1 -1
- package/esm2022/lib/vflow/services/node-changes.service.mjs +3 -3
- package/esm2022/lib/vflow/services/viewport.service.mjs +26 -3
- package/esm2022/lib/vflow/types/connection-mode.type.mjs +2 -0
- package/esm2022/lib/vflow/utils/adjust-direction.mjs +30 -0
- package/esm2022/lib/vflow/utils/nodes.mjs +36 -0
- package/esm2022/lib/vflow/utils/viewport.mjs +15 -0
- package/esm2022/lib/vflow/vflow.module.mjs +6 -3
- package/esm2022/public-api.mjs +3 -1
- package/fesm2022/ngx-vflow.mjs +573 -362
- package/fesm2022/ngx-vflow.mjs.map +1 -1
- package/lib/vflow/components/node/node.component.d.ts +4 -12
- package/lib/vflow/components/vflow/vflow.component.d.ts +10 -4
- package/lib/vflow/directives/connection-controller.directive.d.ts +6 -0
- package/lib/vflow/directives/flow-size-controller.directive.d.ts +10 -0
- package/lib/vflow/directives/map-context.directive.d.ts +9 -3
- package/lib/vflow/directives/space-point-context.directive.d.ts +1 -0
- package/lib/vflow/interfaces/box.d.ts +6 -0
- package/lib/vflow/interfaces/connection-settings.interface.d.ts +2 -0
- package/lib/vflow/interfaces/connection.internal.interface.d.ts +8 -0
- package/lib/vflow/interfaces/fit-view-options.interface.d.ts +15 -0
- package/lib/vflow/interfaces/rect.d.ts +6 -0
- package/lib/vflow/interfaces/viewport.interface.d.ts +1 -0
- package/lib/vflow/models/connection.model.d.ts +5 -2
- package/lib/vflow/models/edge.model.d.ts +17 -1
- package/lib/vflow/models/handle.model.d.ts +1 -1
- package/lib/vflow/services/flow-settings.service.d.ts +10 -2
- package/lib/vflow/services/flow-status.service.d.ts +7 -18
- package/lib/vflow/services/viewport.service.d.ts +5 -0
- package/lib/vflow/types/connection-mode.type.d.ts +1 -0
- package/lib/vflow/utils/adjust-direction.d.ts +11 -0
- package/lib/vflow/utils/nodes.d.ts +3 -0
- package/lib/vflow/utils/viewport.d.ts +4 -0
- package/lib/vflow/vflow.module.d.ts +4 -3
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -9,11 +9,11 @@ export declare class NodeComponent implements OnInit, AfterViewInit, OnDestroy,
|
|
|
9
9
|
private handleService;
|
|
10
10
|
private draggableService;
|
|
11
11
|
private flowStatusService;
|
|
12
|
-
private flowEntitiesService;
|
|
13
12
|
private nodeRenderingService;
|
|
14
13
|
private flowSettingsService;
|
|
15
14
|
private selectionService;
|
|
16
15
|
private hostRef;
|
|
16
|
+
private connectionController;
|
|
17
17
|
nodeModel: NodeModel;
|
|
18
18
|
nodeHtmlTemplate?: TemplateRef<any>;
|
|
19
19
|
nodeContentRef: ElementRef<SVGGraphicsElement>;
|
|
@@ -21,23 +21,15 @@ export declare class NodeComponent implements OnInit, AfterViewInit, OnDestroy,
|
|
|
21
21
|
protected showMagnet: import("@angular/core").Signal<boolean>;
|
|
22
22
|
protected styleWidth: import("@angular/core").Signal<string>;
|
|
23
23
|
protected styleHeight: import("@angular/core").Signal<string>;
|
|
24
|
-
private subscription;
|
|
25
24
|
ngOnInit(): void;
|
|
26
25
|
ngAfterViewInit(): void;
|
|
27
26
|
ngOnDestroy(): void;
|
|
28
27
|
protected startConnection(event: Event, handle: HandleModel): void;
|
|
29
|
-
protected
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*/
|
|
33
|
-
protected validateTargetHandle(targetHandle: HandleModel): void;
|
|
34
|
-
/**
|
|
35
|
-
* TODO srp
|
|
36
|
-
*/
|
|
37
|
-
protected resetValidateTargetHandle(targetHandle: HandleModel): void;
|
|
28
|
+
protected validateConnection(handle: HandleModel): void;
|
|
29
|
+
protected resetValidateConnection(targetHandle: HandleModel): void;
|
|
30
|
+
protected endConnection(handle: HandleModel): void;
|
|
38
31
|
protected pullNode(): void;
|
|
39
32
|
protected selectNode(): void;
|
|
40
|
-
private setInitialHandles;
|
|
41
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<NodeComponent, never>;
|
|
42
34
|
static ɵcmp: i0.ɵɵComponentDeclaration<NodeComponent, "g[node]", never, { "nodeModel": { "alias": "nodeModel"; "required": false; }; "nodeHtmlTemplate": { "alias": "nodeHtmlTemplate"; "required": false; }; }, {}, never, never, false, never>;
|
|
43
35
|
}
|
|
@@ -12,6 +12,8 @@ import { ConnectionModel } from '../../models/connection.model';
|
|
|
12
12
|
import { NodeChange } from '../../types/node-change.type';
|
|
13
13
|
import { EdgeChange } from '../../types/edge-change.type';
|
|
14
14
|
import { Background } from '../../types/background.type';
|
|
15
|
+
import { SpacePointContextDirective } from '../../directives/space-point-context.directive';
|
|
16
|
+
import { FitViewOptions } from '../../interfaces/fit-view-options.interface';
|
|
15
17
|
import * as i0 from "@angular/core";
|
|
16
18
|
import * as i1 from "../../directives/connection-controller.directive";
|
|
17
19
|
import * as i2 from "../../directives/changes-controller.directive";
|
|
@@ -39,11 +41,11 @@ export declare class VflowComponent {
|
|
|
39
41
|
/**
|
|
40
42
|
* Minimum zoom value
|
|
41
43
|
*/
|
|
42
|
-
minZoom: number;
|
|
44
|
+
set minZoom(value: number);
|
|
43
45
|
/**
|
|
44
46
|
* Maximum zoom value
|
|
45
47
|
*/
|
|
46
|
-
maxZoom: number;
|
|
48
|
+
set maxZoom(value: number);
|
|
47
49
|
/**
|
|
48
50
|
* Object that controls flow direction.
|
|
49
51
|
*
|
|
@@ -89,6 +91,7 @@ export declare class VflowComponent {
|
|
|
89
91
|
protected edgeLabelHtmlDirective?: EdgeLabelHtmlTemplateDirective;
|
|
90
92
|
protected connectionTemplateDirective?: ConnectionTemplateDirective;
|
|
91
93
|
protected mapContext: MapContextDirective;
|
|
94
|
+
protected spacePointContext: SpacePointContextDirective;
|
|
92
95
|
/**
|
|
93
96
|
* Signal for reading viewport change
|
|
94
97
|
*/
|
|
@@ -113,8 +116,6 @@ export declare class VflowComponent {
|
|
|
113
116
|
* Observable with edges change
|
|
114
117
|
*/
|
|
115
118
|
readonly edgesChange$: import("rxjs").Observable<EdgeChange[]>;
|
|
116
|
-
protected flowWidth: Signal<string | number>;
|
|
117
|
-
protected flowHeight: Signal<string | number>;
|
|
118
119
|
protected markers: Signal<Map<number, import("ngx-vflow").Marker>>;
|
|
119
120
|
/**
|
|
120
121
|
* Change viewport to specified state
|
|
@@ -134,6 +135,7 @@ export declare class VflowComponent {
|
|
|
134
135
|
* @param point point where to move
|
|
135
136
|
*/
|
|
136
137
|
panTo(point: Point): void;
|
|
138
|
+
fitView(options?: FitViewOptions): void;
|
|
137
139
|
/**
|
|
138
140
|
* Get node by id
|
|
139
141
|
*
|
|
@@ -144,6 +146,10 @@ export declare class VflowComponent {
|
|
|
144
146
|
* Sync method to get detached edges
|
|
145
147
|
*/
|
|
146
148
|
getDetachedEdges(): Edge[];
|
|
149
|
+
/**
|
|
150
|
+
* Convert point received from document to point on the flow
|
|
151
|
+
*/
|
|
152
|
+
documentPointToFlowPoint(point: Point): Point;
|
|
147
153
|
protected trackNodes(idx: number, { node }: NodeModel): Node<unknown>;
|
|
148
154
|
protected trackEdges(idx: number, { edge }: EdgeModel): Edge<unknown>;
|
|
149
155
|
static ɵfac: i0.ɵɵFactoryDeclaration<VflowComponent, never>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import { Connection } from '../interfaces/connection.interface';
|
|
3
|
+
import { HandleModel } from '../models/handle.model';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class ConnectionControllerDirective {
|
|
5
6
|
/**
|
|
@@ -14,6 +15,11 @@ export declare class ConnectionControllerDirective {
|
|
|
14
15
|
private statusService;
|
|
15
16
|
private flowEntitiesService;
|
|
16
17
|
protected connectEffect: import("@angular/core").EffectRef;
|
|
18
|
+
protected isStrictMode: import("@angular/core").Signal<boolean>;
|
|
19
|
+
startConnection(handle: HandleModel): void;
|
|
20
|
+
validateConnection(handle: HandleModel): void;
|
|
21
|
+
resetValidateConnection(targetHandle: HandleModel): void;
|
|
22
|
+
endConnection(handle: HandleModel): void;
|
|
17
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConnectionControllerDirective, never>;
|
|
18
24
|
static ɵdir: i0.ɵɵDirectiveDeclaration<ConnectionControllerDirective, "[connectionController]", never, {}, { "onConnect": "onConnect"; }, never, never, true, never>;
|
|
19
25
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class FlowSizeControllerDirective {
|
|
3
|
+
private host;
|
|
4
|
+
private flowSettingsService;
|
|
5
|
+
flowWidth: string | number;
|
|
6
|
+
flowHeight: string | number;
|
|
7
|
+
constructor();
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FlowSizeControllerDirective, never>;
|
|
9
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FlowSizeControllerDirective, "svg[flowSizeController]", never, {}, {}, never, never, false, never>;
|
|
10
|
+
}
|
|
@@ -2,14 +2,14 @@ import { OnInit } from '@angular/core';
|
|
|
2
2
|
import { ZoomBehavior } from 'd3-zoom';
|
|
3
3
|
import { ViewportService } from '../services/viewport.service';
|
|
4
4
|
import { SelectionService, ViewportForSelection } from '../services/selection.service';
|
|
5
|
+
import { FlowSettingsService } from '../services/flow-settings.service';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class MapContextDirective implements OnInit {
|
|
7
|
-
minZoom: number;
|
|
8
|
-
maxZoom: number;
|
|
9
8
|
protected rootSvg: SVGSVGElement;
|
|
10
9
|
protected host: SVGGElement;
|
|
11
10
|
protected selectionService: SelectionService;
|
|
12
11
|
protected viewportService: ViewportService;
|
|
12
|
+
protected flowSettingsService: FlowSettingsService;
|
|
13
13
|
protected rootSvgSelection: import("d3-selection").Selection<SVGSVGElement, unknown, null, undefined>;
|
|
14
14
|
protected zoomableSelection: import("d3-selection").Selection<SVGGElement, unknown, null, undefined>;
|
|
15
15
|
protected viewportForSelection: Partial<ViewportForSelection>;
|
|
@@ -20,5 +20,11 @@ export declare class MapContextDirective implements OnInit {
|
|
|
20
20
|
private onD3zoomStart;
|
|
21
21
|
private onD3zoomEnd;
|
|
22
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<MapContextDirective, never>;
|
|
23
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<MapContextDirective, "g[mapContext]", never, {
|
|
23
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MapContextDirective, "g[mapContext]", never, {}, {}, never, never, false, never>;
|
|
24
|
+
}
|
|
25
|
+
declare module 'd3-selection' {
|
|
26
|
+
interface Selection<GElement extends BaseType, Datum, PElement extends BaseType, PDatum> {
|
|
27
|
+
transition(): Selection<GElement, Datum, PElement, PDatum>;
|
|
28
|
+
duration(duration: number): Selection<GElement, Datum, PElement, PDatum>;
|
|
29
|
+
}
|
|
24
30
|
}
|
|
@@ -19,6 +19,7 @@ export declare class SpacePointContextDirective {
|
|
|
19
19
|
target: Element | null;
|
|
20
20
|
originalEvent: TouchEvent;
|
|
21
21
|
} | undefined>;
|
|
22
|
+
documentPointToFlowPoint(documentPoint: Point): DOMPoint;
|
|
22
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<SpacePointContextDirective, never>;
|
|
23
24
|
static ɵdir: i0.ɵɵDirectiveDeclaration<SpacePointContextDirective, "g[spacePointContext]", never, {}, {}, never, never, false, never>;
|
|
24
25
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConnectionMode } from "../types/connection-mode.type";
|
|
1
2
|
import { Connection } from "./connection.interface";
|
|
2
3
|
import { Curve, EdgeType } from "./edge.interface";
|
|
3
4
|
import { Marker } from "./marker.interface";
|
|
@@ -7,4 +8,5 @@ export interface ConnectionSettings {
|
|
|
7
8
|
type?: EdgeType;
|
|
8
9
|
validator?: ConnectionValidatorFn;
|
|
9
10
|
marker?: Marker;
|
|
11
|
+
mode?: ConnectionMode;
|
|
10
12
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface FitViewOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Padding for viewport
|
|
4
|
+
*/
|
|
5
|
+
padding?: number;
|
|
6
|
+
/**
|
|
7
|
+
* Duration of animated transition to new viewport
|
|
8
|
+
*/
|
|
9
|
+
duration?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Nodes that should be visible after fitView.
|
|
12
|
+
* The whole flow will be visible if not passed or passed an empty array
|
|
13
|
+
*/
|
|
14
|
+
nodes?: string[];
|
|
15
|
+
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { ConnectionSettings, ConnectionValidatorFn } from "../interfaces/connection-settings.interface";
|
|
2
2
|
import { Curve, EdgeType } from "../interfaces/edge.interface";
|
|
3
|
+
import { ConnectionMode } from "../types/connection-mode.type";
|
|
3
4
|
export declare class ConnectionModel {
|
|
4
|
-
|
|
5
|
+
settings: ConnectionSettings;
|
|
5
6
|
curve: Curve;
|
|
6
7
|
type: EdgeType;
|
|
7
8
|
validator: ConnectionValidatorFn;
|
|
8
|
-
|
|
9
|
+
mode: ConnectionMode;
|
|
10
|
+
constructor(settings: ConnectionSettings);
|
|
11
|
+
private getValidators;
|
|
9
12
|
}
|
|
@@ -14,7 +14,23 @@ export declare class EdgeModel implements FlowEntity {
|
|
|
14
14
|
selected$: import("rxjs").Observable<boolean>;
|
|
15
15
|
detached: import("@angular/core").Signal<boolean>;
|
|
16
16
|
detached$: import("rxjs").Observable<boolean>;
|
|
17
|
-
path: import("@angular/core").Signal<
|
|
17
|
+
path: import("@angular/core").Signal<{
|
|
18
|
+
path: string;
|
|
19
|
+
points: {
|
|
20
|
+
start: {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
};
|
|
24
|
+
center: {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
};
|
|
28
|
+
end: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}>;
|
|
18
34
|
edgeLabels: {
|
|
19
35
|
[position in EdgeLabelPosition]?: EdgeLabelModel;
|
|
20
36
|
};
|
|
@@ -3,7 +3,7 @@ import { NodeModel } from "./node.model";
|
|
|
3
3
|
export type HandleState = 'valid' | 'invalid' | 'idle';
|
|
4
4
|
export declare class HandleModel {
|
|
5
5
|
rawHandle: NodeHandle;
|
|
6
|
-
|
|
6
|
+
parentNode: NodeModel;
|
|
7
7
|
readonly strokeWidth = 2;
|
|
8
8
|
/**
|
|
9
9
|
* Pre-computed size for default handle, changed dynamically
|
|
@@ -13,8 +13,16 @@ export declare class FlowSettingsService {
|
|
|
13
13
|
* @see {VflowComponent.view}
|
|
14
14
|
*/
|
|
15
15
|
view: WritableSignal<[number, number] | 'auto'>;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Set based on view property. May change if view is 'auto'
|
|
18
|
+
*/
|
|
19
|
+
computedFlowWidth: WritableSignal<number>;
|
|
20
|
+
/**
|
|
21
|
+
* Set based on view property. May change if view is 'auto'
|
|
22
|
+
*/
|
|
23
|
+
computedFlowHeight: WritableSignal<number>;
|
|
24
|
+
minZoom: WritableSignal<number>;
|
|
25
|
+
maxZoom: WritableSignal<number>;
|
|
18
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<FlowSettingsService, never>;
|
|
19
27
|
static ɵprov: i0.ɵɵInjectableDeclaration<FlowSettingsService>;
|
|
20
28
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NodeModel } from '../models/node.model';
|
|
2
2
|
import { HandleModel } from '../models/handle.model';
|
|
3
|
+
import { ConnectionInternal } from '../interfaces/connection.internal.interface';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export interface FlowStatusIdle {
|
|
5
6
|
state: 'idle';
|
|
@@ -7,37 +8,25 @@ export interface FlowStatusIdle {
|
|
|
7
8
|
}
|
|
8
9
|
export interface FlowStatusConnectionStart {
|
|
9
10
|
state: 'connection-start';
|
|
10
|
-
payload:
|
|
11
|
-
sourceNode: NodeModel;
|
|
12
|
-
sourceHandle: HandleModel;
|
|
13
|
-
};
|
|
11
|
+
payload: Omit<ConnectionInternal, 'target' | 'targetHandle'>;
|
|
14
12
|
}
|
|
15
13
|
export interface FlowStatusConnectionValidation {
|
|
16
14
|
state: 'connection-validation';
|
|
17
|
-
payload: {
|
|
18
|
-
sourceNode: NodeModel;
|
|
19
|
-
targetNode: NodeModel;
|
|
20
|
-
sourceHandle: HandleModel;
|
|
21
|
-
targetHandle: HandleModel;
|
|
15
|
+
payload: ConnectionInternal & {
|
|
22
16
|
valid: boolean;
|
|
23
17
|
};
|
|
24
18
|
}
|
|
25
19
|
export interface FlowStatusConnectionEnd {
|
|
26
20
|
state: 'connection-end';
|
|
27
|
-
payload:
|
|
28
|
-
sourceNode: NodeModel;
|
|
29
|
-
targetNode: NodeModel;
|
|
30
|
-
sourceHandle: HandleModel;
|
|
31
|
-
targetHandle: HandleModel;
|
|
32
|
-
};
|
|
21
|
+
payload: ConnectionInternal;
|
|
33
22
|
}
|
|
34
23
|
export type FlowStatus = FlowStatusIdle | FlowStatusConnectionStart | FlowStatusConnectionValidation | FlowStatusConnectionEnd;
|
|
35
24
|
export declare class FlowStatusService {
|
|
36
25
|
readonly status: import("@angular/core").WritableSignal<FlowStatus>;
|
|
37
26
|
setIdleStatus(): void;
|
|
38
|
-
setConnectionStartStatus(
|
|
39
|
-
setConnectionValidationStatus(valid: boolean,
|
|
40
|
-
setConnectionEndStatus(
|
|
27
|
+
setConnectionStartStatus(source: NodeModel, sourceHandle: HandleModel): void;
|
|
28
|
+
setConnectionValidationStatus(valid: boolean, source: NodeModel, target: NodeModel, sourceHandle: HandleModel, targetHandle: HandleModel): void;
|
|
29
|
+
setConnectionEndStatus(source: NodeModel, target: NodeModel, sourceHandle: HandleModel, targetHandle: HandleModel): void;
|
|
41
30
|
static ɵfac: i0.ɵɵFactoryDeclaration<FlowStatusService, never>;
|
|
42
31
|
static ɵprov: i0.ɵɵInjectableDeclaration<FlowStatusService>;
|
|
43
32
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { WritableSignal } from '@angular/core';
|
|
2
2
|
import { ViewportState, WritableViewport } from '../interfaces/viewport.interface';
|
|
3
|
+
import { FitViewOptions } from '../interfaces/fit-view-options.interface';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class ViewportService {
|
|
6
|
+
private entitiesService;
|
|
7
|
+
private flowSettingsService;
|
|
5
8
|
/**
|
|
6
9
|
* The default value used by d3, just copy it here
|
|
7
10
|
*
|
|
@@ -19,6 +22,8 @@ export declare class ViewportService {
|
|
|
19
22
|
* - writableViewport signal
|
|
20
23
|
*/
|
|
21
24
|
readonly readableViewport: WritableSignal<ViewportState>;
|
|
25
|
+
fitView(options?: FitViewOptions): void;
|
|
26
|
+
private getBoundsNodes;
|
|
22
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<ViewportService, never>;
|
|
23
28
|
static ɵprov: i0.ɵɵInjectableDeclaration<ViewportService>;
|
|
24
29
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ConnectionMode = 'loose' | 'strict';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ConnectionInternal } from "../interfaces/connection.internal.interface";
|
|
2
|
+
/**
|
|
3
|
+
* This function contains a hack-y behavior.
|
|
4
|
+
* If the handles are of the same type (source-source or target-target),
|
|
5
|
+
* it returns nodes where source === target and
|
|
6
|
+
* handles where sourceHandle === targetHandle
|
|
7
|
+
*
|
|
8
|
+
* This leads to that notSelfValidator returns false for these cases,
|
|
9
|
+
* exactly what we need for strict connection type
|
|
10
|
+
*/
|
|
11
|
+
export declare function adjustDirection(connection: ConnectionInternal): ConnectionInternal;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Rect } from "../interfaces/rect";
|
|
2
|
+
import { ViewportState } from "../interfaces/viewport.interface";
|
|
3
|
+
export declare function getViewportForBounds(bounds: Rect, width: number, height: number, minZoom: number, maxZoom: number, padding: number): ViewportState;
|
|
4
|
+
export declare function clamp(value: number, min?: number, max?: number): number;
|
|
@@ -15,10 +15,11 @@ import * as i13 from "./directives/handle-size-controller.directive";
|
|
|
15
15
|
import * as i14 from "./directives/selectable.directive";
|
|
16
16
|
import * as i15 from "./directives/pointer.directive";
|
|
17
17
|
import * as i16 from "./directives/root-pointer.directive";
|
|
18
|
-
import * as i17 from "./directives/
|
|
19
|
-
import * as i18 from "
|
|
18
|
+
import * as i17 from "./directives/flow-size-controller.directive";
|
|
19
|
+
import * as i18 from "./directives/template.directive";
|
|
20
|
+
import * as i19 from "@angular/common";
|
|
20
21
|
export declare class VflowModule {
|
|
21
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<VflowModule, never>;
|
|
22
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<VflowModule, [typeof i1.VflowComponent, typeof i2.NodeComponent, typeof i3.EdgeComponent, typeof i4.EdgeLabelComponent, typeof i5.ConnectionComponent, typeof i6.HandleComponent, typeof i7.DefsComponent, typeof i8.BackgroundComponent, typeof i9.SpacePointContextDirective, typeof i10.MapContextDirective, typeof i11.RootSvgReferenceDirective, typeof i12.RootSvgContextDirective, typeof i13.HandleSizeControllerDirective, typeof i14.SelectableDirective, typeof i15.PointerDirective, typeof i16.RootPointerDirective, typeof i17.NodeHtmlTemplateDirective, typeof
|
|
23
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<VflowModule, [typeof i1.VflowComponent, typeof i2.NodeComponent, typeof i3.EdgeComponent, typeof i4.EdgeLabelComponent, typeof i5.ConnectionComponent, typeof i6.HandleComponent, typeof i7.DefsComponent, typeof i8.BackgroundComponent, typeof i9.SpacePointContextDirective, typeof i10.MapContextDirective, typeof i11.RootSvgReferenceDirective, typeof i12.RootSvgContextDirective, typeof i13.HandleSizeControllerDirective, typeof i14.SelectableDirective, typeof i15.PointerDirective, typeof i16.RootPointerDirective, typeof i17.FlowSizeControllerDirective, typeof i18.NodeHtmlTemplateDirective, typeof i18.EdgeLabelHtmlTemplateDirective, typeof i18.EdgeTemplateDirective, typeof i18.ConnectionTemplateDirective, typeof i18.HandleTemplateDirective], [typeof i19.CommonModule], [typeof i1.VflowComponent, typeof i6.HandleComponent, typeof i14.SelectableDirective, typeof i18.NodeHtmlTemplateDirective, typeof i18.EdgeLabelHtmlTemplateDirective, typeof i18.EdgeTemplateDirective, typeof i18.ConnectionTemplateDirective, typeof i18.HandleTemplateDirective]>;
|
|
23
24
|
static ɵinj: i0.ɵɵInjectorDeclaration<VflowModule>;
|
|
24
25
|
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -10,10 +10,12 @@ export * from './lib/vflow/interfaces/handle-positions.interface';
|
|
|
10
10
|
export * from './lib/vflow/interfaces/marker.interface';
|
|
11
11
|
export { ViewportState } from './lib/vflow/interfaces/viewport.interface';
|
|
12
12
|
export * from './lib/vflow/interfaces/component-node-event.interface';
|
|
13
|
+
export * from './lib/vflow/interfaces/fit-view-options.interface';
|
|
13
14
|
export * from './lib/vflow/types/node-change.type';
|
|
14
15
|
export * from './lib/vflow/types/edge-change.type';
|
|
15
16
|
export * from './lib/vflow/types/position.type';
|
|
16
17
|
export * from './lib/vflow/types/background.type';
|
|
18
|
+
export * from './lib/vflow/types/connection-mode.type';
|
|
17
19
|
export * from './lib/vflow/components/vflow/vflow.component';
|
|
18
20
|
export * from './lib/vflow/components/handle/handle.component';
|
|
19
21
|
export * from './lib/vflow/public-components/custom-node.component';
|