summaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
Diffstat (limited to 'code')
-rw-r--r--code/bostonset.js21
-rw-r--r--code/weightviswrapper.js1
2 files changed, 21 insertions, 1 deletions
diff --git a/code/bostonset.js b/code/bostonset.js
index 50b9d38..f5f1264 100644
--- a/code/bostonset.js
+++ b/code/bostonset.js
@@ -9,6 +9,7 @@ var Bostonset = (function() {
this.dataScaler.setScales([[0.00632, 0.0, 0.46, 0.0, 0.385, 3.561, 2.9, 1.1296, 1.0, 187.0, 12.6, 0.32, 1.73], [88.9762, 100.0, 27.74, 1.0, 0.871, 8.78, 100.0, 12.1265, 24.0, 711.0, 22.0, 396.9, 37.97]]);
this.targetScaler = new MinMaxScaler();
this.targetScaler.setScales([5.0, 50.0]);
+ this.readyHooks = [];
}
Bostonset.prototype.load = function(url) {
@@ -22,15 +23,33 @@ var Bostonset = (function() {
}
self.data.push(arr);
});
+ self.readyHooks.forEach(function(hook) { hook(); });
});
};
+ Bostonset.prototype.afterLoad = function(cb) {
+ if (!this.ready) {
+ this.readyHooks.push(cb);
+ } else {
+ cb();
+ }
+ };
+
+ Bostonset.prototype.attributes = function() {
+ console.log(attrs);
+ return attrs;
+ };
+
Bostonset.prototype.length = function() {
return this.data.length;
};
+ Bostonset.prototype.rawData = function(row) {
+ return this.data[row];
+ };
+
Bostonset.prototype.rawInputs = function(row) {
- return this.data[row].slice(0, -1); // leave out MEDV
+ return this.rawData(row).slice(0, -1); // leave out MEDV
};
Bostonset.prototype.inputs = function(row) {
diff --git a/code/weightviswrapper.js b/code/weightviswrapper.js
index 1f17b55..94f6306 100644
--- a/code/weightviswrapper.js
+++ b/code/weightviswrapper.js
@@ -199,6 +199,7 @@ var WeightVisWrapper = (function() {
/* helps with impress.js' stepenter/stepleave events */
// TODO move into its own file
+// TODO must be a step's direct child
var VisIntegrater = (function() {
function VisIntegrater(enterCb, leaveCb, selector) {
var self = this;