Fix timeline worker sorting
In the nested 'data' array, nested lists of tests should be sorted by their worker key. However, the 'd3.ascending' comparator sorts by string rather than numerically, resulting in the array being out of order with more than 10 workers. This caused item selection (but not hovering) to break after the second row. This patch replaces the built-in comparator ('d3.ascending') with a comparator that uses parseInt() to make sure the nested lists are in the correct order for fast lookups. Change-Id: Idbd94369fb35f4cf03c39b0c9fa2cc07623885ab
This commit is contained in:
parent
4f441cd27c
commit
e6037d640a
@ -362,7 +362,9 @@ function timeline($window, $log, datasetService, progressService) {
|
||||
|
||||
self.data = d3Collection.nest()
|
||||
.key(function(d) { return d.worker; })
|
||||
.sortKeys(d3Array.ascending)
|
||||
.sortKeys(function(a, b) {
|
||||
return parseInt(a, 10) - parseInt(b, 10);
|
||||
})
|
||||
.entries(raw.filter(function(d) { return d.duration > 0; }));
|
||||
|
||||
self.axes.x.domain(self.timeExtents);
|
||||
|
Loading…
Reference in New Issue
Block a user