Last active
August 29, 2015 14:15
-
-
Save karlbright/399d20cb5f303f56c3e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pullProperties = function(obj, props) { | |
return _.filter(obj, function(prop) { | |
return _.includes(props, prop); | |
}) | |
} | |
Slider.prototype.getActual = function(dataset) { | |
if(!dataset.actual) return []; | |
_.map(dataset.actual, function(item) { | |
return pullProperties(item, ['output', 'minValue','maxValue']); | |
}) | |
} | |
Slider.prototype.getIdeal = function(dataset) { | |
if(!dataset.actual) return []; | |
_.map(dataset.actual, function(item) { | |
return pullProperties(item, ['minValue','maxValue']); | |
}) | |
} | |
Slider.prototype.getIdealAndActual = function(dataset) { | |
return { | |
ideal: this.getIdeal(dataset), | |
actual: this.getActual(dataset) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment