You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 in plot/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), and draw-axes (responsible for drawing the axes).
make-ctx now supplies an array axes rather than separately providing x and y, as a more general solution for when higher dimensional plots are implemented. It must also provide compute-fill-paths and compute-stroke-paths (previously supplied by the util.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 under plot.add.<name>, and plot.add has become plot.add.xy to disambiguate.
The school-book axis style remains unimplemented but I hope to bring it back at a later stage
Refactor the refactor: In moving code around a lot, boilerplate code has become prominent. It has been left in this PR because it does not adversely affect the implementation of features, but it is something that will need seeing to as a final step before merging this branch into main
Update the manual: Currently failing CI due to having not updated the manual.
Change axis styles from being modules to being dictionaries and a constructor to allow for a finer grained control over how any axis style is rendered
Axis Styles
Currently tracked are orthrect-2d and polar-2d. Wanted are: barycentric-2d, polar-3d, and orthorect-3d.
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
To do and Tracking:
aggressive-refactor
branch (Aggressive refactoring #27)Axis Styles
Currently tracked are
orthrect-2d
andpolar-2d
. Wanted are:barycentric-2d
,polar-3d
, andorthorect-3d
.Orthorect-2d (previously
scientific
axis style)Polar-2d (previously
scientific-polar
)Plot elements
add.xy
for plotting continuous/continuous data.cetz-plot/src/chart.typ
Line 1 in cb8505b
There are many more plot elements to introduce too, so if anything needs adding to the list, we should.
The text was updated successfully, but these errors were encountered: