aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2019-07-26 11:13:23 -0500
committerzsloan2019-07-26 11:13:23 -0500
commit1bc7672b4e00010b186f75eacc26bdef1dfab56b (patch)
tree653cc1305c6086ba1700d4d8ade326802a047067
parent5f5adb62bf13ace887c03522b0b8e83181cd6503 (diff)
downloadgenenetwork2-1bc7672b4e00010b186f75eacc26bdef1dfab56b.tar.gz
Scatterplots should have consistent decimal places for axes now
-rw-r--r--wqflask/wqflask/static/new/javascript/draw_corr_scatterplot.js14
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