-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: Add support for missing SVGs #3962
Conversation
Hi @ChinoUkaegbu , thanks for looking into this, can you provide some examples to test with? Will also be nice to add components for SVG radial_gradient and SVG text |
Sure thing! Just to clarify, do you mean unit tests (and if so where should I add them?) or just examples of the SVGs in use |
Yes, just examples in the PR description will do |
If you can, add some basic unit tests in They don't have to be too complicated, but at least check that create() call work, and that the result of You can use |
I'll work on radial_gradient, text and the tests in the meantime! |
|
Also just wondering if there is a reason why from the MDN docs it seems as though the value type is <length-percentage> | <number> |
Code for the radial gradient and text examples: rx.hstack(
rx.text("Radial Gradient Example", size="5"),
rx.el.svg(
rx.el.svg.defs(
rx.el.svg.radial_gradient(
rx.el.svg.stop(offset="10%", stop_color="gold"),
rx.el.svg.stop(offset="95%", stop_color="red"),
id="my_rad_grad", cx="50%", cy="50%", r="50%", fx="50%", fy="50%"
)
),
rx.el.svg.ellipse(cx="100", cy="50", rx="60", ry="40", fill="url('#my_rad_grad')")
)
),
rx.hstack(
rx.text("Text Example", size="5"),
rx.el.svg(rx.el.svg.text("This is the example", x="5", y="15", rotate="30"))
), |
I think this may be a copy+paste oversight, we should match the MDN docs |
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.
thanks for adding!
btw when i was working on this PR, the units directory in tests didn't exist so I believe test_svg.py should actually be in |
@ChinoUkaegbu sound good, we will move this in a follow up. |
Closes #3954
All Submissions:
Type of change
Please delete options that are not relevant.
New Feature Submission:
Changes To Core Features:
After these steps, you're ready to open a pull request.