diff options
author | zsloan | 2019-07-26 11:13:23 -0500 |
---|---|---|
committer | zsloan | 2019-07-26 11:13:23 -0500 |
commit | 1bc7672b4e00010b186f75eacc26bdef1dfab56b (patch) | |
tree | 653cc1305c6086ba1700d4d8ade326802a047067 /wqflask | |
parent | 5f5adb62bf13ace887c03522b0b8e83181cd6503 (diff) | |
download | genenetwork2-1bc7672b4e00010b186f75eacc26bdef1dfab56b.tar.gz |
Scatterplots should have consistent decimal places for axes now
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/static/new/javascript/draw_corr_scatterplot.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/wqflask/wqflask/static/new/javascript/draw_corr_scatterplot.js b/wqflask/wqflask/static/new/javascript/draw_corr_scatterplot.js index 4b212f8b..7cc89304 100644 --- a/wqflask/wqflask/static/new/javascript/draw_corr_scatterplot.js +++ b/wqflask/wqflask/static/new/javascript/draw_corr_scatterplot.js @@ -1,6 +1,18 @@ var chart; var srchart; +x_val_range = js_data.x_range[1] - js_data.x_range[0] +y_val_range = js_data.y_range[1] - js_data.y_range[0] + + +if (x_val_range < 4 || y_val_range < 4){ + tick_digits = '.1f' +} else if (x_val_range < 0.4 || y_val_range < 0.4) { + tick_digits = '.2f' +} else { + tick_digits = 'f' +} + var layout = { height: 700, width: 800, @@ -17,6 +29,7 @@ var layout = { visible: true, linecolor: 'black', linewidth: 1, + tickformat: tick_digits }, yaxis: { range: [js_data.y_range[0], js_data.y_range[1]], @@ -25,6 +38,7 @@ var layout = { visible: true, linecolor: 'black', linewidth: 1, + tickformat: tick_digits }, hovermode: "closest", showlegend: false |