What I would like is to be able to use something like the below dmx-bind:viewBox="0 {{inputOne.value}} 100 100" but this is not working (it is actually not adding the viewbox attribute.
First off all thank you for your responses.
Yes you were right about the syntax but still not working.
Even with static values ex dmx-bind:viewBox="'0 ' '0 ' 100 100'"
the viewBox attribute does not render at all.
The easiest way of thinking about things like dmx-bind is that the value your are assigning is a JavaScript variable. Strings need to be enclosed in ' ' and to join strings or variables together, you need to use a +
I will check it out a bit more. Maybe I need to dmx-bind more values since it might affect the way page is rendered. I cant seem to make the viewBox attribute to even render in the page (does not exist in the code).
I think the issue is with the viewBox attribute using uppercase letters. It’s being converted to viewbox when used with dmx-bind: which is causing the issue:
It is not possible to set svg attributes like that. They need a special way of setting, the normal setAttribute method doesn’t work there since they are in a separate NameSpace. I can take a look at the dmx-bind and see if I can update it to use setAttributeNS for these special cases.
Hey @patrick, without any pressure or anything else. You think is possible to update easily? Or should I look another way to implement this?
Thank you!
I experimented with it and it is more difficult then expected. So don’t expect something soon, if you have an other way to implement it then use that.
Hello, just an update on this. I made it possible using d3.js
Also created a video demonstrating how you can combine D3.js and Wappler.
It is a very basic example but can help you get started with SVG graphics.