aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2019-06-04 12:49:17 -0500
committerzsloan2019-06-04 12:49:17 -0500
commitbb4e9e78067a4a26c84581b5f1b86b8718a117bc (patch)
tree007a550aec0e5d885f841c2eb6a4ba6144f5691e
parent1033685f2f5769a44f2daabee2f7779288465711 (diff)
downloadgenenetwork2-bb4e9e78067a4a26c84581b5f1b86b8718a117bc.tar.gz
Changed the logic for deciding y axis digits to deal with situations where the range is less tan 0.4; not sure if more than this needs to be accounted for
-rw-r--r--wqflask/wqflask/static/new/javascript/plotly_probability_plot.js5
-rw-r--r--wqflask/wqflask/static/new/javascript/show_trait.js6
2 files changed, 9 insertions, 2 deletions
diff --git a/wqflask/wqflask/static/new/javascript/plotly_probability_plot.js b/wqflask/wqflask/static/new/javascript/plotly_probability_plot.js
index 38c18d2b..a9c5676c 100644
--- a/wqflask/wqflask/static/new/javascript/plotly_probability_plot.js
+++ b/wqflask/wqflask/static/new/javascript/plotly_probability_plot.js
@@ -161,8 +161,11 @@
intercept_line['samples_all'] = [[first_x, last_x], [first_value, last_value]]
}
- if (Math.max(...y_values['samples_all']) - Math.min(...y_values['samples_all']) < 4){
+ val_range = Math.max(...y_values['samples_all']) - Math.min(...y_values['samples_all'])
+ if (val_range < 4){
tick_digits = '.1f'
+ } else if (val_range < 0.4) {
+ tick_digits = '.2f'
} else {
tick_digits = 'f'
}
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js
index 50765eda..8366ec0a 100644
--- a/wqflask/wqflask/static/new/javascript/show_trait.js
+++ b/wqflask/wqflask/static/new/javascript/show_trait.js
@@ -921,8 +921,12 @@ get_bar_range = function(sample_list){
}
root.chart_range = get_bar_range(sample_lists[0])
-if (root.chart_range[1] - root.chart_range[0] < 4){
+val_range = root.chart_range[1] - root.chart_range[0]
+
+if (val_range < 4){
tick_digits = '.1f'
+} else if (val_range < 0.4) {
+ tick_digits = '.2f'
} else {
tick_digits = 'f'
}