This commit is contained in:
jllord
2013-05-27 18:35:21 -07:00
parent 57fe85f917
commit 65c5f1d14e
6 changed files with 145 additions and 72 deletions

View File

@@ -88,15 +88,32 @@ function makeTable(data, targetDiv) {
//
// // // // // // // // // // // // // // // // // // // // // // // // // //
function getGroupCount(data, groupTerm) {
function getKeywordCount(data, keyword) {
console.log(data, keyword)
var group = []
data.forEach(function (d) {
if (d.status.match(groupTerm)) group.push(d)
for(var key in d) {
var value = d[key].toString().toLowerCase()
if (value.match(keyword.toLowerCase())) group.push(d)
}
})
return group.length
if (group = []) return "0"
}
function getKeyword(data, keyword) {
console.log(data, keyword)
var group = []
data.forEach(function (d) {
for(var key in d) {
var value = d[key].toString().toLowerCase()
if (value.match(keyword.toLowerCase())) group.push(d)
}
})
return group
if (group = []) return "null"
}
function getColumnTotal(data, column){
var total = []
data.forEach(function (d) {
@@ -741,7 +758,8 @@ exports.mostFrequent = mostFrequent
exports.addUnitsLabels = addUnitsLabels
exports.getOccurance = getOccurance
exports.getMatches = getMatches
exports.getGroupCount = getGroupCount
exports.getKeyword = getKeyword
exports.getKeywordCount = getKeywordCount
exports.getColumnTotal = getColumnTotal
exports.getMax = getMax
exports.getMin = getMin