[pypy-svn] r70667 - in pypy/build/bot2/jsplot: . css js

fijal at codespeak.net fijal at codespeak.net
Sun Jan 17 23:02:12 CET 2010


Author: fijal
Date: Sun Jan 17 23:02:11 2010
New Revision: 70667

Modified:
   pypy/build/bot2/jsplot/css/main.css
   pypy/build/bot2/jsplot/js/plot.js
   pypy/build/bot2/jsplot/plotsummary.html
Log:
some hacks to make it redisplay correctly under changing revision.
Add a display for large graph


Modified: pypy/build/bot2/jsplot/css/main.css
==============================================================================
--- pypy/build/bot2/jsplot/css/main.css	(original)
+++ pypy/build/bot2/jsplot/css/main.css	Sun Jan 17 23:02:11 2010
@@ -7,6 +7,10 @@
     width: 200px;
     height: 100px;
 }
+.largeplot {
+    width: 800px;
+    height: 400px;
+}
 .caption {
     font-size: 14pt;
     font-family: Verdana;

Modified: pypy/build/bot2/jsplot/js/plot.js
==============================================================================
--- pypy/build/bot2/jsplot/js/plot.js	(original)
+++ pypy/build/bot2/jsplot/js/plot.js	Sun Jan 17 23:02:11 2010
@@ -9,6 +9,9 @@
     JSON_DIR_LIST = JSON_DIR_URL + "dir";
 }
 
+var large_displayed = false;
+var large_data;
+
 function common_attrs()
 {
     return {
@@ -58,29 +61,41 @@
         $("#placeholder").append("<tr></tr>");
     }
     var capt = benchname + " " + lasttime;
-    $("#placeholder").find("tr:last").append("<td><p class='smallcaption'>" + capt + "</p><div class='miniplot'></div></td>");
+    $("#placeholder").find("tr:last").append("<td><p class='smallcaption'>" + capt + "</p><a href='#' id='goto_" + benchname + "'><div class='miniplot'></div></a></td>");
+    $("#goto_" + benchname).click(function(e) {
+        display_large(benchname, benchresults, cpython_results);
+    });
     var elem = $("#placeholder").find("div:last");
     var attrs = attrs_for_miniature();
     var data;
-    if (!$("#legend").children() == []) {
-        // a bit of a hack, if we didn't add a legend, do it now
-        $("#revstart")[0].value = benchresults[0][0];
-        $("#revstart").change(function(event) {
-            redisplay(elem, benchresults, cpython_results);
-        });
-        data = get_plot_input(benchresults, cpython_results);
-        attrs.legend.container = "#legend";
-    } else {
-        data = [benchresults, cpython_results];
-    }
+    $("#revstart")[0].value = benchresults[0][0];
+    $("#revstart").change(function(event) {
+        redisplay(elem, benchresults, cpython_results);
+    });
+    data = get_plot_input(benchresults, cpython_results);
+    attrs.legend.container = "#legend";
     $.plot(elem, data, attrs);
 }
 
+function display_large(benchname, benchresults, cpython_results)
+{
+    $("#large_caption").html(benchname);
+    var attrs = common_attrs();
+    attrs.xaxis.min = $("#revstart")[0].value;
+    $.plot($("#large_graph"), get_plot_input(benchresults, cpython_results),
+          attrs);
+    large_displayed = true;
+    large_data = [benchname, benchresults, cpython_results];
+}
+
 function redisplay(elem, benchresults, cpython_results)
 {
     var attrs = attrs_for_miniature();
     attrs.xaxis.min = $("#revstart")[0].value;
     $.plot(elem, [benchresults, cpython_results], attrs);
+    if (large_displayed) {
+        display_large(large_data[0], large_data[1], large_data[2]);
+    }
 }
 
 function plot_main(benchname, benchresults, cpython_results, lasttime) {

Modified: pypy/build/bot2/jsplot/plotsummary.html
==============================================================================
--- pypy/build/bot2/jsplot/plotsummary.html	(original)
+++ pypy/build/bot2/jsplot/plotsummary.html	Sun Jan 17 23:02:11 2010
@@ -24,5 +24,7 @@
       <tr>
       </tr>
     </table>
+    <p class="caption" id="large_caption"></p>
+    <div class="largeplot" id="large_graph"></div>
   </body>
 </html>



More information about the Pypy-commit mailing list