graph-zoom.directive.d.ts 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * Use of this source code is governed by an MIT-style license that can be
  3. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  4. */
  5. import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy } from '@angular/core';
  6. import { Selection } from 'd3-selection';
  7. import { ZoomBehavior } from 'd3-zoom';
  8. import { NzSafeAny } from 'ng-zorro-antd/core/types';
  9. import { NzZoomTransform } from './interface';
  10. import * as i0 from "@angular/core";
  11. export declare class NzGraphZoomDirective implements OnDestroy, AfterViewInit {
  12. private element;
  13. private cdr;
  14. nzZoom?: number;
  15. nzMinZoom: number;
  16. nzMaxZoom: number;
  17. readonly nzTransformEvent: EventEmitter<NzZoomTransform>;
  18. readonly nzZoomChange: EventEmitter<number>;
  19. svgSelection: Selection<NzSafeAny, NzSafeAny, NzSafeAny, NzSafeAny>;
  20. zoomBehavior: ZoomBehavior<NzSafeAny, NzSafeAny>;
  21. svgElement: SVGSVGElement;
  22. gZoomElement: SVGGElement;
  23. private destroy$;
  24. constructor(element: ElementRef, cdr: ChangeDetectorRef);
  25. ngAfterViewInit(): void;
  26. ngOnDestroy(): void;
  27. bind(): void;
  28. unbind(): void;
  29. fitCenter(duration?: number): void;
  30. focus(id: NzSafeAny, duration?: number): void;
  31. /**
  32. * Handle zoom event
  33. *
  34. * @param transform
  35. */
  36. private zoomed;
  37. /**
  38. * Scale with zoom and duration
  39. *
  40. * @param duration
  41. * @param scale
  42. * @private
  43. */
  44. private reScale;
  45. private getRelativePositionInfo;
  46. static ɵfac: i0.ɵɵFactoryDeclaration<NzGraphZoomDirective, never>;
  47. static ɵdir: i0.ɵɵDirectiveDeclaration<NzGraphZoomDirective, "[nz-graph-zoom]", ["nzGraphZoom"], { "nzZoom": { "alias": "nzZoom"; "required": false; }; "nzMinZoom": { "alias": "nzMinZoom"; "required": false; }; "nzMaxZoom": { "alias": "nzMaxZoom"; "required": false; }; }, { "nzTransformEvent": "nzTransformEvent"; "nzZoomChange": "nzZoomChange"; }, never, never, true, never>;
  48. static ngAcceptInputType_nzZoom: unknown;
  49. }