Skip to content
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

Add name argument to shape functions #27

Open
3 tasks
paulvollmer opened this issue May 25, 2018 · 2 comments
Open
3 tasks

Add name argument to shape functions #27

paulvollmer opened this issue May 25, 2018 · 2 comments

Comments

@paulvollmer
Copy link

Context:

at the moment the shape fuctions like rect set the shape name to a hard coded name. if a user want to set a name for a shape it is not possible at the moment

Solution:

add an optional argument name to all shape functions to support custom names. then we can change the following lines of the shapes to:

shape.setName(name ? name : 'Rectangle');

Next steps:

  • implement feature
  • document feature
  • test feature
@jacopocolo
Copy link
Owner

Hi! Could you give me an example of a use case? Do you often end up with too many shapes and you need a way to distinguish them?

It was a very intentional decision not to allow this to maintain as much consistently as possible with p5.js. Of course, it could be an optional argument of each function but I still want to hear how this feature would be useful.

Thanks!

@paulvollmer
Copy link
Author

if you do some dataviz with the plugin it is good to know which shape is which data item. if you can give the shape a name it's easier to select from the layer panel. i can understand your decision to implement only the processing shape arguments for the functions.

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

No branches or pull requests

2 participants