UI-SVG attributeValue of an attributeName?

And that is why I tagged you Steve :wink:

  • I was indeed thinking about getting all the information from the client-side DOM tree:

    image

    The advantage is that you get the correct values. But you get N values (so N output messages) because there are N svg drawings visible at the moment. Where N can be zero...

  • But like you say, the information could also be get on the server-side. Something like this I assume:

    image

    The advantage is that there is always 1 output message with the data.
    But I think a lot of things should be implemented:

    • A DOM tree should be available on the server-side. Think we could use e.g. npm package @svgdotjs/svg.js, which allows the SVG string to be imported.
    • But this also means that this server-side DOM tree should be always in sync with the server side DOM tree(s). So when an input message will be injected (e.g. to change an attribute value of an element), then the server side DOM tree should also be updated. So the whole message handling stuff should be moved to a js file, to make sure the same function can be used on both client and server side (and we just need to pass the correct dom tree instance as input for that function).

And then indeed there is also the problem of the animated values. But I think we can use the animVal instead of the baseVal for animated attributes??

Anyway seems quite some work to me. Although I understand that it could be useful...

Any thoughts?

1 Like