diff options
author | Artem Tarasov | 2015-05-08 14:42:19 +0300 |
---|---|---|
committer | Artem Tarasov | 2015-05-08 14:42:19 +0300 |
commit | 3f3469d007c3e5ff229425911b28f24211c84301 (patch) | |
tree | 8a21a90d9d3afed2cef90b36a3bf05962e6dd3bf | |
parent | 4e6c08c51dbd2c4ec3cdf92e10f24c3987675bf8 (diff) | |
download | genenetwork2-3f3469d007c3e5ff229425911b28f24211c84301.tar.gz |
updating histogram on values' change (#28)
4 files changed, 9 insertions, 6 deletions
diff --git a/wqflask/wqflask/static/new/javascript/histogram.coffee b/wqflask/wqflask/static/new/javascript/histogram.coffee index b27a389e..68d9b5a2 100755 --- a/wqflask/wqflask/static/new/javascript/histogram.coffee +++ b/wqflask/wqflask/static/new/javascript/histogram.coffee @@ -13,10 +13,10 @@ class Histogram @y_buffer = @plot_height/20
@plot_height -= @y_buffer
- @redraw(@sample_list)
+ @get_sample_vals(@sample_list)
+ @redraw(@sample_vals)
- redraw: (sample_list) ->
- @get_sample_vals(sample_list)
+ redraw: (@sample_vals) ->
@y_min = d3.min(@sample_vals)
@y_max = d3.max(@sample_vals) * 1.1
diff --git a/wqflask/wqflask/static/new/javascript/histogram.js b/wqflask/wqflask/static/new/javascript/histogram.js index 94144661..d872a3ba 100755 --- a/wqflask/wqflask/static/new/javascript/histogram.js +++ b/wqflask/wqflask/static/new/javascript/histogram.js @@ -21,11 +21,12 @@ this.x_buffer = this.plot_width / 20; this.y_buffer = this.plot_height / 20; this.plot_height -= this.y_buffer; - this.redraw(this.sample_list); + this.get_sample_vals(this.sample_list); + this.redraw(this.sample_vals); } - Histogram.prototype.redraw = function(sample_list) { - this.get_sample_vals(sample_list); + Histogram.prototype.redraw = function(sample_vals) { + this.sample_vals = sample_vals; this.y_min = d3.min(this.sample_vals); this.y_max = d3.max(this.sample_vals) * 1.1; this.create_x_scale(); diff --git a/wqflask/wqflask/static/new/javascript/show_trait.coffee b/wqflask/wqflask/static/new/javascript/show_trait.coffee index ee57831f..1d3123ba 100755 --- a/wqflask/wqflask/static/new/javascript/show_trait.coffee +++ b/wqflask/wqflask/static/new/javascript/show_trait.coffee @@ -238,6 +238,7 @@ $ -> sample_sets['samples_all'].add_value(real_value) already_seen[name] = true console.log("towards end:", sample_sets) + root.histogram.redraw(sample_sets['samples_primary'].the_values) update_stat_values(sample_sets) show_hide_outliers = -> diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index c2dc07ee..9323862a 100755 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -265,6 +265,7 @@ } } console.log("towards end:", sample_sets); + root.histogram.redraw(sample_sets['samples_primary'].the_values); return update_stat_values(sample_sets); }; show_hide_outliers = function() { |