Skip to content

Commit eaea00d

Browse files
committed
Merge remote-tracking branch 'origin/master' into pypy
2 parents 55030e2 + 59efc53 commit eaea00d

File tree

3 files changed

+37
-25
lines changed

3 files changed

+37
-25
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
*.pyc
22
*.db
3-
speedcenter/repos
3+
example/repos/*
44
override

codespeed/static/css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ div.about_content { text-align: left; }
219219
.boxbody ul {
220220
list-style: none;
221221
margin: 0;
222-
padding: 0.2em;
222+
padding: 0 0 0.2em;
223223
margin-bottom: 0.5em;
224224
}
225225
.boxbody ul li { padding-left: 0.3em; }

codespeed/templates/codespeed/timeline.html

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,40 @@
1414
<script type="text/javascript" src="{{ STATIC_URL }}js/jqplot/jqplot.canvasAxisLabelRenderer.min.js"></script>
1515

1616
<script type="text/javascript">
17-
var baselineColor = "#d8b83f";
18-
var seriesColors = ["#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#ff5800", "#0085cc"];
1917
var seriesindex = new Array();
18+
var baselineColor = "#d8b83f";
19+
var seriesColors = ["#4bb2c5", "#EAA228", "#579575", "#953579", "#839557", "#ff5800", "#958c12", "#4b5de4", "#0085cc"];
20+
21+
function setExeColors() {
22+
// Set color data attribute for all executables
23+
$("#executable > div.boxbody > ul > ul > li > input").each(function(index) {
24+
var color_id = index;
25+
while (color_id > seriesColors.length) { color_id -= seriesColors.length; }
26+
$(this).data('color', seriesColors[color_id]);
27+
});
28+
}
29+
30+
function getColor(exe_id) {
31+
return $("#executable > div.boxbody")
32+
.find("input[value='"+exe_id+"']")
33+
.data('color');
34+
}
2035

2136
function shouldPlotEquidistant() {
22-
return $("#equidistant").is(':checked');
37+
return $("#equidistant").is(':checked');
2338
}
2439

2540
function getConfiguration() {
2641
var config = new Object();
27-
2842
config["exe"] = readCheckbox("input[name='executable']:checked");
2943
config["base"] = $("#baseline option:selected").val();
3044
config["ben"] = $("input[name='benchmark']:checked").val();
3145
config["env"] = $("input[name='environments']:checked").val();
3246
config["revs"] = $("#revisions option:selected").val();
33-
47+
3448
var branch = readCheckbox("input[name='branch']:checked");
3549
if (branch)
3650
config["bran"] = branch;
37-
3851
config["equid"] = $("#equidistant").is(':checked') ? "on" : "off";
3952
return config;
4053
}
@@ -47,6 +60,7 @@
4760
if($("input[name='benchmark']:checked").val() == "grid") { return false; }
4861
if (neighbor) {
4962
var commitid = neighbor.data[3];
63+
// Get executable ID from the seriesindex array
5064
var executableid = seriesindex[neighbor.seriesIndex];
5165
var environment = $("input[name='environments']:checked").val();
5266
permalinkToChanges(commitid, executableid, environment);
@@ -57,15 +71,13 @@
5771
var plotdata = new Array();
5872
var series = new Array();
5973
var lastvalues = new Array();//hopefully the smallest values for determining significant digits.
74+
seriesindex = new Array();
6075
for (branch in data["branches"]) {
6176
// NOTE: Currently, only the "default" branch is shown in the timeline
62-
seriesindex = new Array();
6377
for (exe_id in data["branches"][branch]) {
64-
var color_id = $("#executable > div.boxbody").find("input[value='"+exe_id+"']").attr('id').slice(10);
65-
while (color_id > seriesColors.length) { color_id -= seriesColors.length; }
66-
var label = $("label[for*='executable" + color_id + "']").html();
6778
if (branch != "default") { label += " - " + branch; }
68-
series.push({"label": label, "color": seriesColors[color_id-1]});
79+
var label = $("label[for*='executable" + exe_id + "']").html();
80+
series.push({"label": label, "color": getColor(exe_id)});
6981
seriesindex.push(exe_id);
7082
plotdata.push(data["branches"][branch][exe_id]);
7183
lastvalues.push(data["branches"][branch][exe_id][0][1]);
@@ -158,16 +170,14 @@
158170
function renderMiniplot(plotid, data) {
159171
var plotdata = new Array();
160172
for (branch in data['branches']) {
161-
var series = new Array();
162-
for (id in data['branches'][branch]) {
163-
var colorid = $("#executable > div.boxbody").find("input[value='"+id+"']").attr('id').slice(10);
164-
while (colorid > seriesColors.length) { colorid -= seriesColors.length;}
165-
series.push({
166-
"label": $("label[for*='executable" + colorid + "']").html(),
167-
"color": seriesColors[colorid-1]
168-
});
169-
plotdata.push(data['branches'][branch][id]);
170-
}
173+
var series = new Array();
174+
for (id in data['branches'][branch]) {
175+
series.push({
176+
"label": $("label[for*='executable" + id + "']").html(),
177+
"color": getColor(id)
178+
});
179+
plotdata.push(data['branches'][branch][id]);
180+
}
171181
}
172182
if (data["baseline"] != "None") {
173183
series.push({
@@ -306,8 +316,9 @@
306316

307317
//Add color legend to executable list
308318
$("#executable div.boxbody > ul > ul > li > input").each(function() {
309-
var colorid = $(this).attr("id").slice(10);
310-
$(this).parent().find("div.seriescolor").css("background-color", seriesColors[colorid-1]);
319+
$(this).parent()
320+
.find("div.seriescolor")
321+
.css("background-color", getColor($(this).attr("id").slice(10)));
311322
});
312323
$("#baselinecolor").css("background-color", baselineColor);
313324
$("#equidistant").attr('checked', valueOrDefault(event.parameters['equid'], '{{ defaultequid }}') == "on");
@@ -356,6 +367,7 @@
356367
refreshContent();
357368
return false;
358369
});
370+
setExeColors();
359371
});
360372
</script>
361373
{% endblock %}

0 commit comments

Comments
 (0)