Moved graph reducer from graph store to graph components

Change-Id: If0e14068d350a823758d702b0dd0de315351a37d
diff --git a/src/app/service-graph/components/fine-grained/fine-grained.component.ts b/src/app/service-graph/components/fine-grained/fine-grained.component.ts
index 0fbf411..64955ae 100644
--- a/src/app/service-graph/components/fine-grained/fine-grained.component.ts
+++ b/src/app/service-graph/components/fine-grained/fine-grained.component.ts
@@ -2,6 +2,7 @@
 import './fine-grained.component.scss';
 import * as d3 from 'd3';
 import * as $ from 'jquery';
+import * as _ from 'lodash';
 import {Subscription} from 'rxjs';
 import {XosServiceGraphConfig as config} from '../../graph.config';
 import {IXosDebouncer} from '../../../core/services/helpers/debounce.helper';
@@ -9,6 +10,7 @@
 import {IXosModelDiscovererService} from '../../../datasources/helpers/model-discoverer.service';
 import {IXosSidePanelService} from '../../../core/side-panel/side-panel.service';
 import {IXosGraphHelpers} from '../../services/d3-helpers/graph.helpers';
+import {IXosServiceGraphExtender, IXosServiceGraphReducer} from '../../services/graph.extender';
 
 class XosFineGrainedTenancyGraphCtrl {
   static $inject = [
@@ -17,7 +19,8 @@
     'XosDebouncer',
     'XosModelDiscoverer',
     'XosSidePanel',
-    'XosGraphHelpers'
+    'XosGraphHelpers',
+    'XosServiceGraphExtender'
   ];
 
   public graph: IXosServiceGraph;
@@ -40,12 +43,13 @@
     private XosDebouncer: IXosDebouncer,
     private XosModelDiscoverer: IXosModelDiscovererService,
     private XosSidePanel: IXosSidePanelService,
-    private XosGraphHelpers: IXosGraphHelpers
+    private XosGraphHelpers: IXosGraphHelpers,
+    private XosServiceGraphExtender: IXosServiceGraphExtender
   ) {
     this.handleSvg();
     this.loadDefs();
     this.setupForceLayout();
-    this.renderGraph = this.XosDebouncer.debounce(this._renderGraph, 500, this);
+    this.renderGraph = this.XosDebouncer.debounce(this._renderGraph, 1000, this);
 
     $(window).on('resize', () => {
       this.setupForceLayout();
@@ -61,6 +65,10 @@
             return;
           }
 
+          _.forEach(this.XosServiceGraphExtender.getFinegrained(), (r: IXosServiceGraphReducer) => {
+            graph = r.reducer(graph);
+          });
+
           this.graph = graph;
           this.renderGraph();
         },