danielnarey/elm-semantic-dom/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

Dom.Svg

This module contains helper functions for constructing Dom.Type.Element records with the SVG namespace designation. Use these functions for any SVG tags in your Dom.

Dom.Node constructors

These constructors wrap VirtualDom.node, with the same pattern as the functions in the Dom.Node module

leaf : String -> List (Property msg) -> Node msg

Construct a leaf node in the SVG namespace

textWrapper : String -> List (Property msg) -> String -> Node msg

Construct a node with internal text in the SVG namespace

container : String -> List (Property msg) -> List (Node msg) -> Node msg

Construct a node in the SVG namespace that contains other nodes

Dom.Element constructors

element : String -> Element msg

Construct an element record in the SVG namespace, with the tag given as a string argument; same pattern as Dom.Element.leaf

"circle"
  |> Dom.Svg.element
wrapNodes : String -> List (Node msg) -> Element msg

Wrap a list of SVG nodes in an SVG container element; the first argument gives the tag, and the second argument gives a list of child nodes

myPolygonNodes
  |> Dom.Svg.wrapNodes "g"