From 69f9e2ebf31e7bf01162f8d9e9510d739b64e75c Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 30 Nov 2022 20:26:36 +0000 Subject: Remove box plot (violin plot is enough) --- .../wqflask/static/new/javascript/show_trait.js | 157 --------------------- .../wqflask/templates/show_trait_statistics.html | 8 -- 2 files changed, 165 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index 1562ac25..7dcfbd89 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -325,39 +325,6 @@ updateBarChart = function() { } }; -update_box_plot = function() { - var y_value_list = [] - if (sampleLists.length > 1) { - i = 0; - for (var sample_group in root.selected_samples){ - var trait_sample_data = _.values(root.selected_samples[sample_group]) - var trait_vals = []; - for (j = 0, len = trait_sample_data.length; j < len; j++) { - this_sample_data = trait_sample_data[j]; - trait_vals.push(this_sample_data.value); - } - root.box_data[i]['y'] = trait_vals - i++; - } - } else { - var trait_sample_data = _.values(root.selected_samples['samples_all']) - var trait_vals = []; - for (j = 0, len = trait_sample_data.length; j < len; j++) { - this_sample_data = trait_sample_data[j]; - trait_vals.push(this_sample_data.value); - } - root.box_data[0]['y'] = trait_vals - } - - if ($('input[name="transform"]').val() != ""){ - root.box_layout['yaxis']['title'] = "" + js_data.unit_type + " (" + $('input[name="transform"]').val() + ")" - } else { - root.box_layout['yaxis']['title'] = "" + js_data.unit_type + "" - } - - Plotly.newPlot('box_plot', root.box_data, root.box_layout, root.modebar_options) -} - updateViolinPlot = function() { var y_value_list = [] if (sampleLists.length > 1) { @@ -542,9 +509,6 @@ editDataChange = function() { if ($('#bar_chart').hasClass('js-plotly-plot')){ updateBarChart(); } - if ($('#box_plot').hasClass('js-plotly-plot')){ - update_box_plot(); - } if ($('#violin_plot').hasClass('js-plotly-plot')){ updateViolinPlot(); } @@ -1482,127 +1446,6 @@ $('.histogram_samples_group').change(function() { return updateHistogram(); }); -root.box_layout = { - xaxis: { - showline: true, - titlefont: { - family: "arial", - size: 20 - }, - tickfont: { - size: 16 - }, - }, - yaxis: { - title: "" + js_data.unit_type +"", - autorange: true, - showline: true, - titlefont: { - family: "arial", - size: 20 - }, - ticklen: 4, - tickfont: { - size: 16 - }, - tickformat: tickDigits, - zeroline: false, - automargin: true - }, - margin: { - l: 90, - r: 30, - t: 30, - b: 80 - } -}; -if (fullSampleLists.length > 1) { - root.box_layout['width'] = 600; - root.box_layout['height'] = 500; - var trace1 = { - y: getSampleVals(fullSampleLists[0]), - type: 'box', - name: sampleGroupList[0], - boxpoints: 'Outliers', - jitter: 0.5, - whiskerwidth: 0.2, - fillcolor: 'cls', - pointpos: -3, - marker: { - color: 'blue', - size: 3 - }, - line: { - width: 1 - } - } - var trace2 = { - y: getSampleVals(fullSampleLists[1]), - type: 'box', - name: sampleGroupList[1], - boxpoints: 'Outliers', - jitter: 0.5, - whiskerwidth: 0.2, - fillcolor: 'cls', - pointpos: -3, - marker: { - color: 'red', - size: 3 - }, - line: { - width: 1 - } - } - var trace3 = { - y: getSampleVals(fullSampleLists[2]), - type: 'box', - name: sampleGroupList[2], - boxpoints: 'Outliers', - jitter: 0.5, - whiskerwidth: 0.2, - fillcolor: 'cls', - pointpos: -3, - marker: { - color: 'green', - size: 3 - }, - line: { - width: 1 - } - } - root.box_data = [trace1, trace2, trace3] -} else { - root.box_layout['width'] = 300; - root.box_layout['height'] = 400; - root.box_data = [ - { - type: 'box', - y: getSampleVals(fullSampleLists[0]), - name: "Trait " + js_data.trait_id + "", - boxpoints: 'Outliers', - jitter: 0.5, - whiskerwidth: 0.2, - fillcolor: 'cls', - pointpos: -3, - marker: { - size: 3 - }, - line: { - width: 1 - } - } - ] -} - -box_obj = { - data: box_data, - layout: root.box_layout -} - -$('.box_plot_tab').click(function() { - update_box_plot(); -}); - // Violin Plot root.violin_layout = { diff --git a/wqflask/wqflask/templates/show_trait_statistics.html b/wqflask/wqflask/templates/show_trait_statistics.html index 865959b1..4e7dd17f 100644 --- a/wqflask/wqflask/templates/show_trait_statistics.html +++ b/wqflask/wqflask/templates/show_trait_statistics.html @@ -15,9 +15,6 @@
  • Probability Plot
  • -
  • - Box Plot -
  • Violin Plot
  • @@ -103,11 +100,6 @@ -
    -
    -
    -
    -
    -- cgit v1.2.3