Skip to content

Commit 2ca4cc3

Browse files
tracevis: table view shows time deltas and absolute times
1 parent 81602a3 commit 2ca4cc3

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

tools/tracevis/js/table.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ var TABLE = (function() {
2525
var table = selection.append("table").attr("class", "table table-bordered");
2626
var thead = table.append("thead");
2727
thead.append("th").text("Name");
28-
thead.append("th").html("Start<br>(ms)");
29-
thead.append("th").html("Run<br>(ms)");
30-
thead.append("th").html("Total<br>(ms)");
31-
thead.append("th").html("End<br>(ms)");
28+
thead.append("th").html("Start (ms)");
29+
thead.append("th").html("Run (ms)");
30+
thead.append("th").html("Total (ms)");
3231
thead.append("th").text("Result");
3332
thead.append("th").text("Value");
3433
return table;
@@ -66,19 +65,24 @@ var TABLE = (function() {
6665

6766
rowsEnter.append("td")
6867
.classed("numeric", true)
69-
.text(function(d) { return TRACE.alignMillis(d.startMillis); });
68+
.html(function(d) { return "<br/>" + TRACE.alignMillis(d.startMillis); });
7069

7170
rowsEnter.append("td")
7271
.classed("numeric", true)
73-
.text(function(d) { return 'runMillis' in d ? TRACE.alignMillis(d.runMillis) : '?'; });
72+
.html(function(d) {
73+
if ('runMillis' in d) {
74+
return "+" + TRACE.alignMillis(d.runMillis) + "<br/>" +
75+
TRACE.alignMillis(d.startMillis + d.runMillis);
76+
}
77+
return '?';
78+
});
7479

7580
rowsEnter.append("td")
7681
.classed("numeric", true)
77-
.text(function(d) { return TRACE.alignMillis(d.totalMillis); });
78-
79-
rowsEnter.append("td")
80-
.classed("numeric", true)
81-
.text(function(d) { return TRACE.alignMillis(d.startMillis + d.totalMillis); });
82+
.html(function(d) {
83+
return "+" + TRACE.alignMillis(d.totalMillis) + "<br/>" +
84+
TRACE.alignMillis(d.startMillis + d.totalMillis);
85+
});
8286

8387
rowsEnter.append("td")
8488
.attr("class", function(d) { return d.resultType; })

0 commit comments

Comments
 (0)