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

plot: Plot Annotations #336

Merged
merged 3 commits into from
Dec 3, 2023
Merged

plot: Plot Annotations #336

merged 3 commits into from
Dec 3, 2023

Conversation

johannes-wolf
Copy link
Member

@johannes-wolf johannes-wolf commented Nov 18, 2023

Implements cetz-package/cetz-plot#4 partly (in plot coordinates).

This PR adds add-annotation to allow drawing in plots. The plot also gets resized to the drawing if it exceeds the axis bounds.

In addition, it fixes place-anchors, which raised an error because elements are not dictionaries anymore.

@johannes-wolf johannes-wolf force-pushed the plot-annotations branch 3 times, most recently from 95ab379 to 6f8cab9 Compare November 19, 2023 08:07
@johannes-wolf johannes-wolf added this to the 0.2 milestone Nov 20, 2023
@johannes-wolf johannes-wolf changed the title Plot Annotations plot: Plot Annotations Nov 20, 2023
Copy link
Member

@fenjalien fenjalien left a comment

Choose a reason for hiding this comment

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

Looks good but an example would be nice

src/lib/plot/annotation.typ Outdated Show resolved Hide resolved
Comment on lines +19 to +34
/// - resize (bool): If true, the plots axes get adjusted to contain the annotation
/// - padding (none,number,dictionary): Annotation padding that is used for axis
/// adjustment
/// - background (bool): If true, the annotation is drawn behind all plots, in the background.
/// If false, the annotation is drawn above all plots.
Copy link
Member

Choose a reason for hiding this comment

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

Could these be put into a style?

Copy link
Member Author

Choose a reason for hiding this comment

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

Does not really make sense imho., as all three depend on the plot/data and are in plot units (padding).

@johannes-wolf johannes-wolf force-pushed the plot-annotations branch 4 times, most recently from cfb1839 to a8b8255 Compare December 3, 2023 15:14
@johannes-wolf johannes-wolf changed the base branch from 0.2.0 to readd-function-documentation December 3, 2023 15:32
Base automatically changed from readd-function-documentation to 0.2.0 December 3, 2023 16:28
@johannes-wolf johannes-wolf merged commit 40477d2 into 0.2.0 Dec 3, 2023
1 of 2 checks passed
@johannes-wolf johannes-wolf deleted the plot-annotations branch December 3, 2023 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants