From fe41348fbe7eee5a0d05a8b750b79bf7a54374a0 Mon Sep 17 00:00:00 2001 From: selvam1991 Date: Fri, 11 Jul 2014 21:38:53 +0530 Subject: [PATCH 1/3] minor code refactoring. bugfix for sample List popup --- js/appModel.coffee | 13 ++++++++----- js/vis/vis.js | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/js/appModel.coffee b/js/appModel.coffee index 45d848c..1f13f3f 100644 --- a/js/appModel.coffee +++ b/js/appModel.coffee @@ -825,20 +825,23 @@ socr.model = -> getRSampleCount: -> _count + ### + # App goes back to pristine state. + ### reset: (option) -> if option isnt "undefined" and option is "samples" socr.dataStore.removeObject "bootstrapGroup" - #setting the global random sample count to 0 - socr.model.setRSampleCount 0 else #all values deleted socr.dataStore.removeObject "all" + #reset K + socr.model.setK() - #setting the global random sample count to 0 - socr.model.setRSampleCount 0 - return + #setting the global random sample count to 0 + socr.model.setRSampleCount 0 + return true ### diff --git a/js/vis/vis.js b/js/vis/vis.js index 8a2f9fe..10f30e3 100644 --- a/js/vis/vis.js +++ b/js/vis/vis.js @@ -289,7 +289,7 @@ socr.vis = (function(){ g.select(".y.axis") .call(yAxis); - if(typeof settings.datum != undefined){ + if(typeof settings.datum != "undefined"){ addBar(); From 5978333e82fb86ceaab889fe2befc8339bd11b96 Mon Sep 17 00:00:00 2001 From: selvam1991 Date: Fri, 11 Jul 2014 21:41:36 +0530 Subject: [PATCH 2/3] bugfix: x-axis overflow removed --- css/bootstrap.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/bootstrap.css b/css/bootstrap.css index fee37ec..7371031 100644 --- a/css/bootstrap.css +++ b/css/bootstrap.css @@ -281,7 +281,7 @@ a:hover { [class*="span"] { float: left; min-height: 1px; - margin-left: 20px; + /*margin-left: 20px;*/ } .container, From 72ee3a6bcfa5e6f5c74ea78832f34c3b080cd716 Mon Sep 17 00:00:00 2001 From: selvam1991 Date: Sat, 22 Nov 2014 19:43:44 +0530 Subject: [PATCH 3/3] fix: increasing card render time to 70ms. fixing the issue when first 2 cards dont show up. --- js/exp/cardExp.js | 7 ++----- js/exp/core.js | 8 ++++++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/js/exp/cardExp.js b/js/exp/cardExp.js index c3559be..8b97537 100644 --- a/js/exp/cardExp.js +++ b/js/exp/cardExp.js @@ -1,5 +1,3 @@ -/* - Playing Card Experiment Revised from Distributome Card Experiment into a separate module @@ -29,7 +27,6 @@ function _dealCard(){ if (_tempK < _K){ var _datum=_d[_tempK][_tempN]; _hand[_count].setValue(_datum); - console.log(typeof _datum); _datasetValues[_tempK][_tempN]=_datasetKeys[_tempK][_tempN]=_datum; _count++; _tempN++; @@ -125,7 +122,7 @@ return{ _d[i] = sample(_deck, _n, 0); } - _stepID = setInterval(_dealCard, 20); + _stepID = setInterval(_dealCard, 70); }, reset:function(){ @@ -222,4 +219,4 @@ return{ return {"height":_height,"width":_width}; } }//return -}(); \ No newline at end of file +}(); diff --git a/js/exp/core.js b/js/exp/core.js index c939816..de262b7 100644 --- a/js/exp/core.js +++ b/js/exp/core.js @@ -231,8 +231,12 @@ function Card(canvas){ this.denomination = this.value - 13 * (this.suit - 1); ctx.drawImage(cardImages, (this.denomination - 1) * width, (this.suit - 1) * height, width, height, 0, 0, width, height); } - //else if (this.value == 0) ctx.drawImage(cardImages, 2 * width, 4 * height, width, height, 0, 0, width, height); - else ctx.clearRect(0, 0, width, height); + else if (this.value == 0){ + ctx.drawImage(cardImages, 2 * width, 4 * height, width, height, 0, 0, width, height); + } + else{ + ctx.clearRect(0, 0, width, height); + } } }