From 0b25ab1565faf3824d591c545dfe71dbd28c38ee Mon Sep 17 00:00:00 2001 From: Lei Yan Date: Tue, 4 Apr 2017 18:23:57 +0000 Subject: Change scatterplot title font size --- wqflask/wqflask/static/new/javascript/scatterplot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/static/new/javascript/scatterplot.js b/wqflask/wqflask/static/new/javascript/scatterplot.js index de7b7906..d7f2a4a5 100644 --- a/wqflask/wqflask/static/new/javascript/scatterplot.js +++ b/wqflask/wqflask/static/new/javascript/scatterplot.js @@ -166,7 +166,7 @@ scatterplot = function() { maxx = xlim[1]; yticks = yticks != null ? yticks : ys.ticks(nyticks); xticks = xticks != null ? xticks : xs.ticks(nxticks); - titlegrp = g.append("g").attr("class", "title").append("text").attr("x", margin.left + width / 2).attr("y", margin.top - titlepos).style("fill", "black").style("font-size", "28px").text(title); + titlegrp = g.append("g").attr("class", "title").append("text").attr("x", margin.left + width / 2).attr("y", margin.top - titlepos).style("fill", "black").style("font-size", "24px").text(title); xaxis = g.append("g").attr("class", "x axis"); xaxis.selectAll("empty").data(xticks).enter().append("line").attr("x1", function(d) { return xscale(d); -- cgit v1.2.3 From ee12e6b6fd1365c3d8dc1dc8f65a494ca6c6312a Mon Sep 17 00:00:00 2001 From: Lei Yan Date: Thu, 4 May 2017 15:57:42 +0000 Subject: renamed: gn2_lei.conf -> gn2-lei.conf --- wqflask/other_config/nginx_conf/gn2-lei.conf | 41 ++++++++++++++++++++++++++++ wqflask/other_config/nginx_conf/gn2_lei.conf | 41 ---------------------------- 2 files changed, 41 insertions(+), 41 deletions(-) create mode 100644 wqflask/other_config/nginx_conf/gn2-lei.conf delete mode 100644 wqflask/other_config/nginx_conf/gn2_lei.conf (limited to 'wqflask') diff --git a/wqflask/other_config/nginx_conf/gn2-lei.conf b/wqflask/other_config/nginx_conf/gn2-lei.conf new file mode 100644 index 00000000..893ad435 --- /dev/null +++ b/wqflask/other_config/nginx_conf/gn2-lei.conf @@ -0,0 +1,41 @@ +server { + # Modeled after http://flask.pocoo.org/docs/deploying/wsgi-standalone/ + listen 80; + + server_name gn2-lei.genenetwork.org; + + access_log /var/log/nginx/lei_access.log; + error_log /var/log/nginx/lei_error.log; + + location ^~ /css/ { + root /gene/wqflask/wqflask/static/; + } + + location ^~ /javascript/ { + root /gene/wqflask/wqflask/static/; + } + +# location ^~ /image/ { +# root /gene/wqflask/wqflask/static/; +# } + + location ^~ /images/ { + root /gene/wqflask/wqflask/static/; + } + + ### New - added by Sam + #location ^~ /static/ { + # root /gene/wqflask/wqflask/static/; + #} + + location / { + proxy_pass http://127.0.0.1:5001/; + proxy_redirect off; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_read_timeout 40m; + } +} diff --git a/wqflask/other_config/nginx_conf/gn2_lei.conf b/wqflask/other_config/nginx_conf/gn2_lei.conf deleted file mode 100644 index 6589d298..00000000 --- a/wqflask/other_config/nginx_conf/gn2_lei.conf +++ /dev/null @@ -1,41 +0,0 @@ -server { - # Modeled after http://flask.pocoo.org/docs/deploying/wsgi-standalone/ - listen 80; - - server_name gn2_lei.genenetwork.org; - - access_log /var/log/nginx/lei_access.log; - error_log /var/log/nginx/lei_error.log; - - location ^~ /css/ { - root /gene/wqflask/wqflask/static/; - } - - location ^~ /javascript/ { - root /gene/wqflask/wqflask/static/; - } - -# location ^~ /image/ { -# root /gene/wqflask/wqflask/static/; -# } - - location ^~ /images/ { - root /gene/wqflask/wqflask/static/; - } - - ### New - added by Sam - #location ^~ /static/ { - # root /gene/wqflask/wqflask/static/; - #} - - location / { - proxy_pass http://127.0.0.1:5001/; - proxy_redirect off; - - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - - proxy_read_timeout 40m; - } -} -- cgit v1.2.3 From 6b64fd15c96da58a5a8119ac6d0d50efb6fc1ef7 Mon Sep 17 00:00:00 2001 From: Lei Yan Date: Mon, 8 May 2017 04:08:56 +0000 Subject: corr_scatter_plot update (use nvd3) --- wqflask/wqflask/correlation/corr_scatter_plot.py | 1 + .../wqflask/static/new/css/corr_scatter_plot2.css | 19 ++++++ .../new/javascript/draw_corr_scatterplot-2.js | 74 ++++++++++++++++++++++ wqflask/wqflask/templates/corr_scatterplot.html | 57 ++++++++++++++--- 4 files changed, 143 insertions(+), 8 deletions(-) create mode 100644 wqflask/wqflask/static/new/css/corr_scatter_plot2.css create mode 100644 wqflask/wqflask/static/new/javascript/draw_corr_scatterplot-2.js (limited to 'wqflask') diff --git a/wqflask/wqflask/correlation/corr_scatter_plot.py b/wqflask/wqflask/correlation/corr_scatter_plot.py index 96afef1e..6a92c501 100644 --- a/wqflask/wqflask/correlation/corr_scatter_plot.py +++ b/wqflask/wqflask/correlation/corr_scatter_plot.py @@ -89,3 +89,4 @@ class CorrScatterPlot(object): line_color = line_color, line_width = line_width ) + self.jsdata = self.js_data diff --git a/wqflask/wqflask/static/new/css/corr_scatter_plot2.css b/wqflask/wqflask/static/new/css/corr_scatter_plot2.css new file mode 100644 index 00000000..92e777c2 --- /dev/null +++ b/wqflask/wqflask/static/new/css/corr_scatter_plot2.css @@ -0,0 +1,19 @@ +.nvd3 .nv-axis.nv-x text { + font-size: 16px; + font-weight: normal; + fill: black; +} + +.nvd3 .nv-axis.nv-y text { + font-size: 16px; + font-weight: normal; + fill: black; +} + +.nv-y .tick.zero line { + stroke: black; +} + +.nv-y .nv-axis g path.domain { + stroke: black; +} diff --git a/wqflask/wqflask/static/new/javascript/draw_corr_scatterplot-2.js b/wqflask/wqflask/static/new/javascript/draw_corr_scatterplot-2.js new file mode 100644 index 00000000..7a5a86bd --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/draw_corr_scatterplot-2.js @@ -0,0 +1,74 @@ +var chart; + +nv.addGraph(function() { + // + chart = nv.models.scatterChart(); + // + chart.showLegend(false); + chart.duration(300); + chart.color(d3.scale.category10().range()); + chart.pointRange([200,0]); + // + // chart.showDistX(true); + // chart.showDistY(true); + chart.xAxis.tickFormat(d3.format('.02f')); + chart.yAxis.tickFormat(d3.format('.02f')); + // chart.showXAxis(false); + // chart.showYAxis(false); + chart.xAxis.axisLabel(js_data.trait_1); + chart.yAxis.axisLabel(js_data.trait_2); + // + xmin = d3.min(js_data.data[0]); + xmax = d3.max(js_data.data[0]); + xrange = xmax - xmin; + ymin = d3.min(js_data.data[1]); + ymax = d3.max(js_data.data[1]); + yrange = ymax - ymin; + chart.xDomain([xmin - xrange/10, xmax + xrange/10]); + chart.yDomain([ymin - yrange/10, ymax + yrange/10]); + // + d3.select('#scatterplot2 svg').datum(nv.log(getdata())).call(chart); + nv.utils.windowResize(chart.update); + return chart; +}); + +function getdata () { + var data = []; + data.push({ + values: [], + slope: js_data.slope, + intercept: js_data.intercept + }); + for (j = 0; j < js_data.data[0].length; j++) { + data[0].values.push({ + x: js_data.data[0][j], + y: js_data.data[1][j], + size: 10, + shape: 'circle' + }); + } + return data; +} + +function randomData(groups, points) { + var data = [], + shapes = ['circle'], + random = d3.random.normal(); + for (i = 0; i < groups; i++) { + data.push({ + key: 'Group ' + i, + values: [], + slope: Math.random() - .01, + intercept: Math.random() - .5 + }); + for (j = 0; j < points; j++) { + data[i].values.push({ + x: random(), + y: random(), + size: Math.random(), + shape: shapes[j % shapes.length] + }); + } + } + return data; +} diff --git a/wqflask/wqflask/templates/corr_scatterplot.html b/wqflask/wqflask/templates/corr_scatterplot.html index 810f4ca3..4464025e 100644 --- a/wqflask/wqflask/templates/corr_scatterplot.html +++ b/wqflask/wqflask/templates/corr_scatterplot.html @@ -7,6 +7,8 @@ + + {% endblock %} {% block content %} @@ -47,10 +49,48 @@ --> -
num overlap | {{jsdata.num_overlap}} |
---|---|
slope | {{jsdata.slope}} |
intercept | {{jsdata.intercept}} |
r value | {{jsdata.r_value}} |
p value | {{jsdata.p_value}} |