aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/static/new/javascript
diff options
context:
space:
mode:
authorzsloan2024-09-16 18:49:34 +0000
committerzsloan2024-09-17 14:38:13 +0000
commit805b781e6eabfb42cbecb319fffc8ade855de914 (patch)
tree1022428f3e8e4b40ae45bf1307e341aee16d5366 /gn2/wqflask/static/new/javascript
parentfaa9a6329283031218fbd49d1b1491f1874a0a3f (diff)
downloadgenenetwork2-805b781e6eabfb42cbecb319fffc8ade855de914.tar.gz
Handle Effect Size plots on the scatterplot page
Added a new parameter to the scatterplot page ('effect') that causes the figures to be drawn differently. For example: - The plot width is different - Spearman Rank plot isn't displayed/generated - The number of X-axis ticks is explicitly set to 3, with no decimal places
Diffstat (limited to 'gn2/wqflask/static/new/javascript')
-rw-r--r--gn2/wqflask/static/new/javascript/draw_corr_scatterplot.js19
1 files changed, 12 insertions, 7 deletions
diff --git a/gn2/wqflask/static/new/javascript/draw_corr_scatterplot.js b/gn2/wqflask/static/new/javascript/draw_corr_scatterplot.js
index f883c0d9..9a6d317d 100644
--- a/gn2/wqflask/static/new/javascript/draw_corr_scatterplot.js
+++ b/gn2/wqflask/static/new/javascript/draw_corr_scatterplot.js
@@ -24,8 +24,6 @@ if (y_val_range >= 2 && y_val_range < 8){
y_tick_digits = 'f'
}
-console.log("y_digits:", y_tick_digits)
-
var layout = {
height: 700,
width: 800,
@@ -140,12 +138,8 @@ var modebar_options = {
cofactor1_dict = {}
ranked_cofactor1_dict = {}
-//cofactor1_values = []
-//ranked_cofactor1_values = []
cofactor2_dict = {}
ranked_cofactor2_dict = {}
-//cofactor2_values = []
-//ranked_cofactor2_values = []
cofactor3_dict = {}
ranked_cofactor3_dict = {}
@@ -176,6 +170,15 @@ function drawg() {
}
}
+ // Change some plot settings if the plot is an Effect Size plot
+ if (js_data.effect_plot) {
+ layout['width'] = 500
+ layout['xaxis']['nticks'] = 3
+ layout['xaxis']['tickformat'] = '.0f'
+ layout['yaxis']['nticks'] = 3
+ layout['yaxis']['tickformat'] = '.0f'
+ }
+
Plotly.newPlot('scatterplot2', [trace2, trace1], layout, modebar_options)
}
@@ -760,7 +763,9 @@ function chartupdatedata() {
}
drawg();
-srdrawg();
+if (!js_data.effect_plot) {
+ srdrawg();
+}
$(".chartupdatewh").change(function () {
chartupdatewh();