import { ElementRef, Input, OnInit } from '@angular/core'; import { Directive } from '@angular/core'; import { Node } from '@creedinteractive/onguard-models'; import { NetworkGraph } from '../../components/visualizations/network-graph/network-graph.model'; import { D3Service } from '../../services/d3.service'; @Directive({ selector: '[onguardDraggable]', }) export class DraggableDirective implements OnInit { @Input() onguardDraggable: Node; @Input() draggableInGraph: NetworkGraph; constructor(private d3Service: D3Service, private _element: ElementRef) {} ngOnInit(): void { this.d3Service.applyDraggableBehaviour( this._element.nativeElement, this.onguardDraggable, this.draggableInGraph, ); } }