Reviewers: mp+130005_code.launchpad.net,

Message:
Please take a look.

Description:
Service health graphs consistently rendered

d3 was sorting by the largest value, now sorts in the proper order:
error - pending - running

https://code.launchpad.net/~makyo/juju-gui/consistent-health-graph/+merge/130005

(do not edit description out of merge proposal)


Please review this at https://codereview.appspot.com/6718048/

Affected files:
   A [revision details]
   M app/views/environment.js


Index: [revision details]
=== added file '[revision details]'
--- [revision details]  2012-01-01 00:00:00 +0000
+++ [revision details]  2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: [email protected]
+New revision: [email protected]

Index: app/views/environment.js
=== modified file 'app/views/environment.js'
--- app/views/environment.js    2012-10-15 19:22:40 +0000
+++ app/views/environment.js    2012-10-16 23:01:10 +0000
@@ -775,7 +775,13 @@
                });

            var status_chart_layout = d3.layout.pie()
-            .value(function(d) { return (d.value ? d.value : 1); });
+            .value(function(d) { return (d.value ? d.value : 1); })
+            .sort(function(a, b) {
+                // Ensure that the service health graphs will be renders in
+                // the correct order: error - pending - running.
+                var states = {error: 0, pending: 1, running: 2};
+                return states[a.name] - states[b.name];
+              });

            // Append to status charts to non-subordinate services
            var status_chart = node.append('g')





-- 
https://code.launchpad.net/~makyo/juju-gui/consistent-health-graph/+merge/130005
Your team Juju GUI Hackers is requested to review the proposed merge of 
lp:~makyo/juju-gui/consistent-health-graph into lp:juju-gui.

-- 
Mailing list: https://launchpad.net/~yellow
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yellow
More help   : https://help.launchpad.net/ListHelp

Reply via email to