diff options
author | zsloan | 2020-05-18 11:48:14 -0500 |
---|---|---|
committer | zsloan | 2020-05-18 11:48:14 -0500 |
commit | 81205be9a657c3fb350fe797ecefe615c0b9a4b7 (patch) | |
tree | 8269ff9c5f806e48110c5400b2c80afc02a8459e | |
parent | ab1f3c850ece1ecad7b6f350cae83115cbb43bf2 (diff) | |
download | genenetwork2-81205be9a657c3fb350fe797ecefe615c0b9a4b7.tar.gz |
Fixed issue with phenotype correlation table and added Plotly Chart Studio link to correlation scatterplots
-rw-r--r-- | wqflask/wqflask/correlation/show_corr_results.py | 2 | ||||
-rw-r--r-- | wqflask/wqflask/static/new/javascript/draw_corr_scatterplot.js | 2 | ||||
-rw-r--r-- | wqflask/wqflask/templates/correlation_page.html | 34 |
3 files changed, 27 insertions, 11 deletions
diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py index cc74c8e4..b099b83d 100644 --- a/wqflask/wqflask/correlation/show_corr_results.py +++ b/wqflask/wqflask/correlation/show_corr_results.py @@ -609,6 +609,7 @@ def get_header_fields(data_type, corr_method): if corr_method == "spearman": header_fields = ['Index', 'Record', + 'Abbreviation', 'Description', 'Authors', 'Year', @@ -621,6 +622,7 @@ def get_header_fields(data_type, corr_method): else: header_fields = ['Index', 'Record', + 'Abbreviation', 'Description', 'Authors', 'Year', diff --git a/wqflask/wqflask/static/new/javascript/draw_corr_scatterplot.js b/wqflask/wqflask/static/new/javascript/draw_corr_scatterplot.js index a0a88773..956e0467 100644 --- a/wqflask/wqflask/static/new/javascript/draw_corr_scatterplot.js +++ b/wqflask/wqflask/static/new/javascript/draw_corr_scatterplot.js @@ -132,6 +132,8 @@ var modebar_options = { Plotly.downloadImage(gd, {format: 'jpeg'}) } }], + showEditInChartStudio: true, + plotlyServerURL: "https://chart-studio.plotly.com", modeBarButtonsToRemove:['toImage', 'sendDataToCloud', 'hoverClosest', 'hoverCompare', 'hoverClosestCartesian', 'hoverCompareCartesian', 'lasso2d', 'toggleSpikelines'], displaylogo: false } diff --git a/wqflask/wqflask/templates/correlation_page.html b/wqflask/wqflask/templates/correlation_page.html index 23136257..1c84239c 100644 --- a/wqflask/wqflask/templates/correlation_page.html +++ b/wqflask/wqflask/templates/correlation_page.html @@ -82,6 +82,7 @@ <button id="redraw" class="btn btn-default" type="button">Reset Columns</button> </form> <br /> + {% if target_dataset.type != "Publish" %} <br /> <button id="more_options" class="btn btn-primary">More Options...</button> <br /> @@ -107,6 +108,7 @@ <br /> <br /> </div> + {% endif %} </div> <div style="margin-bottom: 5px;"> <b>Show/Hide Columns:</b> @@ -162,9 +164,9 @@ {% if trait.abbreviation %} <TD title="{{ trait.abbreviation }}" data-export="{{ trait.abbreviation }}">{% if trait.abbreviation|length > 20 %}{{ trait.abbreviation[:20] }}...{% else %}{{ trait.abbreviation }}{% endif %}</TD> {% else %} - <TD data-export="{{ trait.abbreviation }}">N/A</TD> + <TD data-export="N/A">N/A</TD> {% endif %} - <td data-export="{{ trait.description_display }}">{{ trait.description_display }}</td> + <td data-export="{{ trait.description_display }}">{% if trait.description_display|length > 50 %}{{ trait.description_display[:50] }}...{% else %}{{ trait.description_display }}{% endif %}</td> <td data-export="{{ trait.authors }}">{{ trait.authors }}</td> <td data-export="{{ trait.pubmed_text }}"> <a href="{{ trait.pubmed_link }}"> @@ -192,7 +194,7 @@ {% endblock %} {% block js %} - <script type="text/javascript" src="/static/new/js_external/md5.min.js"></script> + <!--<script type="text/javascript" src="/static/new/js_external/md5.min.js"></script>--> <script type="text/javascript" src="/static/new/javascript/search_results.js"></script> <script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script> @@ -239,8 +241,7 @@ return ((x < y) ? 1 : ((x > y) ? -1 : 0)); }; - //$.fn.dataTableExt.afnFiltering.push( - + {% if target_dataset.type != "Publish" %} $.fn.dataTable.ext.search.push( function( settings, data, dataIndex ) { var r_column = {{ filter_cols[0] }}; var r_greater = parseFloat($('input[name=r_greater_select]').val()) @@ -280,6 +281,7 @@ } return true }); + {% endif %} $(document).ready( function () { @@ -303,7 +305,6 @@ $(button).prop("disabled", false); } } - //}); if ($(this).is(":checked")) { if (!$(this).closest('tr').hasClass('selected')) { $(this).closest('tr').addClass('selected') @@ -382,8 +383,15 @@ {% elif target_dataset.type == "Publish" %} table_conf = { - "paging": false, - buttons: [ + "drawCallback": function( settings ) { + $('#trait_table tr').click(function(event) { + if (event.target.type !== 'checkbox') { + $(':checkbox', this).trigger('click'); + } + }); + $('.trait_checkbox:checkbox').on("change", change_buttons); + }, + "buttons": [ { extend: 'columnsToggle', columns: function( idx, data, node ) { @@ -426,10 +434,14 @@ $('td', row).eq(4).text($('td', row).eq(4).text() + '...') } }, - "order": [[8, "asc" ]], + "order": [[9, "asc" ]], "sDom": "Btir", + "iDisplayLength": -1, "autoWidth": false, - "bDeferRender": true + "deferRender": true, + "bSortClasses": false, + "paging": false, + "orderClasses": true, } {% elif target_dataset.type == "Geno" %} table_conf = { @@ -468,7 +480,7 @@ } {% endif %} - var the_table = $('#trait_table').DataTable(table_conf); + the_table = $('#trait_table').DataTable(table_conf); console.timeEnd("Creating table"); |