aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-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'
}