Skip to content

Add class example #4

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add class example #4

wants to merge 1 commit into from

Conversation

pearmini
Copy link
Contributor

@pearmini pearmini commented Jul 4, 2025

@ksen0 Hi Kit, how's everything going? As I mentioned before, I’m working on a data storytelling library for p5.js called p5.viz.js. After our discussion, I want to implement something like this:

let barY;

function setup() {
  barY = new p5.BarY();
}

However, I noticed that there isn’t an example in index.js showing how to bind a class to the p5 namespace, so I looked through the p5.js 2.0 source code and figured out how it works. I thought it might be helpful to add an example in index.js for future reference — that’s what this PR is for. Please let me know if this is the right approach.

Also, if you have a moment, I’d really appreciate it if you could take a look at this PR charming-art/p5.viz.js#1, which adds a bar chart to p5.viz.js. I’d love your feedback on whether the API design aligns with the p5.js style, and any other suggestions you might have!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant