Mitchell van Zuylen
Mitchell van Zuylen

Reputation: 4135

How to add a row to a p5 data table?

The made this question because the only related question I was able to find appears to be completely unhelpful

Let's say I have an empty p5 data table:

  data = new p5.Table();
  data.columns = ['x','y']

How do I add data to this table?

Upvotes: 0

Views: 75

Answers (1)

Mitchell van Zuylen
Mitchell van Zuylen

Reputation: 4135

The way that can be found on the docs is as follows:

let newRow = data .addRow();
newRow.setNum('x', 12);
newRow.setString('name', 'cool string');

I wonder if anybody knows a direct way by adding paramaters to the addRow function?

Upvotes: 1

Related Questions