Merge lp:~makyo/juju-gui/consistent-health-graph into lp:juju-gui/experimental
Proposed by
Madison Scott-Clary
Status: | Merged |
---|---|
Merged at revision: | 190 |
Proposed branch: | lp:~makyo/juju-gui/consistent-health-graph |
Merge into: | lp:juju-gui/experimental |
Diff against target: |
18 lines (+7/-1) 1 file modified
app/views/environment.js (+7/-1) |
To merge this branch: | bzr merge lp:~makyo/juju-gui/consistent-health-graph |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email: mp+130005@code.launchpad.net |
Description of the change
Service health graphs consistently rendered
d3 was sorting by the largest value, now sorts in the proper order: error - pending - running
To post a comment you must log in.
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: environment. js
A [revision details]
M app/views/
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 address hidden>
+New revision: <email address hidden>
Index: app/views/ environment. js environment. js' environment. js 2012-10-15 19:22:40 +0000 environment. js 2012-10-16 23:01:10 +0000
=== modified file 'app/views/
--- app/views/
+++ app/views/
@@ -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')