-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
canvas: Support custom coordinate systems #719
base: master
Are you sure you want to change the base?
Conversation
59f0465
to
d14797a
Compare
c23e480
to
91dd180
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually a cool idea, feels similar to the modifier plans but I don't think theres a way we can connect them somehow.
shame about how it effects the error warnings for the user
@@ -116,8 +116,6 @@ | |||
assert.eq(style.pos(), (), message: "Unexpected positional arguments: " + repr(style.pos())) | |||
style = style.named() | |||
|
|||
(a, b, c).map(coordinate.resolve-system) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think these should be removed, they help tell the user where they've entered an invalid coordinate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually I see why they've been removed, thats a really difficult trade off.
Is there a way we could keep track of how many or which draw functions have been created and let the user know about it? Essentially create our own stack trace. It probably shouldn't go in this pr but I would like to at least explore it before this pr gets approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add some trace
list to the context, that gets shown with any panic
/assert
we do. Something like element information (function name + element name, if given). This might be slow though, as we have to append and merge that list for every element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created a PR for a possible implementation of such functionality here: #726.
91dd180
to
645b111
Compare
Rebased on master. |
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.