GithubHelp home page GithubHelp logo

Comments (4)

meyfa avatar meyfa commented on July 26, 2024

I see your point. It would probably make sense to merge the SVGNodeContainer features into SVGNode then, as there would be no real need for completely child-less elements, right?

P.S. SVGTitle constructor added in 34401ed.

from php-svg.

rorso avatar rorso commented on July 26, 2024

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.
https://www.w3.org/TR/SVG11/svgdtd.html

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.

from php-svg.

rorso avatar rorso commented on July 26, 2024

... it's on this page: https://sterntaufe.astronomie.at/select.php

from php-svg.

meyfa avatar meyfa commented on July 26, 2024

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 SVGNodeContainer as you proposed. Getting rid of the SVGNode/SVGNodeContainer separation altogether would make sense but it'd require a rather big refactoring and isn't strictly necessary right now.

from php-svg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.