diff options
Diffstat (limited to 'gn2/wqflask/static/new')
3 files changed, 47 insertions, 30 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..fa896621 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, @@ -42,7 +40,7 @@ var layout = { visible: true, linecolor: 'black', linewidth: 1, - ticklen: 4, + ticklen: 6, tickformat: x_tick_digits }, yaxis: { @@ -52,7 +50,7 @@ var layout = { visible: true, linecolor: 'black', linewidth: 1, - ticklen: 4, + ticklen: 6, tickformat: y_tick_digits, automargin: true }, @@ -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,13 @@ 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' + } + Plotly.newPlot('scatterplot2', [trace2, trace1], layout, modebar_options) } @@ -634,8 +635,10 @@ function chartupdatewh() { Plotly.newPlot('scatterplot2', getdata(), layout, modebar_options) Plotly.relayout('scatterplot2', width_height_update) - Plotly.newPlot('srscatterplot2', srgetdata(), sr_layout, modebar_options) - Plotly.relayout('srscatterplot2', width_height_update) + if (!js_data.effect_plot) { + Plotly.newPlot('srscatterplot2', srgetdata(), sr_layout, modebar_options) + Plotly.relayout('srscatterplot2', width_height_update) + } } function colorer(d) { @@ -711,8 +714,10 @@ function chartupdatedata() { Plotly.newPlot('scatterplot2', getdata(), layout, modebar_options) Plotly.relayout('scatterplot2', pearson_title_update) - Plotly.newPlot('srscatterplot2', srgetdata(), sr_layout, modebar_options) - Plotly.relayout('srscatterplot2', spearman_title_update) + if (!js_data.effect_plot) { + Plotly.newPlot('srscatterplot2', srgetdata(), sr_layout, modebar_options) + Plotly.relayout('srscatterplot2', spearman_title_update) + } if ($('#cofactor1_type option:selected').val() == "color"){ $('#cofactor_color_selector').css("display", "inline") @@ -722,11 +727,13 @@ function chartupdatedata() { 'stroke': colorer, 'fill': colorer }); - d3.select('#srscatterplot2 svg').selectAll('.point') - .style({ - 'stroke': ranked_colorer, - 'fill': ranked_colorer - }); + if (!js_data.effect_plot) { + d3.select('#srscatterplot2 svg').selectAll('.point') + .style({ + 'stroke': ranked_colorer, + 'fill': ranked_colorer + }); + } } } else if ($('#cofactor2_type option:selected').val() == "color"){ $('#cofactor_color_selector').css("display", "inline") @@ -736,11 +743,13 @@ function chartupdatedata() { 'stroke': colorer, 'fill': colorer }); - d3.select('#srscatterplot2 svg').selectAll('.point') - .style({ - 'stroke': ranked_colorer, - 'fill': ranked_colorer - }); + if (!js_data.effect_plot) { + d3.select('#srscatterplot2 svg').selectAll('.point') + .style({ + 'stroke': ranked_colorer, + 'fill': ranked_colorer + }); + } } } else { $('#cofactor_color_selector').css("display", "inline") @@ -750,17 +759,21 @@ function chartupdatedata() { 'stroke': colorer, 'fill': colorer }); - d3.select('#srscatterplot2 svg').selectAll('.point') - .style({ - 'stroke': ranked_colorer, - 'fill': ranked_colorer - }); + if (!js_data.effect_plot) { + d3.select('#srscatterplot2 svg').selectAll('.point') + .style({ + 'stroke': ranked_colorer, + 'fill': ranked_colorer + }); + } } } } drawg(); -srdrawg(); +if (!js_data.effect_plot) { + srdrawg(); +} $(".chartupdatewh").change(function () { chartupdatewh(); diff --git a/gn2/wqflask/static/new/javascript/get_traits_from_collection.js b/gn2/wqflask/static/new/javascript/get_traits_from_collection.js index c115f3b0..6968a9d7 100644 --- a/gn2/wqflask/static/new/javascript/get_traits_from_collection.js +++ b/gn2/wqflask/static/new/javascript/get_traits_from_collection.js @@ -389,7 +389,11 @@ process_traits = function(trait_data, textStatus, jqXHR) { the_html += "<td class='trait' data-display_name='" + trait.name + "'>" + trait.name + "</td>"; } the_html += "<td class='dataset' data-dataset='" + trait.dataset + "'>" + trait.dataset_name + "</td>"; - the_html += "<td class='description'>" + trait.description + "</td>"; + if (trait.dataset.includes('Geno')) { + the_html += "<td class='description'>" + trait.location + "</td>"; + } else { + the_html += "<td class='description'>" + trait.description + "</td>"; + } } the_html += "</tbody>"; the_html += "</table>"; diff --git a/gn2/wqflask/static/new/javascript/show_trait.js b/gn2/wqflask/static/new/javascript/show_trait.js index edb2cfab..6d77e130 100644 --- a/gn2/wqflask/static/new/javascript/show_trait.js +++ b/gn2/wqflask/static/new/javascript/show_trait.js @@ -68,7 +68,7 @@ statTableRows.push( }, { vn: "interquartile", pretty: "<font color='black'>Interquartile Range</font>", - url: "http://www.genenetwork.org/glossary.html#Interquartile", + url: "{{ url_for('gn_docs_blueprint.glossary') }}#Interquartile", digits: 3 }, { vn: "skewness", |