Skip to content

Commit

Permalink
reorganize! p5.prototype.Table -> p5.Table, separate src files, renam…
Browse files Browse the repository at this point in the history
…ed Table.columnTitles to Table.columns
  • Loading branch information
therewasaguy committed Jul 31, 2014
1 parent d4446d6 commit 08f8569
Show file tree
Hide file tree
Showing 14 changed files with 889 additions and 766 deletions.
2 changes: 2 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ module.exports = function(grunt) {
'p5.Image': 'src/objects/p5.Image',
//'p5.Shape': 'src/objects/p5.Shape',
'p5.Vector': 'src/objects/p5.Vector',
'p5.TableRow': 'src/objects/p5.TableRow',
'p5.Table': 'src/objects/p5.Table',
'color.creating_reading': 'src/color/creating_reading',
'color.setting': 'src/color/setting',
'core': 'src/core/core',
Expand Down
14 changes: 10 additions & 4 deletions examples/async/loadTable/sketch.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
var table;

function setup() {
loadTable("table.csv", helloWorld);
// println(table.getRowCount() + " total rows in table");
loadTable("table.csv", logResults);
}

function helloWorld(stuff) {
table = stuff;
function logResults(results) {
table = results;
console.log(table);
for (var i = 0; i < table.rows.length; i++) {
for (var j = 0; j < table.columns.length; j++ ) {
console.log(table.columns[j] +': '+ table.rows[i].get(j) );
}
console.log('---');
}
}
2 changes: 1 addition & 1 deletion examples/p5.Table/findRows/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var table;

function setup() {

table = new Table();
table = new p5.Table();

table.addColumn('name');
table.addColumn('type');
Expand Down
2 changes: 1 addition & 1 deletion examples/p5.Table/getColumn/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var table;

function setup() {

table = new Table();
table = new p5.Table();

table.addColumn("name");
table.addColumn("type");
Expand Down
2 changes: 1 addition & 1 deletion examples/p5.Table/matchRow/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var table;

function setup() {

table = new Table();
table = new p5.Table();

table.addColumn("name");
table.addColumn("type");
Expand Down
2 changes: 1 addition & 1 deletion examples/p5.Table/matchRows/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var table;

function setup() {

table = new Table();
table = new p5.Table();

table.addColumn("name");
table.addColumn("type");
Expand Down
2 changes: 1 addition & 1 deletion examples/p5.Table/removeTokens/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var table;

function setup() {

table = new Table();
table = new p5.Table();

table.addColumn("name");
table.addColumn("type");
Expand Down
2 changes: 1 addition & 1 deletion examples/p5.Table/trim/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var table;

function setup() {

table = new Table();
table = new p5.Table();

table.addColumn("name");
table.addColumn("type");
Expand Down
Loading

0 comments on commit 08f8569

Please sign in to comment.