xxxxxxxxxx
var foo; // p5.Plot() object
var myArr = [-1, 0, 10, 50, -33, 2.5, 0];
var myObj = [{stuff: 50, things: 20}, {stuff: 55, things: 33}, {stuff: 33, things: 45}, {stuff: 60, things: 12}, {stuff: 30, things: 90}];
function setup() {
createCanvas(windowWidth, windowHeight);
background(255);
// CONSTRUCTOR:
foo = new p5.Plot({left: width*0.2, top: height*0.3, right: width*0.8, bottom: height*0.7});
// PLOT COMMAND:
foo.plot({ type: 'point', data: myArr});
//foo.plot({ type: 'point', data: myObj});
}
function draw() {
background(255);
foo.redraw();
foo.hover(mouseX, mouseY, 'point');
}