Adding multiple p5.js sketches with Angular 7

I am trying to make a website and in one page I am trying to integrate all my p5.js sketches into a single webpage. I have separate sketch.js files and I wanted to integrate it to the Angular project, any ideas on how to do it? Do I have to modify all the sketch.js into components? I am new to Angular, so I am not sure how to do it.

I haven’t used angular in over a year so I’m probably not the best one to answer this but I would try to use instance mode and create a component that takes in a sketch function and use new p5(sketch) to create a canvas with that sketch. That way you could pass each sketch to the multiple instances of the same component. I’m not sure how helpful that is but best of luck.

Thanks, I knew this way tho I was just looking to see if I could just have individual files and not separate component.

1 Like