add few missing svg elements#5742
Conversation
There was a problem hiding this comment.
Greptile Summary
This PR adds comprehensive SVG element support to the Reflex framework by expanding the media.py module with 22 new SVG element classes and enhancing existing ones. The changes significantly improve SVG capabilities by adding essential elements for text manipulation (TSpan, TextPath), reusability (Use, Symbol), visual effects (Pattern, Mask, ClipPath), animations (Animate, AnimateMotion, AnimateTransform, Set), and metadata (Desc, Title, Metadata).
The implementation follows Reflex's established patterns by wrapping SVG elements as Python classes with typed attributes, making SVG development more accessible to Python developers. Each new element class inherits from the appropriate base class and defines relevant SVG-specific attributes like href, path_length, and view_box. The base Svg class receives important additions including view_box, preserve_aspect_ratio, and transform attributes that are fundamental for SVG positioning and scaling.
All new elements are properly registered in both the SVG namespace mapping and module-level exports, ensuring they integrate seamlessly with Reflex's component system. The corresponding type stub files (.pyi) have been updated as reflected in the pyi_hashes.json changes, maintaining type safety and IDE support. This enhancement brings Reflex's SVG support much closer to full SVG specification compliance.
Confidence score: 4/5
- This PR is safe to merge with good confidence as it adds new functionality without breaking existing code
- Score reflects comprehensive additions following established patterns, though the large scope increases complexity
- Pay close attention to the media.py file to ensure all new SVG elements are properly implemented and exported
2 files reviewed, no comments
CodSpeed Performance ReportMerging #5742 will not alter performanceComparing Summary
|
masenf
left a comment
There was a problem hiding this comment.
is this just for completeness? or is the LLM generating these kind of structures?
|
react flow has a few of those in their examples |
No description provided.