var colors = [ '#C00', '#CC0', '#0C0', '#0CC', '#00C', '#C0C', '#600', '#660', '#060', '#066', '#006', '#606' ]; module.exports = { degree: 3, activeDistance: 9, cache: { N: [] }, setup() { this.size(600, 300); this.points = [ {x:0, y: 0}, {x:100, y:-100}, {x:200, y: 100}, {x:300, y:-100}, {x:400, y: 100}, {x:500, y: 0} ]; this.knots = this.formKnots(this.points); if(this.props.controller) { this.props.controller(this, this.knots); } this.draw(); }, draw() { this.clear(); var pad = 25; this.grid(pad); this.stroke(0); this.line(pad,0,pad,this.height); var y = this.height - pad; this.line(0,y,this.width,y); var k = this.degree; var n = this.points.length || 4; for (let i=0; i