I imagine there's a way to do this, but I can't find it for the life of me.
I want to add my own attributes to the rendered objects. For example, if I'm rendering an SVG, to add stroke-dasharray as an attribute.
There's nothing about it in the docs, the closest thing I came across wasmanualas a last parameter inPath, but this isn't available inPolygon` for me to try.
You sure can! Here it is:
var path = two.makePath(...);
two.update(); // You have to force the renderer to update so the element will be created.
var elem = path._renderer.elem; // The SVG Element
elem.setAttribute('custom-attr', customValue);
Hope that makes sense!
Ah, wonderful. Thank you very much.
Most helpful comment
You sure can! Here it is:
Hope that makes sense!