[PATCH] D44010: [LNT] Add support for logarithmic scale.
Martin Liška via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 10 02:08:22 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL331967: Add support for logarithmic scale. (authored by marxin, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D44010?vs=136730&id=146097#toc
Repository:
rL LLVM
https://reviews.llvm.org/D44010
Files:
lnt/trunk/lnt/server/ui/templates/v4_graph.html
lnt/trunk/lnt/server/ui/views.py
Index: lnt/trunk/lnt/server/ui/templates/v4_graph.html
===================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_graph.html
+++ lnt/trunk/lnt/server/ui/templates/v4_graph.html
@@ -43,8 +43,31 @@
var db_name = "{{ request.view_args.get('db_name','') }}";
var graph_plots = {{graph_plots|tojson|safe}};
var baseline_plots = {{baseline_plots|tojson|safe}};
+var options = {{options|tojson|safe}};
prefix = "{{request.base_url}}";
+transform_fn = function (v) { return v; }
+inverse_transform_fn = function (v) { return v; }
+
+if (options.logarithmic_scale) {
+ transform_fn = function(v) {
+ if (v < 0)
+ return -Math.log10(-v);
+ else if (v > 0)
+ return Math.log10(v);
+ else
+ return 0;
+ }
+ inverse_transform_fn = function(v) {
+ if (v < 0)
+ return -Math.pow(10, -v);
+ else if (v > 0)
+ return Math.pow(10, v);
+ else
+ return 0;
+ }
+}
+
function init_graph() {
// Set up the primary graph.
var graph = $("#graph");
@@ -66,7 +89,10 @@
frameRate: 60 },
grid : {
hoverable : true,
- clickable: true }
+ clickable: true },
+ yaxis: {
+ transform: transform_fn,
+ inverseTransform: inverse_transform_fn }
};
// Add baseline lines
@@ -207,6 +233,11 @@
{{ 'checked="checked"' if options.show_moving_median else ""}}/></td>
</tr>
<tr>
+ <td>Show Logarithmic Scale</td>
+ <td><input type="checkbox" name="logarithmic_scale" value="yes"
+ {{ 'checked="checked"' if options.logarithmic_scale else ""}}/></td>
+ </tr>
+ <tr>
<td>Moving Average/Median Window Size</td>
</tr>
{# Split this into a new row to avoid making the dialog wider. #}
Index: lnt/trunk/lnt/server/ui/views.py
===================================================================
--- lnt/trunk/lnt/server/ui/views.py
+++ lnt/trunk/lnt/server/ui/views.py
@@ -791,6 +791,9 @@
request.args.get('moving_window_size', 10))
options['hide_highlight'] = bool(
request.args.get('hide_highlight'))
+ options['logarithmic_scale'] = bool(
+ request.args.get('logarithmic_scale'))
+
show_highlight = not options['hide_highlight']
# Load the graph parameters.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44010.146097.patch
Type: text/x-patch
Size: 2459 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180510/b31b5342/attachment.bin>
More information about the llvm-commits
mailing list