[LNT] r255975 - Little fixups to graphing

Chris Matthews via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 17 18:20:56 PST 2015


Author: cmatthews
Date: Thu Dec 17 20:20:56 2015
New Revision: 255975

URL: http://llvm.org/viewvc/llvm-project?rev=255975&view=rev
Log:
Little fixups to graphing

Add axis information, scale y-axis to percent, more descriptive buttons etc.

Modified:
    lnt/trunk/lnt/server/ui/static/lnt_graph.js
    lnt/trunk/lnt/server/ui/templates/v4_regression_detail.html
    lnt/trunk/lnt/server/ui/templates/v4_regression_list.html

Modified: lnt/trunk/lnt/server/ui/static/lnt_graph.js
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/static/lnt_graph.js?rev=255975&r1=255974&r2=255975&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/static/lnt_graph.js (original)
+++ lnt/trunk/lnt/server/ui/static/lnt_graph.js Thu Dec 17 20:20:56 2015
@@ -158,7 +158,7 @@ function normalize_data(data_array, inde
     console.assert(factor !== 0, "Did not find the element to normalize on.");
     for (i = 0; i < data_array.length; i++) {
         new_data[i] = jQuery.extend({}, data_array[i]);
-        new_data[i][1] = data_array[i][1] / factor;
+        new_data[i][1] = (data_array[i][1] / factor) * 100;
     }
     return new_data;
 }
@@ -191,7 +191,7 @@ function make_graph_point_entry(data, co
                            }
                 };
     if (regression) {
-        entry.points.symbol = "cross";
+        entry.points.symbol = "triangle";
     }
     return entry;
 }
@@ -205,16 +205,16 @@ var color_codes = ["#4D4D4D",
                    "#B276B2",
                    "#DECF3F",
                    "#F15854",
-                   "#1f78b4",
-                   "#33a02c",
-                   "#e31a1c",
-                   "#ff7f00",
-                   "#6a3d9a",
-                   "#a6cee3",
-                   "#b2df8a",
-                   "#fb9a99",
-                   "#fdbf6f",
-                   "#cab2d6"];
+                   "#1F78B4",
+                   "#33A02C",
+                   "#E31A1C",
+                   "#FF7F00",
+                   "#6A3D9A",
+                   "#A6CEE3",
+                   "#B2DF8A",
+                   "#FB9A99",
+                   "#FDBF6F",
+                   "#CAB2D6"];
 
 function new_graph_data_callback(data, index) {
     "use strict";
@@ -315,11 +315,50 @@ function add_data_to_graph(URL, index) {
 }
 
 function init_graph () {
+    function onlyUnique(value, index, self) { 
+        return self.indexOf(value) === index;
+    }
+    var metrics = $('.metric').map( function() {
+        return $(this).text();
+    }).get();
+    metrics = metrics.filter(onlyUnique);
+    
+    var yaxis_name = metrics.join(", ");
+    yaxis_name = yaxis_name.replace("_"," ");
+    
+    $('#yaxis').text(yaxis_name);
+
     $('#normalize').click(function (e) {
         normalize = !normalize;
+        if (normalize) {
+            $('#normalize').toggleClass("btn-default btn-primary");
+            $('#normalize').text("x1");
+            $('#yaxis').text("Normalized (%)");
+            
+
+        } else {
+            $('#normalize').toggleClass("btn-primary btn-default");
+            $('#normalize').text("%");
+            $('#yaxis').text(yaxis_name);
+
+        }
         update_graph();
     }); 
 
+    $('#xaxis').css('position', 'relative');
+    $('#xaxis').css('left', '50%');
+    $('#xaxis').css('bottom', '100px');
+    $('#xaxis').css('width', '100px');
+    $('#xaxis').css('margin-left', '-50px');
+
+    $('#yaxis').css('position', 'relative');
+    $('#yaxis').css('left', '-60px');
+    $('#yaxis').css('float', 'left');
+    $('#yaxis').css('top', '-250px');
+    $('#yaxis').css('-webkit-transform', 'rotate(-90deg)');
+    $('#yaxis').css('-moz-transform', 'rotate(-90deg)');
+    
+    
 }
 
 

Modified: lnt/trunk/lnt/server/ui/templates/v4_regression_detail.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_regression_detail.html?rev=255975&r1=255974&r2=255975&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_regression_detail.html (original)
+++ lnt/trunk/lnt/server/ui/templates/v4_regression_detail.html Thu Dec 17 20:20:56 2015
@@ -62,6 +62,8 @@ var changes = [
     <br>
     <button id="normalize" type="button" class="btn btn-default" style="width:100%; text-align:center;">%</button>
 </div>
+<div id="yaxis">Metric</div>
+<div id="xaxis">Order</div>
 
 <a href="{{regression.bug}}">{{regression.bug}}</a>
 
@@ -124,7 +126,7 @@ var changes = [
 
 
 <!-- Button to trigger modal -->
-<a href="#editRegressionModal" role="button" class="btn" data-toggle="modal">Edit</a>
+<a id="editButton" href="#editRegressionModal" role="button" class="btn" data-toggle="modal">Change State</a>
  
 <!-- Modal -->
 <div id="editRegressionModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="editRegressionModal" aria-hidden="true">
@@ -283,6 +285,8 @@ $(document).ready( function () {
     "drawCallback": function( settings ) {
         register_checkboxes();
     },
+    "aLengthMenu": [[-1, 50],
+                    ["All", 50]],
 
     });
 

Modified: lnt/trunk/lnt/server/ui/templates/v4_regression_list.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_regression_list.html?rev=255975&r1=255974&r2=255975&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_regression_list.html (original)
+++ lnt/trunk/lnt/server/ui/templates/v4_regression_list.html Thu Dec 17 20:20:56 2015
@@ -75,6 +75,10 @@ $(document).ready( function () {
                     "aLengthMenu": [[50, -1],
                                     [50, "All"]]};
     dt = $('#regression_list').DataTable(settings);
+    $('input[type=search]').attr('autocomplete', 'off');
+    $('input[type=search]').attr('autocorrect', 'off');
+    $('input[type=search]').attr('spellcheck', 'off');
+
 });
 
 </script>




More information about the llvm-commits mailing list