cetz
cetz copied to clipboard
canvas: Support custom coordinate systems
Proposal: Add the option to use custom coordinates by providing an option to register a callback for "pre-resolving" coordinates.
Motivation: Being able to handle plot/axis coordinates differently than "normal" coordinates in cetz-plot. But this feature could also be used to implement a tangent system on paths etc. I have not looked at the sources of fletcher, but it may be interesting to them, too.
Rebased on master.
Is there any additional work needing doing on this?
Is there any additional work needing doing on this?
No, but we lose stack traces for bad coordinates.
The problem with stack traces is, that the Typst Web-App does not show them anyway. So
I guess panic is enough to hint the user. If Typst gave the option to get some kind of “stack trace handle” that you can use with panic, that would be great.
I want to get this into 0.4.0 and I am willing to sacrifice the stack traces for having this feature. I guess we can add better stack-traces/errors with a later PR or release.
The current coordinate validation isn't that helpful anyway, as wrong element names etc. are missing the correct code location.