Skip to content

Latest commit

 

History

History
35 lines (33 loc) · 645 Bytes

svg.md

File metadata and controls

35 lines (33 loc) · 645 Bytes
id title
svg
SVG

SVG just works when using the h function for creating virtual nodes. SVG elements are automatically created with the appropriate namespaces.

VNode* vnode = h("div", Children {
  h("svg",
    Data(
      Attrs {
        {"width", "100"},
        {"height", "100"}
      }
    ),
    Children {
      h("circle",
        Data(
          Attrs {
            {
              {"cx", "50"},
              {"cy", "50"},
              {"r", "40"},
              {"stroke", "green"},
              {"stroke-width", "4"},
              {"fill", "yellow"}
            }
          }
        )
      )
    }
  )
});