Are there any easy ways to use SVG? #311
-
Hello 👀 i would like to know if there are any suggested methods for building SVG in the library and injecting it into It seems that svg is of type |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
You can set an SVG string as the div(()).evalTap(_.innerHtml.set(
"""
<svg height="100" width="100">
<circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
</svg>
"""
)) https://scribble.ninja/u/armanbilge/drdmunmjkdipvwmojdfhonuveoa Otherwise, we still need to add the API for SVG. It's do-able, just needs some work in fs2-dom and Calico to add the element types. |
Beta Was this translation helpful? Give feedback.
-
Oh, I think another option is to create an |
Beta Was this translation helpful? Give feedback.
-
Hi @armanbilge. hmmmm Forgive me for asking too many questions. I tried two methods: 2.I added another step after creating the required resources, but the console output was
|
Beta Was this translation helpful? Give feedback.
Hmm, instead of looking up the SVG element by id, It seems to me you can do
x.firstChild
to access the SVG element, because it is the first and only child of the div.