From c231e9864d7083853fc57e8e85ac4e837239d66b Mon Sep 17 00:00:00 2001
From: Mathis Neumann <mathis@simpletechs.net>
Date: Tue, 21 Jun 2016 13:10:25 +0200
Subject: [PATCH] disable broken cose-bilkent, small refactorings

---
 app/components/architecture-viewer.js                      | 2 +-
 .../architecture-visualisation-cytoscape/component.js      | 7 ++++---
 app/services/graphing-service.js                           | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/app/components/architecture-viewer.js b/app/components/architecture-viewer.js
index acc7b12..be2f110 100644
--- a/app/components/architecture-viewer.js
+++ b/app/components/architecture-viewer.js
@@ -10,7 +10,7 @@ export default Ember.Component.extend({
     themes: Object.keys(Themes),
     layoutAlgorithms: [
         'cose',
-        'cose-bilkent', // broken
+        //'cose-bilkent', // broken - see https://github.com/cytoscape/cytoscape.js-cose-bilkent/issues/18
         'cola',
         'grid',
         'concentric',
diff --git a/app/components/architecture-visualisation-cytoscape/component.js b/app/components/architecture-visualisation-cytoscape/component.js
index 199c423..86f6755 100644
--- a/app/components/architecture-visualisation-cytoscape/component.js
+++ b/app/components/architecture-visualisation-cytoscape/component.js
@@ -25,7 +25,7 @@ export default Ember.Component.extend({
     }.observes('layout'),
     renderGraph: function() {
         this.debug('graph',this.get('theme'), this.get('graph'));
-        this.cytoscape = cytoscape({
+        this.rendering = cytoscape({
           container: this.element,
 
           boxSelectionEnabled: false,
@@ -33,7 +33,7 @@ export default Ember.Component.extend({
 
           style: cytoscapeStyle(this.get('theme')),
 
-          elements: _.cloneDeep(this.get('graph')), // TODO!
+          elements: _.cloneDeep(this.get('graph')),
 
           layout: {
             name: this.get('layoutAlgorithm'),
@@ -44,7 +44,8 @@ export default Ember.Component.extend({
           }
         });
 
+        // just for development purposes - TODO: remove
         window.cy = cytoscape;
-        window.cytoscape = this.cytoscape;
+        window.cytoscape = this.rendering;
     }.on('didInsertElement').observes('layoutAlgorithm', 'graph', 'theme')
 });
diff --git a/app/services/graphing-service.js b/app/services/graphing-service.js
index 5983992..0b42236 100644
--- a/app/services/graphing-service.js
+++ b/app/services/graphing-service.js
@@ -7,7 +7,7 @@ export default Ember.Service.extend({
   createGraph(models) {
     this.debug('loaded models', models);
     const serviceInstances = models.serviceInstances;
-    const services = models.services;
+    // const services = models.services; // not used in current view
     const communicationInstances = models.communicationInstances;
     const nodeGroups = models.nodeGroups;
     const nodes = models.nodes;
-- 
GitLab