@onealmonddotcom/ngx-graph 12.0.0-alpha.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.
|
@@ -0,0 +1,682 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, ElementRef, NgZone, OnInit, OnChanges, OnDestroy, AfterViewInit, ChangeDetectorRef, TemplateRef, QueryList, SimpleChanges } from '@angular/core';
|
|
3
|
+
import * as i4 from '@angular/common';
|
|
4
|
+
import { Observable, Subscription, Subject } from 'rxjs';
|
|
5
|
+
import * as d3_scale from 'd3-scale';
|
|
6
|
+
import { Layout as Layout$1, ID3StyleLayoutAdaptor, Group, InputNode, Link } from 'webcola';
|
|
7
|
+
|
|
8
|
+
interface NodePosition {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}
|
|
12
|
+
interface NodeDimension {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
}
|
|
16
|
+
interface Node {
|
|
17
|
+
id: string;
|
|
18
|
+
position?: NodePosition;
|
|
19
|
+
dimension?: NodeDimension;
|
|
20
|
+
transform?: string;
|
|
21
|
+
label?: string;
|
|
22
|
+
data?: any;
|
|
23
|
+
meta?: any;
|
|
24
|
+
layoutOptions?: any;
|
|
25
|
+
parentId?: string;
|
|
26
|
+
hidden?: boolean;
|
|
27
|
+
}
|
|
28
|
+
interface ClusterNode extends Node {
|
|
29
|
+
childNodeIds?: string[];
|
|
30
|
+
}
|
|
31
|
+
interface CompoundNode extends Node {
|
|
32
|
+
childNodeIds?: string[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface Edge {
|
|
36
|
+
id?: string;
|
|
37
|
+
source: string;
|
|
38
|
+
target: string;
|
|
39
|
+
label?: string;
|
|
40
|
+
data?: any;
|
|
41
|
+
points?: any;
|
|
42
|
+
line?: string;
|
|
43
|
+
textTransform?: string;
|
|
44
|
+
textAngle?: number;
|
|
45
|
+
oldLine?: any;
|
|
46
|
+
oldTextPath?: string;
|
|
47
|
+
textPath?: string;
|
|
48
|
+
midPoint?: NodePosition;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface Graph {
|
|
52
|
+
edges: Edge[];
|
|
53
|
+
nodes: Node[];
|
|
54
|
+
compoundNodes?: CompoundNode[];
|
|
55
|
+
clusters?: ClusterNode[];
|
|
56
|
+
edgeLabels?: any;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface Layout {
|
|
60
|
+
settings?: any;
|
|
61
|
+
run(graph: Graph): Graph | Observable<Graph>;
|
|
62
|
+
updateEdge(graph: Graph, edge: Edge): Graph | Observable<Graph>;
|
|
63
|
+
onDragStart?(draggingNode: Node, $event: MouseEvent): void;
|
|
64
|
+
onDrag?(draggingNode: Node, $event: MouseEvent): void;
|
|
65
|
+
onDragEnd?(draggingNode: Node, $event: MouseEvent): void;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
declare class LayoutService {
|
|
69
|
+
getLayout(name: string): Layout;
|
|
70
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LayoutService, never>;
|
|
71
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<LayoutService>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
declare enum PanningAxis {
|
|
75
|
+
Both = "both",
|
|
76
|
+
Horizontal = "horizontal",
|
|
77
|
+
Vertical = "vertical"
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
declare enum MiniMapPosition {
|
|
81
|
+
UpperLeft = "UpperLeft",
|
|
82
|
+
UpperRight = "UpperRight"
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
declare class ColorHelper {
|
|
86
|
+
scale: any;
|
|
87
|
+
colorDomain: any[];
|
|
88
|
+
domain: any;
|
|
89
|
+
customColors: any;
|
|
90
|
+
constructor(scheme: any, domain: any, customColors?: any);
|
|
91
|
+
generateColorScheme(scheme: any, domain: any): d3_scale.ScaleOrdinal<string, unknown, never>;
|
|
92
|
+
getColor(value: any): any;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
interface ViewDimensions {
|
|
96
|
+
width: number;
|
|
97
|
+
height: number;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Visibility Observer
|
|
102
|
+
*/
|
|
103
|
+
declare class VisibilityObserver {
|
|
104
|
+
private element;
|
|
105
|
+
private zone;
|
|
106
|
+
visible: EventEmitter<any>;
|
|
107
|
+
timeout: any;
|
|
108
|
+
isVisible: boolean;
|
|
109
|
+
constructor(element: ElementRef, zone: NgZone);
|
|
110
|
+
destroy(): void;
|
|
111
|
+
onVisibilityChange(): void;
|
|
112
|
+
runCheck(): void;
|
|
113
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VisibilityObserver, never>;
|
|
114
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<VisibilityObserver, "visibility-observer", never, {}, { "visible": "visible"; }, never, never, false, never>;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Matrix
|
|
119
|
+
*/
|
|
120
|
+
interface Matrix {
|
|
121
|
+
a: number;
|
|
122
|
+
b: number;
|
|
123
|
+
c: number;
|
|
124
|
+
d: number;
|
|
125
|
+
e: number;
|
|
126
|
+
f: number;
|
|
127
|
+
}
|
|
128
|
+
interface NgxGraphZoomOptions {
|
|
129
|
+
autoCenter?: boolean;
|
|
130
|
+
force?: boolean;
|
|
131
|
+
}
|
|
132
|
+
declare enum NgxGraphStates {
|
|
133
|
+
Init = "init",
|
|
134
|
+
Subscribe = "subscribe",
|
|
135
|
+
Transform = "transform",
|
|
136
|
+
Output = "output"
|
|
137
|
+
}
|
|
138
|
+
interface NgxGraphStateChangeEvent {
|
|
139
|
+
state: NgxGraphStates;
|
|
140
|
+
}
|
|
141
|
+
declare class GraphComponent implements OnInit, OnChanges, OnDestroy, AfterViewInit {
|
|
142
|
+
private el;
|
|
143
|
+
zone: NgZone;
|
|
144
|
+
cd: ChangeDetectorRef;
|
|
145
|
+
private layoutService;
|
|
146
|
+
nodes: Node[];
|
|
147
|
+
clusters: ClusterNode[];
|
|
148
|
+
compoundNodes: CompoundNode[];
|
|
149
|
+
links: Edge[];
|
|
150
|
+
activeEntries: any[];
|
|
151
|
+
curve: any;
|
|
152
|
+
draggingEnabled: boolean;
|
|
153
|
+
nodeHeight: number;
|
|
154
|
+
nodeMaxHeight: number;
|
|
155
|
+
nodeMinHeight: number;
|
|
156
|
+
nodeWidth: number;
|
|
157
|
+
nodeMinWidth: number;
|
|
158
|
+
nodeMaxWidth: number;
|
|
159
|
+
panningEnabled: boolean;
|
|
160
|
+
panningAxis: PanningAxis;
|
|
161
|
+
enableZoom: boolean;
|
|
162
|
+
zoomSpeed: number;
|
|
163
|
+
minZoomLevel: number;
|
|
164
|
+
maxZoomLevel: number;
|
|
165
|
+
autoZoom: boolean;
|
|
166
|
+
panOnZoom: boolean;
|
|
167
|
+
animate?: boolean;
|
|
168
|
+
autoCenter: boolean;
|
|
169
|
+
update$: Observable<any>;
|
|
170
|
+
center$: Observable<any>;
|
|
171
|
+
zoomToFit$: Observable<NgxGraphZoomOptions>;
|
|
172
|
+
panToNode$: Observable<any>;
|
|
173
|
+
layout: string | Layout;
|
|
174
|
+
layoutSettings: any;
|
|
175
|
+
enableTrackpadSupport: boolean;
|
|
176
|
+
showMiniMap: boolean;
|
|
177
|
+
miniMapMaxWidth: number;
|
|
178
|
+
miniMapMaxHeight: number;
|
|
179
|
+
miniMapPosition: MiniMapPosition;
|
|
180
|
+
view: [number, number];
|
|
181
|
+
scheme: any;
|
|
182
|
+
customColors: any;
|
|
183
|
+
deferDisplayUntilPosition: boolean;
|
|
184
|
+
centerNodesOnPositionChange: boolean;
|
|
185
|
+
enablePreUpdateTransform: boolean;
|
|
186
|
+
select: EventEmitter<any>;
|
|
187
|
+
activate: EventEmitter<any>;
|
|
188
|
+
deactivate: EventEmitter<any>;
|
|
189
|
+
zoomChange: EventEmitter<number>;
|
|
190
|
+
clickHandler: EventEmitter<MouseEvent>;
|
|
191
|
+
stateChange: EventEmitter<NgxGraphStateChangeEvent>;
|
|
192
|
+
linkTemplate: TemplateRef<any>;
|
|
193
|
+
nodeTemplate: TemplateRef<any>;
|
|
194
|
+
clusterTemplate: TemplateRef<any>;
|
|
195
|
+
defsTemplate: TemplateRef<any>;
|
|
196
|
+
miniMapNodeTemplate: TemplateRef<any>;
|
|
197
|
+
nodeElements: QueryList<ElementRef>;
|
|
198
|
+
linkElements: QueryList<ElementRef>;
|
|
199
|
+
chartWidth: any;
|
|
200
|
+
private isMouseMoveCalled;
|
|
201
|
+
graphSubscription: Subscription;
|
|
202
|
+
colors: ColorHelper;
|
|
203
|
+
dims: ViewDimensions;
|
|
204
|
+
seriesDomain: any;
|
|
205
|
+
transform: string;
|
|
206
|
+
isPanning: boolean;
|
|
207
|
+
isDragging: boolean;
|
|
208
|
+
draggingNode: Node;
|
|
209
|
+
initialized: boolean;
|
|
210
|
+
graph: Graph;
|
|
211
|
+
graphDims: any;
|
|
212
|
+
_oldLinks: Edge[];
|
|
213
|
+
oldNodes: Set<string>;
|
|
214
|
+
oldClusters: Set<string>;
|
|
215
|
+
oldCompoundNodes: Set<string>;
|
|
216
|
+
transformationMatrix: Matrix;
|
|
217
|
+
_touchLastX: any;
|
|
218
|
+
_touchLastY: any;
|
|
219
|
+
minimapScaleCoefficient: number;
|
|
220
|
+
minimapTransform: string;
|
|
221
|
+
minimapOffsetX: number;
|
|
222
|
+
minimapOffsetY: number;
|
|
223
|
+
isMinimapPanning: boolean;
|
|
224
|
+
minimapClipPathId: string;
|
|
225
|
+
width: number;
|
|
226
|
+
height: number;
|
|
227
|
+
resizeSubscription: any;
|
|
228
|
+
visibilityObserver: VisibilityObserver;
|
|
229
|
+
private destroy$;
|
|
230
|
+
constructor(el: ElementRef, zone: NgZone, cd: ChangeDetectorRef, layoutService: LayoutService);
|
|
231
|
+
groupResultsBy: (node: any) => string;
|
|
232
|
+
/**
|
|
233
|
+
* Get the current zoom level
|
|
234
|
+
*/
|
|
235
|
+
get zoomLevel(): number;
|
|
236
|
+
/**
|
|
237
|
+
* Set the current zoom level
|
|
238
|
+
*/
|
|
239
|
+
set zoomLevel(level: number);
|
|
240
|
+
/**
|
|
241
|
+
* Get the current `x` position of the graph
|
|
242
|
+
*/
|
|
243
|
+
get panOffsetX(): number;
|
|
244
|
+
/**
|
|
245
|
+
* Set the current `x` position of the graph
|
|
246
|
+
*/
|
|
247
|
+
set panOffsetX(x: number);
|
|
248
|
+
/**
|
|
249
|
+
* Get the current `y` position of the graph
|
|
250
|
+
*/
|
|
251
|
+
get panOffsetY(): number;
|
|
252
|
+
/**
|
|
253
|
+
* Set the current `y` position of the graph
|
|
254
|
+
*/
|
|
255
|
+
set panOffsetY(y: number);
|
|
256
|
+
/**
|
|
257
|
+
* Angular lifecycle event
|
|
258
|
+
*
|
|
259
|
+
*
|
|
260
|
+
* @memberOf GraphComponent
|
|
261
|
+
*/
|
|
262
|
+
ngOnInit(): void;
|
|
263
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
264
|
+
setLayout(layout: string | Layout): void;
|
|
265
|
+
setLayoutSettings(settings: any): void;
|
|
266
|
+
/**
|
|
267
|
+
* Angular lifecycle event
|
|
268
|
+
*
|
|
269
|
+
*
|
|
270
|
+
* @memberOf GraphComponent
|
|
271
|
+
*/
|
|
272
|
+
ngOnDestroy(): void;
|
|
273
|
+
/**
|
|
274
|
+
* Angular lifecycle event
|
|
275
|
+
*
|
|
276
|
+
*
|
|
277
|
+
* @memberOf GraphComponent
|
|
278
|
+
*/
|
|
279
|
+
ngAfterViewInit(): void;
|
|
280
|
+
/**
|
|
281
|
+
* Base class update implementation for the dag graph
|
|
282
|
+
*
|
|
283
|
+
* @memberOf GraphComponent
|
|
284
|
+
*/
|
|
285
|
+
update(): void;
|
|
286
|
+
/**
|
|
287
|
+
* Creates the dagre graph engine
|
|
288
|
+
*
|
|
289
|
+
* @memberOf GraphComponent
|
|
290
|
+
*/
|
|
291
|
+
createGraph(): void;
|
|
292
|
+
/**
|
|
293
|
+
* Draws the graph using dagre layouts
|
|
294
|
+
*
|
|
295
|
+
*
|
|
296
|
+
* @memberOf GraphComponent
|
|
297
|
+
*/
|
|
298
|
+
draw(): void;
|
|
299
|
+
tick(): void;
|
|
300
|
+
getMinimapTransform(): string;
|
|
301
|
+
updateGraphDims(): void;
|
|
302
|
+
updateMinimap(): void;
|
|
303
|
+
/**
|
|
304
|
+
* Measures the node element and applies the dimensions
|
|
305
|
+
*
|
|
306
|
+
* @memberOf GraphComponent
|
|
307
|
+
*/
|
|
308
|
+
applyNodeDimensions(): void;
|
|
309
|
+
/**
|
|
310
|
+
* Redraws the lines when dragged or viewport updated
|
|
311
|
+
*
|
|
312
|
+
* @memberOf GraphComponent
|
|
313
|
+
*/
|
|
314
|
+
redrawLines(_animate?: boolean): void;
|
|
315
|
+
/**
|
|
316
|
+
* Calculate the text directions / flipping
|
|
317
|
+
*
|
|
318
|
+
* @memberOf GraphComponent
|
|
319
|
+
*/
|
|
320
|
+
calcDominantBaseline(link: any): void;
|
|
321
|
+
/**
|
|
322
|
+
* Generate the new line path
|
|
323
|
+
*
|
|
324
|
+
* @memberOf GraphComponent
|
|
325
|
+
*/
|
|
326
|
+
generateLine(points: any): any;
|
|
327
|
+
/**
|
|
328
|
+
* Zoom was invoked from event
|
|
329
|
+
*
|
|
330
|
+
* @memberOf GraphComponent
|
|
331
|
+
*/
|
|
332
|
+
onZoom($event: WheelEvent, direction: string): void;
|
|
333
|
+
/**
|
|
334
|
+
* Pan by x/y
|
|
335
|
+
*
|
|
336
|
+
* @param x
|
|
337
|
+
* @param y
|
|
338
|
+
*/
|
|
339
|
+
pan(x: number, y: number, ignoreZoomLevel?: boolean): void;
|
|
340
|
+
/**
|
|
341
|
+
* Pan to a fixed x/y
|
|
342
|
+
*
|
|
343
|
+
*/
|
|
344
|
+
panTo(x: number, y: number): void;
|
|
345
|
+
/**
|
|
346
|
+
* Zoom by a factor
|
|
347
|
+
*
|
|
348
|
+
*/
|
|
349
|
+
zoom(factor: number): void;
|
|
350
|
+
/**
|
|
351
|
+
* Zoom to a fixed level
|
|
352
|
+
*
|
|
353
|
+
*/
|
|
354
|
+
zoomTo(level: number): void;
|
|
355
|
+
/**
|
|
356
|
+
* Drag was invoked from an event
|
|
357
|
+
*
|
|
358
|
+
* @memberOf GraphComponent
|
|
359
|
+
*/
|
|
360
|
+
onDrag(event: MouseEvent): void;
|
|
361
|
+
redrawEdge(edge: Edge): void;
|
|
362
|
+
/**
|
|
363
|
+
* Update the entire view for the new pan position
|
|
364
|
+
*
|
|
365
|
+
*
|
|
366
|
+
* @memberOf GraphComponent
|
|
367
|
+
*/
|
|
368
|
+
updateTransform(): void;
|
|
369
|
+
/**
|
|
370
|
+
* Node was clicked
|
|
371
|
+
*
|
|
372
|
+
*
|
|
373
|
+
* @memberOf GraphComponent
|
|
374
|
+
*/
|
|
375
|
+
onClick(event: any): void;
|
|
376
|
+
/**
|
|
377
|
+
* Node was focused
|
|
378
|
+
*
|
|
379
|
+
*
|
|
380
|
+
* @memberOf GraphComponent
|
|
381
|
+
*/
|
|
382
|
+
onActivate(event: any): void;
|
|
383
|
+
/**
|
|
384
|
+
* Node was defocused
|
|
385
|
+
*
|
|
386
|
+
* @memberOf GraphComponent
|
|
387
|
+
*/
|
|
388
|
+
onDeactivate(event: any): void;
|
|
389
|
+
/**
|
|
390
|
+
* Get the domain series for the nodes
|
|
391
|
+
*
|
|
392
|
+
* @memberOf GraphComponent
|
|
393
|
+
*/
|
|
394
|
+
getSeriesDomain(): any[];
|
|
395
|
+
/**
|
|
396
|
+
* Tracking for the link
|
|
397
|
+
*
|
|
398
|
+
*
|
|
399
|
+
* @memberOf GraphComponent
|
|
400
|
+
*/
|
|
401
|
+
trackLinkBy(index: number, link: Edge): any;
|
|
402
|
+
/**
|
|
403
|
+
* Tracking for the node
|
|
404
|
+
*
|
|
405
|
+
*
|
|
406
|
+
* @memberOf GraphComponent
|
|
407
|
+
*/
|
|
408
|
+
trackNodeBy(index: number, node: Node): any;
|
|
409
|
+
/**
|
|
410
|
+
* Sets the colors the nodes
|
|
411
|
+
*
|
|
412
|
+
*
|
|
413
|
+
* @memberOf GraphComponent
|
|
414
|
+
*/
|
|
415
|
+
setColors(): void;
|
|
416
|
+
/**
|
|
417
|
+
* On mouse move event, used for panning and dragging.
|
|
418
|
+
*
|
|
419
|
+
* @memberOf GraphComponent
|
|
420
|
+
*/
|
|
421
|
+
onMouseMove($event: MouseEvent): void;
|
|
422
|
+
onMouseDown(event: MouseEvent): void;
|
|
423
|
+
graphClick(event: MouseEvent): void;
|
|
424
|
+
/**
|
|
425
|
+
* On touch start event to enable panning.
|
|
426
|
+
*
|
|
427
|
+
* @memberOf GraphComponent
|
|
428
|
+
*/
|
|
429
|
+
onTouchStart(event: any): void;
|
|
430
|
+
/**
|
|
431
|
+
* On touch move event, used for panning.
|
|
432
|
+
*
|
|
433
|
+
*/
|
|
434
|
+
onTouchMove($event: any): void;
|
|
435
|
+
/**
|
|
436
|
+
* On touch end event to disable panning.
|
|
437
|
+
*
|
|
438
|
+
* @memberOf GraphComponent
|
|
439
|
+
*/
|
|
440
|
+
onTouchEnd(): void;
|
|
441
|
+
/**
|
|
442
|
+
* On mouse up event to disable panning/dragging.
|
|
443
|
+
*
|
|
444
|
+
* @memberOf GraphComponent
|
|
445
|
+
*/
|
|
446
|
+
onMouseUp(event: MouseEvent): void;
|
|
447
|
+
/**
|
|
448
|
+
* On node mouse down to kick off dragging
|
|
449
|
+
*
|
|
450
|
+
* @memberOf GraphComponent
|
|
451
|
+
*/
|
|
452
|
+
onNodeMouseDown(event: MouseEvent, node: any): void;
|
|
453
|
+
/**
|
|
454
|
+
* On minimap drag mouse down to kick off minimap panning
|
|
455
|
+
*
|
|
456
|
+
* @memberOf GraphComponent
|
|
457
|
+
*/
|
|
458
|
+
onMinimapDragMouseDown(): void;
|
|
459
|
+
/**
|
|
460
|
+
* On minimap pan event. Pans the graph to the clicked position
|
|
461
|
+
*
|
|
462
|
+
* @memberOf GraphComponent
|
|
463
|
+
*/
|
|
464
|
+
onMinimapPanTo(event: MouseEvent): void;
|
|
465
|
+
/**
|
|
466
|
+
* Center the graph in the viewport
|
|
467
|
+
*/
|
|
468
|
+
center(): void;
|
|
469
|
+
/**
|
|
470
|
+
* Zooms to fit the entire graph
|
|
471
|
+
*/
|
|
472
|
+
zoomToFit(zoomOptions?: NgxGraphZoomOptions): void;
|
|
473
|
+
/**
|
|
474
|
+
* Pans to the node
|
|
475
|
+
* @param nodeId
|
|
476
|
+
*/
|
|
477
|
+
panToNodeId(nodeId: string): void;
|
|
478
|
+
getCompoundNodeChildren(ids: Array<string>): Node[];
|
|
479
|
+
private panWithConstraints;
|
|
480
|
+
private updateMidpointOnEdge;
|
|
481
|
+
private _calcMidPointElk;
|
|
482
|
+
basicUpdate(): void;
|
|
483
|
+
getContainerDims(): any;
|
|
484
|
+
/**
|
|
485
|
+
* Checks if the graph has dimensions
|
|
486
|
+
*/
|
|
487
|
+
hasGraphDims(): boolean;
|
|
488
|
+
/**
|
|
489
|
+
* Checks if all nodes have dimension
|
|
490
|
+
*/
|
|
491
|
+
hasNodeDims(): boolean;
|
|
492
|
+
/**
|
|
493
|
+
* Checks if all compound nodes have dimension
|
|
494
|
+
*/
|
|
495
|
+
hasCompoundNodeDims(): boolean;
|
|
496
|
+
/**
|
|
497
|
+
* Checks if all clusters have dimension
|
|
498
|
+
*/
|
|
499
|
+
hasClusterDims(): boolean;
|
|
500
|
+
/**
|
|
501
|
+
* Checks if the graph and all nodes have dimension.
|
|
502
|
+
*/
|
|
503
|
+
hasDims(): boolean;
|
|
504
|
+
protected unbindEvents(): void;
|
|
505
|
+
private bindWindowResizeEvent;
|
|
506
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GraphComponent, never>;
|
|
507
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GraphComponent, "ngx-graph", never, { "nodes": { "alias": "nodes"; "required": false; }; "clusters": { "alias": "clusters"; "required": false; }; "compoundNodes": { "alias": "compoundNodes"; "required": false; }; "links": { "alias": "links"; "required": false; }; "activeEntries": { "alias": "activeEntries"; "required": false; }; "curve": { "alias": "curve"; "required": false; }; "draggingEnabled": { "alias": "draggingEnabled"; "required": false; }; "nodeHeight": { "alias": "nodeHeight"; "required": false; }; "nodeMaxHeight": { "alias": "nodeMaxHeight"; "required": false; }; "nodeMinHeight": { "alias": "nodeMinHeight"; "required": false; }; "nodeWidth": { "alias": "nodeWidth"; "required": false; }; "nodeMinWidth": { "alias": "nodeMinWidth"; "required": false; }; "nodeMaxWidth": { "alias": "nodeMaxWidth"; "required": false; }; "panningEnabled": { "alias": "panningEnabled"; "required": false; }; "panningAxis": { "alias": "panningAxis"; "required": false; }; "enableZoom": { "alias": "enableZoom"; "required": false; }; "zoomSpeed": { "alias": "zoomSpeed"; "required": false; }; "minZoomLevel": { "alias": "minZoomLevel"; "required": false; }; "maxZoomLevel": { "alias": "maxZoomLevel"; "required": false; }; "autoZoom": { "alias": "autoZoom"; "required": false; }; "panOnZoom": { "alias": "panOnZoom"; "required": false; }; "animate": { "alias": "animate"; "required": false; }; "autoCenter": { "alias": "autoCenter"; "required": false; }; "update$": { "alias": "update$"; "required": false; }; "center$": { "alias": "center$"; "required": false; }; "zoomToFit$": { "alias": "zoomToFit$"; "required": false; }; "panToNode$": { "alias": "panToNode$"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "layoutSettings": { "alias": "layoutSettings"; "required": false; }; "enableTrackpadSupport": { "alias": "enableTrackpadSupport"; "required": false; }; "showMiniMap": { "alias": "showMiniMap"; "required": false; }; "miniMapMaxWidth": { "alias": "miniMapMaxWidth"; "required": false; }; "miniMapMaxHeight": { "alias": "miniMapMaxHeight"; "required": false; }; "miniMapPosition": { "alias": "miniMapPosition"; "required": false; }; "view": { "alias": "view"; "required": false; }; "scheme": { "alias": "scheme"; "required": false; }; "customColors": { "alias": "customColors"; "required": false; }; "deferDisplayUntilPosition": { "alias": "deferDisplayUntilPosition"; "required": false; }; "centerNodesOnPositionChange": { "alias": "centerNodesOnPositionChange"; "required": false; }; "enablePreUpdateTransform": { "alias": "enablePreUpdateTransform"; "required": false; }; "groupResultsBy": { "alias": "groupResultsBy"; "required": false; }; "zoomLevel": { "alias": "zoomLevel"; "required": false; }; "panOffsetX": { "alias": "panOffsetX"; "required": false; }; "panOffsetY": { "alias": "panOffsetY"; "required": false; }; }, { "select": "select"; "activate": "activate"; "deactivate": "deactivate"; "zoomChange": "zoomChange"; "clickHandler": "clickHandler"; "stateChange": "stateChange"; }, ["linkTemplate", "nodeTemplate", "clusterTemplate", "defsTemplate", "miniMapNodeTemplate"], ["*"], false, never>;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Mousewheel directive
|
|
512
|
+
* https://github.com/SodhanaLibrary/angular2-examples/blob/master/app/mouseWheelDirective/mousewheel.directive.ts
|
|
513
|
+
*
|
|
514
|
+
* @export
|
|
515
|
+
*/
|
|
516
|
+
declare class MouseWheelDirective {
|
|
517
|
+
mouseWheelUp: EventEmitter<any>;
|
|
518
|
+
mouseWheelDown: EventEmitter<any>;
|
|
519
|
+
onMouseWheelChrome(event: any): void;
|
|
520
|
+
onMouseWheelFirefox(event: any): void;
|
|
521
|
+
onWheel(event: any): void;
|
|
522
|
+
onMouseWheelIE(event: any): void;
|
|
523
|
+
mouseWheelFunc(event: any): void;
|
|
524
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MouseWheelDirective, never>;
|
|
525
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MouseWheelDirective, "[mouseWheel]", never, {}, { "mouseWheelUp": "mouseWheelUp"; "mouseWheelDown": "mouseWheelDown"; }, never, never, false, never>;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
declare class GraphModule {
|
|
529
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GraphModule, never>;
|
|
530
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<GraphModule, [typeof GraphComponent, typeof MouseWheelDirective, typeof VisibilityObserver], [typeof i4.CommonModule], [typeof GraphComponent, typeof MouseWheelDirective]>;
|
|
531
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<GraphModule>;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
declare class NgxGraphModule {
|
|
535
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxGraphModule, never>;
|
|
536
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxGraphModule, never, [typeof i4.CommonModule], [typeof GraphModule]>;
|
|
537
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgxGraphModule>;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
interface ColaForceDirectedSettings {
|
|
541
|
+
force?: Layout$1 & ID3StyleLayoutAdaptor;
|
|
542
|
+
forceModifierFn?: (force: Layout$1 & ID3StyleLayoutAdaptor) => Layout$1 & ID3StyleLayoutAdaptor;
|
|
543
|
+
onTickListener?: (internalGraph: ColaGraph) => void;
|
|
544
|
+
viewDimensions?: ViewDimensions;
|
|
545
|
+
}
|
|
546
|
+
interface ColaGraph {
|
|
547
|
+
groups: Group[];
|
|
548
|
+
nodes: InputNode[];
|
|
549
|
+
links: Array<Link<number>>;
|
|
550
|
+
}
|
|
551
|
+
declare function toNode(nodes: InputNode[], nodeRef: InputNode | number): InputNode;
|
|
552
|
+
declare class ColaForceDirectedLayout implements Layout {
|
|
553
|
+
defaultSettings: ColaForceDirectedSettings;
|
|
554
|
+
settings: ColaForceDirectedSettings;
|
|
555
|
+
inputGraph: Graph;
|
|
556
|
+
outputGraph: Graph;
|
|
557
|
+
internalGraph: ColaGraph & {
|
|
558
|
+
groupLinks?: Edge[];
|
|
559
|
+
};
|
|
560
|
+
outputGraph$: Subject<Graph>;
|
|
561
|
+
draggingStart: {
|
|
562
|
+
x: number;
|
|
563
|
+
y: number;
|
|
564
|
+
};
|
|
565
|
+
run(graph: Graph): Observable<Graph>;
|
|
566
|
+
updateEdge(graph: Graph, edge: Edge): Observable<Graph>;
|
|
567
|
+
internalGraphToOutputGraph(internalGraph: any): Graph;
|
|
568
|
+
onDragStart(draggingNode: Node, $event: MouseEvent): void;
|
|
569
|
+
onDrag(draggingNode: Node, $event: MouseEvent): void;
|
|
570
|
+
onDragEnd(draggingNode: Node, $event: MouseEvent): void;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
interface D3ForceDirectedSettings {
|
|
574
|
+
force?: any;
|
|
575
|
+
forceLink?: any;
|
|
576
|
+
}
|
|
577
|
+
interface D3Node {
|
|
578
|
+
id?: string;
|
|
579
|
+
x: number;
|
|
580
|
+
y: number;
|
|
581
|
+
width?: number;
|
|
582
|
+
height?: number;
|
|
583
|
+
fx?: number;
|
|
584
|
+
fy?: number;
|
|
585
|
+
}
|
|
586
|
+
interface D3Edge {
|
|
587
|
+
source: string | D3Node;
|
|
588
|
+
target: string | D3Node;
|
|
589
|
+
midPoint: NodePosition;
|
|
590
|
+
}
|
|
591
|
+
interface D3Graph {
|
|
592
|
+
nodes: D3Node[];
|
|
593
|
+
edges: D3Edge[];
|
|
594
|
+
}
|
|
595
|
+
interface MergedNode extends D3Node, Node {
|
|
596
|
+
id: string;
|
|
597
|
+
}
|
|
598
|
+
declare function toD3Node(maybeNode: string | D3Node): D3Node;
|
|
599
|
+
declare class D3ForceDirectedLayout implements Layout {
|
|
600
|
+
defaultSettings: D3ForceDirectedSettings;
|
|
601
|
+
settings: D3ForceDirectedSettings;
|
|
602
|
+
inputGraph: Graph;
|
|
603
|
+
outputGraph: Graph;
|
|
604
|
+
d3Graph: D3Graph;
|
|
605
|
+
outputGraph$: Subject<Graph>;
|
|
606
|
+
draggingStart: {
|
|
607
|
+
x: number;
|
|
608
|
+
y: number;
|
|
609
|
+
};
|
|
610
|
+
run(graph: Graph): Observable<Graph>;
|
|
611
|
+
updateEdge(graph: Graph, edge: Edge): Observable<Graph>;
|
|
612
|
+
d3GraphToOutputGraph(d3Graph: D3Graph): Graph;
|
|
613
|
+
onDragStart(draggingNode: Node, $event: MouseEvent): void;
|
|
614
|
+
onDrag(draggingNode: Node, $event: MouseEvent): void;
|
|
615
|
+
onDragEnd(draggingNode: Node, $event: MouseEvent): void;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
declare enum Orientation {
|
|
619
|
+
LEFT_TO_RIGHT = "LR",
|
|
620
|
+
RIGHT_TO_LEFT = "RL",
|
|
621
|
+
TOP_TO_BOTTOM = "TB",
|
|
622
|
+
BOTTOM_TO_TOM = "BT"
|
|
623
|
+
}
|
|
624
|
+
declare enum Alignment {
|
|
625
|
+
CENTER = "C",
|
|
626
|
+
UP_LEFT = "UL",
|
|
627
|
+
UP_RIGHT = "UR",
|
|
628
|
+
DOWN_LEFT = "DL",
|
|
629
|
+
DOWN_RIGHT = "DR"
|
|
630
|
+
}
|
|
631
|
+
interface DagreSettings {
|
|
632
|
+
orientation?: Orientation;
|
|
633
|
+
marginX?: number;
|
|
634
|
+
marginY?: number;
|
|
635
|
+
edgePadding?: number;
|
|
636
|
+
rankPadding?: number;
|
|
637
|
+
nodePadding?: number;
|
|
638
|
+
align?: Alignment;
|
|
639
|
+
acyclicer?: 'greedy' | undefined;
|
|
640
|
+
ranker?: 'network-simplex' | 'tight-tree' | 'longest-path';
|
|
641
|
+
multigraph?: boolean;
|
|
642
|
+
compound?: boolean;
|
|
643
|
+
}
|
|
644
|
+
declare class DagreLayout implements Layout {
|
|
645
|
+
defaultSettings: DagreSettings;
|
|
646
|
+
settings: DagreSettings;
|
|
647
|
+
dagreGraph: any;
|
|
648
|
+
dagreNodes: any;
|
|
649
|
+
dagreEdges: any;
|
|
650
|
+
run(graph: Graph): Graph;
|
|
651
|
+
updateEdge(graph: Graph, edge: Edge): Graph;
|
|
652
|
+
createDagreGraph(graph: Graph): any;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
declare class DagreClusterLayout implements Layout {
|
|
656
|
+
defaultSettings: DagreSettings;
|
|
657
|
+
settings: DagreSettings;
|
|
658
|
+
dagreGraph: any;
|
|
659
|
+
dagreNodes: Node[];
|
|
660
|
+
dagreClusters: ClusterNode[];
|
|
661
|
+
dagreEdges: any;
|
|
662
|
+
run(graph: Graph): Graph;
|
|
663
|
+
updateEdge(graph: Graph, edge: Edge): Graph;
|
|
664
|
+
createDagreGraph(graph: Graph): any;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
interface DagreNodesOnlySettings extends DagreSettings {
|
|
668
|
+
curveDistance?: number;
|
|
669
|
+
}
|
|
670
|
+
declare class DagreNodesOnlyLayout implements Layout {
|
|
671
|
+
defaultSettings: DagreNodesOnlySettings;
|
|
672
|
+
settings: DagreNodesOnlySettings;
|
|
673
|
+
dagreGraph: any;
|
|
674
|
+
dagreNodes: any;
|
|
675
|
+
dagreEdges: any;
|
|
676
|
+
run(graph: Graph): Graph;
|
|
677
|
+
updateEdge(graph: Graph, edge: Edge): Graph;
|
|
678
|
+
createDagreGraph(graph: Graph): any;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
export { Alignment, ColaForceDirectedLayout, D3ForceDirectedLayout, DagreClusterLayout, DagreLayout, DagreNodesOnlyLayout, GraphComponent, GraphModule, LayoutService, MiniMapPosition, MouseWheelDirective, NgxGraphModule, NgxGraphStates, Orientation, PanningAxis, toD3Node, toNode };
|
|
682
|
+
export type { ClusterNode, ColaForceDirectedSettings, ColaGraph, CompoundNode, D3Edge, D3ForceDirectedSettings, D3Graph, D3Node, DagreNodesOnlySettings, DagreSettings, Edge, Graph, Layout, Matrix, MergedNode, NgxGraphStateChangeEvent, NgxGraphZoomOptions, Node, NodeDimension, NodePosition };
|