-
Notifications
You must be signed in to change notification settings - Fork 93
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
Child elements in primitives (e.g. title tag) #64
Comments
I see your point. It would probably make sense to merge the P.S. |
Unfortunately there is no official XML Schema declaration for SVG 1.1 which would define which elements may contain which sub elements - or not. But there is a DTD available to check the validity of the resulting SVG. I don't see a real problem allowing sub elements on every object, even if they would not result in a renderable SVG property. After all, it's all XML and the elements might serve for "internal use" without interfering with the validity of the produced SVG file. if you want to check how this feature is used, please visit https://sterntaufe.astronomie.at and click any of the "Vorschau im Browser (SVG)" links. Objecs are tagged with "title" elements to show their name on hovering. I meanwhile have extended the classes for some useful (for me) spline calculations. I send you my code. Maybe you find something suitable for general use. |
... it's on this page: https://sterntaufe.astronomie.at/select.php |
That's a nice project you got there! I looked through the DTD and couldn't find any element type that forbids child nodes, so I went ahead and made them all inherit from |
The graphical primitives allow for sub elements like "title". The latter usually will be used as tooltip when hovering above the element.
I cannot add a "title" to a SVGCircle, as this is not based on SVGNodeContainer but onSVGNode.
After I changed the inheritance to "SVGNodeContainer", I can successfully add a "title" that renders as expected.
However SVGTitle too lacks a good
__construct($txt="")
to be rally useful
I' opt for generally inherit the primitives from SVGNodeContainer, as this does no harm.
The text was updated successfully, but these errors were encountered: