Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for p5.Table.getArray() #2692

Merged
merged 4 commits into from
Mar 12, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/io/p5.Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,32 @@ p5.Table.prototype.getObject = function(headerColumn) {
*
* @method getArray
* @return {Array}
* @example
* <div class="no render">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There shouldn't be a space between "no" and "render" otherwise they are actually two classes .no and .render instead of one class .norender.

* <code>
* // Given the CSV file "mammals.csv"
* // in the project's "assets" folder
* //
* // id,species,name
* // 0,Capra hircus,Goat
* // 1,Panthera pardus,Leoperd
* // 2,Equus zebra,Zebra
* var table;
* function preload() {
* // table is comma separated value "CSV"
* // and has specifiying header for column labels
* table = loadTable('assets/mammals.csv', 'csv', 'header');
* }
* function setup() {
* var tableArray = table.getArray();
* for (var i = 0; i < tableArray.length; i++) {
* print(tableArray[i]);
* }
* }
* </code>
* </div>
*@alt
* no image displayed
*/
p5.Table.prototype.getArray = function() {
var tableArray = [];
Expand Down