elm-community/typed-svg/2.0.1

NOTE: this package is not compatible with Elm 0.19.1

TypedSvg.Attributes.InEm

This module exposes all Length attributes (x, y, width, etc.) as em-based attributes. It's used as a shortcut so that it becomes unnecessary to prefix each numeric length with the em function.

Example:

import Html exposing (Html)
import Color
import TypedSvg exposing (svg, rect)
import TypedSvg.Attributes exposing (viewBox, fill, stroke)
import TypedSvg.Attributes.InEm exposing (x, y, width, height, strokeWidth)


type Msg
    = NoOp


type alias Model =
    Int


view : Model -> Html Msg
view model =
    svg
        [ viewBox 0 0 800 600
        ]
        [ rect
            [ x 15
            , y 15
            , width 20
            , height 20
            , fill Color.white
            , strokeWidth 0.5
            , stroke Color.black
            ]
            []
        ]

Common Length Attributes

x : Float -> Attribute msg
y : Float -> Attribute msg
r : Float -> Attribute msg
width : Float -> Attribute msg
height : Float -> Attribute msg
strokeWidth : Float -> Attribute msg

Text

fontSize : Float -> Attribute msg
textLength : Float -> Attribute msg

Marker

markerWidth : Float -> Attribute msg
markerHeight : Float -> Attribute msg

Other

cx : Float -> Attribute msg
cy : Float -> Attribute msg
dx : Float -> Attribute msg
dy : Float -> Attribute msg
fx : Float -> Attribute msg
fy : Float -> Attribute msg
rx : Float -> Attribute msg
ry : Float -> Attribute msg
x1 : Float -> Attribute msg
y1 : Float -> Attribute msg
x2 : Float -> Attribute msg
y2 : Float -> Attribute msg