-
Notifications
You must be signed in to change notification settings - Fork 3
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
Aggressive refactoring #27
Merged
johannes-wolf
merged 44 commits into
cetz-package:aggressive-refactoring
from
jamesrswift:agressive-refactor
Aug 1, 2024
Merged
Aggressive refactoring #27
johannes-wolf
merged 44 commits into
cetz-package:aggressive-refactoring
from
jamesrswift:agressive-refactor
Aug 1, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
johannes-wolf
merged commit Aug 1, 2024
5cec42b
into
cetz-package:aggressive-refactoring
1 check passed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When implementing logarithmic plots, and then when implementing polar plots, I ran into the challenge that the axis style has no control over how the data is plotted. This make sense if you treat axis styles as a purely visual element, however, this PR turns them into "drivers" that can change more behaviour of the underlying plot.
This is the initial PR, to allow people a better chance at collaborating on the refactor as well as to give maintainers a better chance at reviewing changes in smaller chunks rather than one hefty PR
Firstly, axis styles have been moved out of
axes.typ
(like in a previous draft PR), and instead are located inplot/axis-styles/
. They become modules which must currently provide 3 functions:make-ctx
(responsible for constructing the context within which data is prepared),data-viewport
(responsible for transforming data along any number of axes, and onto the plot itself), anddraw-axes
(responsible for drawing the axes).make-ctx
now supplies an arrayaxes
rather than separately providingx
andy
, as a more general solution for when higher dimensional plots are implemented. It must also providecompute-fill-paths
andcompute-stroke-paths
(previously supplied by theutil.typ
module) to allow for a finer grained control over clipping (of note: path computation occurs PRIOR to data-viewport transformations)Plot elements (previously
plot.add-<name>()
) are now underplot.add.<name>
, andplot.add
has becomeplot.add.xy
to disambiguate.The school-book axis style remains unimplemented but I hope to bring it back at a later stage
Tracking can be found here: #28