Commit 56e16f1c authored by Jan Kiene's avatar Jan Kiene
Browse files

cleanup + change in tick formatting

parent 39fd6b2a
Loading
Loading
Loading
Loading
Loading
+13 −14
Original line number Diff line number Diff line
@@ -188,7 +188,6 @@ LINE_COLORS = {
JS_FILE_TEMPLATE = """var {var_name} = {{
    {elem_name}: {{
        description: "{description}",
        direction: -1,
        ticks: [
            {ticks}
            ],
+33 −50
Original line number Diff line number Diff line
@@ -320,8 +320,11 @@
      return max;
  }

  function WMOPS() {
  function wmopsFormatter(v, axis) {
    return v + " WMOPS";
  }

  function WMOPS() {
    var previousPoint = null;

    function drawGraph(elt, graph, max_val) {
@@ -329,12 +332,7 @@
            yaxis: {
                min: 0,
                max: max_val,
                tickFormatter: function (v, axis) {
                    if (graph.direction == -1)
                        return v + " WMOPS";
                    return v;
                },
                invert: graph.direction == 1
                tickFormatter: wmopsFormatter,
            },
            xaxis: {
                tickFormatter: function (v, axis) {
@@ -375,11 +373,7 @@
            var y = item.datapoint[1];

            var text = "<u><b>" + item.series.id + "</b></u><br>"
            text += 'Score: ' + y;

            if (graph.direction == -1)
              text += " WMOPS";
            text += "<br>";
            text += 'Score: ' + y + " WMOPS" + "<br>";

            // add more info only if not a reference line
            if ( !item.series.id.includes("EVS") )
@@ -390,8 +384,7 @@
                var diff = Math.round((thisValue - prevValue) * 100) / 100;
                var pdiff = calcPercentDiff(thisValue, prevValue);
                var better;
                if ((pdiff < 0 && graph.direction == -1) ||
                    (pdiff > 0 && graph.direction == 1)) {
                if (pdiff < 0) {
                    better = "worse";
                } else {
                    better = "better";
@@ -399,7 +392,6 @@
                pdiff = Math.abs(pdiff);
                if (diff === diff) {
                    text += String.fromCharCode(916) + ": " + diff;
                    if (graph.direction == -1)
                    text += " WMOPS";
                    text += " (" + pdiff + "% " + better + ")<br>";
                }
@@ -450,7 +442,6 @@


function WMOPS_perOP() {
    		
    var previousPoint = null;

    function drawGraph(elt, graph, max_val) {
@@ -458,12 +449,7 @@ function WMOPS_perOP() {
            yaxis: {
                min: 0,
                max: max_val,
                tickFormatter: function (v, axis) {
                    if (graph.direction == -1)
                        return v + " WMOPS";
                    return v;
                },
                invert: graph.direction == 1
                tickFormatter: wmopsFormatter,
            },
            xaxis: {
              ticks: graph.ticks
@@ -575,6 +561,21 @@ function WMOPS_perOP() {

}

  function memTickFormatter(v, axis) {
    var decimals = axis.tickDecimals;
    var str_val = "";
    if (v > 1000000) {
      str_val = (v / 1000000).toFixed(decimals) + " MB";
    }
    else if (v > 1000) {
      str_val = (v / 1000).toFixed(decimals) + " kB";
    }
    else {
      str_val = v.toFixed(decimals) + " B";
    }
    return str_val;
  }


function RAM() {

@@ -585,12 +586,7 @@ function RAM() {
            yaxis: {
                min: 0,
                max: max_val,
                tickFormatter: function (v, axis) {
                    if (graph.direction == -1)
                        return v + " bytes";
                    return v;
                },
                invert: graph.direction == 1
                tickFormatter: memTickFormatter,
            },
            xaxis: {
                tickFormatter: function (v, axis) {
@@ -635,7 +631,6 @@ function RAM() {
              var text = "<u><b>" + item.series.id + "</b></u><br>"
              text += 'Score: ' + y;

              if (graph.direction == -1)
              text += " bytes";
              text += "<br>";
            
@@ -645,8 +640,7 @@ function RAM() {
                var diff = Math.round((thisValue - prevValue) * 100) / 100;
                var pdiff = calcPercentDiff(thisValue, prevValue);
                var better;
                if ((pdiff < 0 && graph.direction == -1) ||
                    (pdiff > 0 && graph.direction == 1)) {
                if (pdiff < 0) {
                    better = "worse";
                } else {
                    better = "better";
@@ -654,7 +648,6 @@ function RAM() {
                pdiff = Math.abs(pdiff);
                if (diff === diff) {
                    text += String.fromCharCode(916) + ": " + diff;
                    if (graph.direction == -1)
                    text += " bytes";
                    text += " (" + pdiff + "% " + better + ")<br>";
                }
@@ -726,7 +719,6 @@ function RAM() {


function ROM() {
    		
    var previousPoint = null;

    function drawGraph(elt, graph, max_val) {
@@ -734,12 +726,7 @@ function ROM() {
            yaxis: {
                min: 0,
                max: max_val,
                tickFormatter: function (v, axis) {
                    if (graph.direction == -1)
                        return v + " bytes";
                    return v;
                },
                invert: graph.direction == 1
                tickFormatter: memTickFormatter,
            },
            xaxis: {
                tickFormatter: function (v, axis) {
@@ -784,7 +771,6 @@ function ROM() {
              var text = "<u><b>" + item.series.id + "</b></u><br>"
              text += 'Score: ' + y;

              if (graph.direction == -1)
              text += " bytes";
              text += "<br>";
            
@@ -794,8 +780,7 @@ function ROM() {
                var diff = Math.round((thisValue - prevValue) * 100) / 100;
                var pdiff = calcPercentDiff(thisValue, prevValue);
                var better;
                if ((pdiff < 0 && graph.direction == -1) ||
                    (pdiff > 0 && graph.direction == 1)) {
                if (pdiff < 0) {
                    better = "worse";
                } else {
                    better = "better";
@@ -803,7 +788,6 @@ function ROM() {
                pdiff = Math.abs(pdiff);
                if (diff === diff) {
                    text += String.fromCharCode(916) + ": " + diff;
                    if (graph.direction == -1)
                    text += " bytes";
                    text += " (" + pdiff + "% " + better + ")<br>";
                }
@@ -832,7 +816,6 @@ function ROM() {

  WMOPS();
  WMOPS_perOP();
  
  RAM();
  ROM();