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 annotations #27

Merged
merged 7 commits into from
Aug 29, 2023
Merged

Conversation

danielost
Copy link
Collaborator

@danielost danielost commented Aug 26, 2023

Worked on the issue:

The PR contains the following features:

  • Annotations layout
  • A couple of different annotation types
  • Default annotation locations

Example of an annotation:

image

@danielost danielost added the enhancement New feature or request label Aug 26, 2023
@danielost danielost linked an issue Aug 26, 2023 that may be closed by this pull request
4 tasks
@danielost danielost requested a review from noelwelsh August 26, 2023 18:55
Copy link
Contributor

@noelwelsh noelwelsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is fine as is, but there are a few places where I think it could be improved.

final case class AnnotationPosition(
landmark: Landmark,
arrowAngle: Angle,
toPoint: (Point, Double) => Point
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not obvious what this function is doing. I think it could use a bit of documentation.

)

object AnnotationPosition {
val degree90 = 1.5708
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you import doodle.syntax.all.* you can write angles using the degrees extension method. E.g. you can write 90.degrees, 180.degrees, and so on.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added a bit of documentation to clarify some things about AnnotationPosition. Also added a simple example of an annotated plot.

@danielost danielost removed a link to an issue Aug 29, 2023
4 tasks
@danielost danielost marked this pull request as ready for review August 29, 2023 15:37
Copy link
Contributor

@noelwelsh noelwelsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@danielost danielost merged commit 3865538 into creativescala:main Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

2 participants