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 multiargument method to annotations #1193

Closed
wants to merge 1 commit into from
Closed

Conversation

piever
Copy link
Contributor

@piever piever commented Aug 4, 2021

This way, users can do

annotations(rand(10), rand(10), rand(["a", "b"], 10))

which IMO is a bit simpler and plays a bit nicer with AoG (even though the previous method is now supported).

I confess I could not find the annotations doc page to add some example with this syntax, so I'm not too sure how to document it.

@jkrumbiegel
Copy link
Collaborator

annotations is actually just a wrapper for text now. I like the idea of better conversions, although I've wondered if the text shouldn't be relegated to attribute status somehow. The positions should be the positional arguments, I agree.

@piever
Copy link
Contributor Author

piever commented Aug 10, 2021

Ah, I see, so I should just add this conversion to Text? In that case maybe better to just deprecate Annotations for Text to avoid confusion.

I also like the keyword argument idea. It feels similar to scatter(x, y, marker=markers) for example. So instead of text(x, y, labels), we should maybe do text(x, y, text=labels)? What would be a good keyword name here?

From a practical point of view, how does one "consume" an attribute in a convert_arguments call?

@SimonDanisch
Copy link
Member

Ah, I see, so I should just add this conversion to Text? In that case maybe better to just deprecate Annotations for Text to avoid confusion.

Yes, and yes ;)

From a practical point of view, how does one "consume" an attribute in a convert_arguments call?

Hm, what do you mean?

@piever
Copy link
Contributor Author

piever commented Aug 24, 2021

From a practical point of view, how does one "consume" an attribute in a convert_arguments call?

Hm, what do you mean?

Never mind, I found it in the mean time, I was looking for the @keyword macro, to convert the value of a keyword argument as well during convert_argument.

Btw, do we have consensus as to whether we prefer text(x, y, labels) or text(x, y, text=labels) (or yet another keyword name)? I'm mildly in favor of the latter, but would be fine with either.

@SimonDanisch
Copy link
Member

I think we should close this and concentrate on deprecating annotations, right?

@piever
Copy link
Contributor Author

piever commented Mar 2, 2022

Yeah, agreed, closing here as annotations should probably go in the next breaking release.

@piever piever closed this Mar 2, 2022
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.

None yet

3 participants