From 98bc5004368e5d358d643b6bd971586b81dd735e Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 20 Sep 2019 13:19:47 -0500 Subject: Converted permutation histogram to use plotly --- wqflask/wqflask/templates/mapping_results.html | 68 +++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/wqflask/wqflask/templates/mapping_results.html b/wqflask/wqflask/templates/mapping_results.html index baf2b1ec..1fc792d8 100644 --- a/wqflask/wqflask/templates/mapping_results.html +++ b/wqflask/wqflask/templates/mapping_results.html @@ -14,6 +14,10 @@
+ {% if temp_trait is defined %} + + + {% endif %} @@ -196,7 +200,8 @@
{% if nperm > 0 and permChecked == "ON" %}

- +
+

Total of {{ nperm }} permutations  Download Permutation Results
@@ -318,6 +323,7 @@ + @@ -441,6 +447,66 @@ $('#marker_regression_form').attr('action', '/export_perm_data'); return $('#marker_regression_form').submit(); } + + modebar_options = { + modeBarButtonsToAdd:[{ + name: 'Export as SVG', + icon: Plotly.Icons.disk, + click: function(gd) { + Plotly.downloadImage(gd, {format: 'svg'}) + } + }], + modeBarButtonsToRemove:['toImage', 'sendDataToCloud', 'hoverClosest', 'hoverCompare', 'hoverClosestCartesian', 'hoverCompareCartesian', 'lasso2d', 'toggleSpikelines'], + displaylogo: false + //modeBarButtons:['toImage2', 'zoom2d', 'pan2d', 'select2d', 'zoomIn2d', 'zoomOut2d', 'autoScale2d', 'resetScale2d'], + } + + perm_data = js_data.perm_results + var hist_trace = { + x: perm_data, + type: 'histogram' + }; + histogram_data = [hist_trace]; + histogram_layout = { + bargap: 0.05, + title: "Histogram of Permutation Test", + xaxis: { + autorange: true, + title: "LRS", + titlefont: { + family: "arial", + size: 20 + }, + ticklen: 4, + tickfont: { + size: 16 + } + }, + yaxis: { + autorange: true, + title: "Frequency", + titlefont: { + family: "arial", + size: 20 + }, + showline: true, + ticklen: 4, + tickfont: { + size: 16 + }, + automargin: true + }, + width: 500, + height: 300, + margin: { + l: 70, + r: 30, + t: 100, + b: 50 + } + }; + + Plotly.newPlot('perm_histogram', histogram_data, histogram_layout, modebar_options); {% endif %} export_mapping_results = function() { -- cgit v1.2.3