aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2019-11-13 17:36:15 -0600
committerzsloan2019-11-13 17:36:15 -0600
commit8c76aa0af0140cc0825f03704500839c01603f23 (patch)
treeb8caf0d06050747bc49b43ab94f1062227bc3cc3
parent725e6f7fe502b87f9ed4906de3842865bcc5cc9d (diff)
downloadgenenetwork2-8c76aa0af0140cc0825f03704500839c01603f23.tar.gz
Stats figures now update axis titles to include transform if applied
-rw-r--r--wqflask/wqflask/static/new/javascript/show_trait.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js
index f37ef1f8..f2b87edc 100644
--- a/wqflask/wqflask/static/new/javascript/show_trait.js
+++ b/wqflask/wqflask/static/new/javascript/show_trait.js
@@ -221,6 +221,11 @@ update_histogram = function() {
trait_vals.push(x.value);
}
root.histogram_data[0]['x'] = trait_vals
+
+ if ($('input[name="transform"]').val() != ""){
+ root.histogram_layout['xaxis']['title'] = "<b>" + js_data.unit_type + " (" + $('input[name="transform"]').val() + ")</b>"
+ }
+
Plotly.newPlot('histogram', root.histogram_data, root.histogram_layout, root.modebar_options);
update_histogram_width()
};
@@ -265,6 +270,10 @@ update_bar_chart = function() {
root.bar_layout['yaxis']['range'] = new_chart_range
+ if ($('input[name="transform"]').val() != ""){
+ root.bar_layout['yaxis']['title'] = "<b>" + js_data.unit_type + " (" + $('input[name="transform"]').val() + ")</b>"
+ }
+
root.bar_data[0]['y'] = trait_vals
root.bar_data[0]['error_y'] = {
type: 'data',
@@ -301,6 +310,11 @@ update_box_plot = function() {
}
root.box_data[0]['y'] = trait_vals
}
+
+ if ($('input[name="transform"]').val() != ""){
+ root.box_layout['yaxis']['title'] = "<b>" + js_data.unit_type + " (" + $('input[name="transform"]').val() + ")</b>"
+ }
+
Plotly.newPlot('box_plot', root.box_data, root.box_layout, root.modebar_options)
}
@@ -327,6 +341,11 @@ update_violin_plot = function() {
}
root.violin_data[0]['y'] = trait_vals
}
+
+ if ($('input[name="transform"]').val() != ""){
+ root.violin_layout['yaxis']['title'] = "<b>" + js_data.unit_type + " (" + $('input[name="transform"]').val() + ")</b>"
+ }
+
Plotly.newPlot('violin_plot', root.violin_data, root.violin_layout, root.modebar_options)
}