Is there svg builders in "kotlinx.html"? line, pat...
# announcements
l
Is there svg builders in "kotlinx.html"? line, path and so on? Writing
Copy code
inline fun Document.createSVG(tagName: String) =
    createElementNS("<http://www.w3.org/2000/svg>", tagName)

fun svgG() = document.createSVG("g").unsafeCast<SVGGElement>()
fun svgLine() = document.createSVG("line").unsafeCast<SVGLineElement>()
   
 val g = svgG().apply {
        setAttribute("id", id)
    }
    g.appendChild(svgLine().apply {
        setAttribute("x1", "11")
        setAttribute("y1", "11")
        setAttribute("x2", "3")
        setAttribute("y2", "11")
        setAttribute("stroke", color)
        setAttribute("stroke-width", "2")
        setAttribute("stroke-linecap", "round")
    })
Is not funny. Can't check attribute names (