import {Component, ElementRef, OnInit, ViewChild} from '@angular/core';
declare var vis:any;

@Component({
  selector: 'smart-flow-trend',
  templateUrl: './flow-trend.component.html',
  styles: []
})
export class FlowTrendComponent implements OnInit {
   @ViewChild('siteConfigNetwork') networkContainer:ElementRef;
    @ViewChild("pop") popOver: any;
    public network: any;

  constructor() { }

  ngOnInit() {

      const treeData = this.getTreeData();
      this.loadVisTree(treeData);
  }

    loadVisTree(treedata) {

    }

    getTreeData(){
        const nodes =[
            {id: 1, label: 'Node 1', title: 'I am node 1!'},
            {id: 2, label: 'Node 2', title: 'I am node 2!'},
            {id: 3, label: 'Node 3'},
            {id: 4, label: 'Node 4'},
            {id: 5, label: 'Node 5'}
        ];

        const edges = [
            {from: 1, to: 3},
            {from: 1, to: 2},
            {from: 2, to: 4},
            {from: 2, to: 5}
        ];
        const treeData = {
            nodes: nodes,
            edges: edges
        };
        return treeData;
    }

}
