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

Rework Plot Axes #479

Merged
merged 7 commits into from
Feb 14, 2024
Merged

Rework Plot Axes #479

merged 7 commits into from
Feb 14, 2024

Conversation

johannes-wolf
Copy link
Member

@johannes-wolf johannes-wolf commented Jan 21, 2024

Some cleanup of the axis drawing code. More refactoring should follow, but in a follow-up PR.

Axis styling documentation is not good yet!
New features:

  • Per axis coloring for scientific plots
  • Axis padding for both scientific and school-book plots
  • Axis "overshoot" for school-book plots
  • Customizable axis, tick and grid z-layer
  • One can disable the shared "0" tick

I am not happy with the shared "0" tick drawing, this should get improved!

@johannes-wolf johannes-wolf self-assigned this Jan 21, 2024
@johannes-wolf johannes-wolf marked this pull request as draft January 21, 2024 13:52
@johannes-wolf johannes-wolf force-pushed the cetz-328-plot-axis-configuration branch 8 times, most recently from b51873c to 669fc82 Compare January 30, 2024 22:44
@johannes-wolf johannes-wolf marked this pull request as ready for review January 30, 2024 22:44
@johannes-wolf johannes-wolf force-pushed the cetz-328-plot-axis-configuration branch 2 times, most recently from 8877540 to eb68e4e Compare January 30, 2024 23:17
@johannes-wolf johannes-wolf added this to the 0.2.1 milestone Jan 30, 2024
@johannes-wolf johannes-wolf force-pushed the cetz-328-plot-axis-configuration branch from d1d91a3 to a850be9 Compare January 31, 2024 16:48
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.

Are you happy with the state of axes.typ? I haven't focused on it as I don't mind but I can take a closer look/be more picky if you want.

Are you going to fix the docs in this PR?

UPdate the changelog!

src/draw/grouping.typ Outdated Show resolved Hide resolved
src/lib/axes.typ Show resolved Hide resolved
src/lib/axes.typ Outdated Show resolved Hide resolved
src/process.typ Outdated Show resolved Hide resolved
tests/chart/ref.png Outdated Show resolved Hide resolved
@johannes-wolf
Copy link
Member Author

he docs in this PR?

No, I am not yet happy but would like to do further changes later.
Docs for styling are now added (although they are quite minimal).

johannes-wolf added a commit that referenced this pull request Feb 11, 2024
Allows passing `none` or `ctx => {}` to grouping functions (`group`,
`on-layer`, ...).
This is very useful when having conditional draw commands insides a
group.

Example:
```
group(ctx => {
  if .. {
    // If this does not get evaluated, cetz currently fails because the group returned `none`.
    // Current workaround is writing () at the end of such groups to auto-join an empty array.
  }
})
```

This PR is an improved implementation of the one rejected from #479.
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.

Make sure to rebase this first, as resolve-body is still in grouping.typ

@johannes-wolf johannes-wolf force-pushed the cetz-328-plot-axis-configuration branch 3 times, most recently from fde49a9 to 3b1b913 Compare February 14, 2024 18:18
@johannes-wolf johannes-wolf merged commit 4b203d1 into master Feb 14, 2024
1 check passed
@johannes-wolf johannes-wolf deleted the cetz-328-plot-axis-configuration branch February 14, 2024 18:28
@johannes-wolf johannes-wolf linked an issue Feb 16, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants