/** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ import { AfterContentChecked, AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, QueryList, SimpleChanges, TemplateRef } from '@angular/core'; import { ReplaySubject } from 'rxjs'; import { VtsNoAnimationDirective } from '@ui-vts-kit/ng-vts/core/no-animation'; import { BooleanInput, VtsSafeAny } from '@ui-vts-kit/ng-vts/core/types'; import { VtsGraphData } from './data-source/graph-data-source'; import { VtsGraphNodeComponent } from './graph-node.component'; import { VtsGraphZoomDirective } from './graph-zoom.directive'; import { VtsGraphDataDef, VtsGraphEdge, VtsGraphEdgeDef, VtsGraphGroupNode, VtsGraphLayoutConfig, VtsGraphNode, VtsGraphNodeDef, VtsGraphOption, VtsRankDirection } from './interface'; import * as i0 from "@angular/core"; /** Checks whether an object is a data source. */ export declare function isDataSource(value: VtsSafeAny): value is VtsGraphData; export declare class VtsGraphComponent implements OnInit, OnChanges, AfterViewInit, AfterContentChecked, OnDestroy { private cdr; private elementRef; noAnimation?: VtsNoAnimationDirective; vtsGraphZoom?: VtsGraphZoomDirective; static ngAcceptInputType_vtsAutoSize: BooleanInput; listOfNodeElement: QueryList; listOfNodeComponent: QueryList; nodeTemplate?: TemplateRef<{ $implicit: VtsGraphNode; }>; groupNodeTemplate?: TemplateRef<{ $implicit: VtsGraphGroupNode; }>; customGraphEdgeTemplate?: TemplateRef<{ $implicit: VtsGraphEdge; }>; /** * Provides a stream containing the latest data array to render. * Data source can be an observable of VtsGraphData, or a VtsGraphData to render. */ vtsGraphData: VtsGraphData; vtsRankDirection: VtsRankDirection; vtsGraphLayoutConfig?: VtsGraphLayoutConfig; vtsAutoSize: boolean; readonly vtsGraphInitialized: EventEmitter; readonly vtsGraphRendered: EventEmitter; readonly vtsNodeClick: EventEmitter; requestId: number; transformStyle: string; graphRenderedSubject$: ReplaySubject; renderInfo: VtsGraphGroupNode; mapOfNodeAttr: { [key: string]: VtsGraphNodeDef; }; mapOfEdgeAttr: { [key: string]: VtsGraphEdgeDef; }; zoom: number; readonly typedNodes: (item: unknown) => (VtsGraphGroupNode | VtsGraphNode)[]; private dataSource?; private layoutSetting; /** Data subscription */ private _dataSubscription?; private destroy$; nodeTrackByFun: (_: number, node: VtsGraphNode | VtsGraphGroupNode) => any; edgeTrackByFun: (_: number, edge: VtsGraphEdge) => string; subGraphTransform: (node: VtsGraphGroupNode) => string; coreTransform: (node: VtsGraphGroupNode) => string; constructor(cdr: ChangeDetectorRef, elementRef: ElementRef, noAnimation?: VtsNoAnimationDirective, vtsGraphZoom?: VtsGraphZoomDirective); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngAfterViewInit(): void; ngAfterContentChecked(): void; ngOnDestroy(): void; /** * Emit event */ clickNode(node: VtsGraphNode | VtsGraphGroupNode): void; /** * Move graph to center and scale automatically */ fitCenter(): void; /** * re-Draw graph * @param data * @param options * @param needResize */ drawGraph(data: VtsGraphDataDef, options: VtsGraphOption, needResize?: boolean): Promise; /** * Redraw all nodes * @param animate */ drawNodes(animate?: boolean): Promise; private resizeNodeSize; /** * Switch to the provided data source by resetting the data and unsubscribing from the current * render change subscription if one exists. If the data source is null, interpret this by * clearing the node outlet. Otherwise start listening for new data. */ private _switchDataSource; /** Set up a subscription for the data provided by the data source. */ private observeRenderChanges; /** * Get renderInfo and prepare some data * @param data * @param options * @private */ private buildGraphInfo; /** * Play with animation * @private */ private makeNodesAnimation; private parseInfo; /** * Merge config with user inputs * @param config * @private */ private mergeConfig; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }