-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade the included version of grunt-contrib-jshint so that global variables may be specified on a per-file bases.
- Loading branch information
1 parent
07e25ca
commit 0baa5a1
Showing
56 changed files
with
778 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var col = new Miso.Dataset.Column({ | ||
name: 'inoculated', | ||
type: 'boolean', | ||
data: [true, false, false, true] | ||
}); | ||
|
||
log(col.data); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var col = new Miso.Dataset.Column({ | ||
name: 'amount', | ||
type: 'number', | ||
data: [2, 3, '4'] | ||
}); | ||
|
||
log (col.data); | ||
col.coerce(); | ||
log (col.data); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var col = new Miso.Dataset.Column({ | ||
name: 'inoculated', | ||
type: 'boolean', | ||
data: [true, false, false, true] | ||
}); | ||
|
||
log (col.numericAt(0)); | ||
log (col.numericAt(1)); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 } | ||
] | ||
}); | ||
|
||
var ds2 = new Miso.Dataset({ | ||
url: '/data/simple.json' | ||
}); | ||
|
||
log( ds instanceof Miso.Dataset ); | ||
log( ds2 instanceof Miso.Dataset ); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 } | ||
] | ||
}); | ||
ds.fetch({ | ||
success: function() { | ||
this.addColumn({ | ||
type: 'string', | ||
name: 'four' | ||
}); | ||
|
||
log(this.columnNames()); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 } | ||
] | ||
}); | ||
ds.fetch({ | ||
success: function() { | ||
this.add({ one: 44, two: 9 }); | ||
log( this.column('two').data ); | ||
log( this.column('three').data ); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 }, | ||
{ one : 2, two : 5, three : 8 } | ||
] | ||
}).fetch({ | ||
success: function() { | ||
log( this.column('one').data ); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 }, | ||
{ one : 2, two : 5, three : 8 } | ||
] | ||
}); | ||
ds.fetch({ | ||
success: function() { | ||
log(this.column('two').data); | ||
|
||
this.remove(function(row) { | ||
return row.three === 7; | ||
}); | ||
|
||
log(this.column('two').data); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 }, | ||
{ one : 2, two : 5, three : 8 } | ||
] | ||
}); | ||
|
||
ds.fetch({ | ||
success: function() { | ||
log( this.column('two').data ); | ||
this.reset(); | ||
log( this.column('two').data ); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 }, | ||
{ one : 2, two : 5, three : 8 } | ||
] | ||
}); | ||
|
||
ds.fetch({ | ||
success: function() { | ||
|
||
log(this.column('two').data); | ||
|
||
// update just the first row | ||
var firstRow = this.rowByPosition(0); | ||
this.update({ _id : firstRow._id, one : 100 }); | ||
|
||
log(this.rowByPosition(0)); | ||
|
||
// update all rows where col three == 7 | ||
this.update(function(row) { | ||
if (row.three === 7) { | ||
row.two = 99; | ||
return row; | ||
} else { | ||
return false; | ||
} | ||
}); | ||
|
||
log(this.column('two').data); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 }, | ||
{ one : 2, two : 5, three : 8 } | ||
] | ||
}); | ||
|
||
ds.fetch({ | ||
success: function() { | ||
log(this.columnNames()); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 }, | ||
{ one : 2, two : 5, three : 8 } | ||
] | ||
}); | ||
|
||
ds.fetch({ | ||
success: function() { | ||
log(this.column('one').data); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 }, | ||
{ one : 2, two : 5, three : 8 } | ||
] | ||
}); | ||
|
||
ds.fetch({ | ||
success: function() { | ||
var oneTwo = this.columns(['one','two']); | ||
log(this.columnNames()); | ||
log(oneTwo.columnNames()); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 }, | ||
{ one : 2, two : 5, three : 8 }, | ||
{ one : 1, two : 5, three : 8 } | ||
] | ||
}); | ||
|
||
ds.fetch({ | ||
success: function() { | ||
log(this.countBy('one').toJSON()); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 }, | ||
{ one : 2, two : 5, three : 8 } | ||
] | ||
}); | ||
|
||
ds.fetch({ | ||
success: function() { | ||
this.eachColumn(function(colName, colObject, index) { | ||
log(colName); | ||
}); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
var ds = new Miso.Dataset({ | ||
data : [ | ||
{ one : 12, two : 40}, | ||
{ one : 1, two : 40}, | ||
{ one : 102, two : 430} | ||
] | ||
}); | ||
ds.fetch({ | ||
success : function() { | ||
this.each(function(row) { | ||
log(JSON.stringify(row)); | ||
}); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 }, | ||
{ one : 2, two : 5, three : 8 }, | ||
{ one : 6, two : 8, three : 55 } | ||
] | ||
}); | ||
|
||
ds.fetch({ | ||
success: function() { | ||
log(this.groupBy('one', ['two'])); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 }, | ||
{ one : 2, two : 5, three : 8 } | ||
] | ||
}); | ||
ds.fetch({ | ||
success : function() { | ||
log(this.hasColumn('three')); | ||
log(this.hasColumn('otter')); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 }, | ||
{ one : 2, two : 5, three : 8 }, | ||
{ one : 6, two : 8, three : 55 } | ||
] | ||
}); | ||
|
||
ds.fetch({ | ||
success: function() { | ||
log( "Column 'one' max: " + this.max('one') ); | ||
log( "Column 'two' max: " + this.max('two') ); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 }, | ||
{ one : 2, two : 5, three : 8 }, | ||
{ one : 6, two : 8, three : 55 } | ||
] | ||
}); | ||
|
||
ds.fetch({ | ||
success: function() { | ||
log( "Column 'one' mean: " + this.mean('one') ); | ||
log( "Column 'three' mean: " + this.mean('three') ); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 }, | ||
{ one : 2, two : 5, three : 8 }, | ||
{ one : 6, two : 8, three : 55 } | ||
] | ||
}); | ||
|
||
ds.fetch({ | ||
success: function() { | ||
log( "Column 'one' min: " + this.min('one') ); | ||
log( "Column 'two' min: " + this.min('two') ); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
var ds = new Miso.Dataset({ | ||
data : [ | ||
{ one : 12, two : 4}, | ||
{ one : 1, two : 40}, | ||
{ one : 102, two : 430} | ||
] | ||
}); | ||
ds.fetch({ | ||
success : function() { | ||
this.reverseEach(function(row) { | ||
log(JSON.stringify(row)); | ||
}); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 }, | ||
{ one : 2, two : 5, three : 8 } | ||
] | ||
}); | ||
|
||
ds.fetch({ | ||
success: function() { | ||
var rowOneID = this.column('_id').data[1]; | ||
log(ds.rowById(rowOneID)); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 }, | ||
{ one : 2, two : 5, three : 8 } | ||
] | ||
}); | ||
ds.fetch({ | ||
success : function() { | ||
log(ds.rowByPosition(1)); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var ds = new Miso.Dataset({ | ||
data: [ | ||
{ one : 1, two : 4, three : 7 }, | ||
{ one : 2, two : 5, three : 8 } | ||
] | ||
}); | ||
|
||
ds.fetch({ | ||
success: function() { | ||
|
||
var rowTwo = ds.rows(function(row) { | ||
return row.one === 2; | ||
}); | ||
|
||
log(rowTwo.columnNames()); | ||
log(rowTwo.length); | ||
} | ||
}); |
Oops, something went wrong.