Installed

elm/browser
1.0.2
elm/core
1.0.5
elm/html
1.0.0
elm/svg
1.0.1

Registry

elm/http
2.0.0
elm/random
1.0.0
elm/time
1.0.0
elm/file
1.0.5
elm/json
1.1.3
evancz/elm-playground
1.0.3
elm-explorations/webgl
1.1.3
w0rm/elm-physics
5.1.3
rtfeldman/elm-css
18.0.0
mdgriffith/elm-ui
1.1.8
​x
-- There are a lot of odd things about SVG, so always try to find examples
 
1
-- Scalable Vector Graphics (SVG) can be a nice way to draw things in 2D.
2
-- Here are some common SVG shapes.
3
--
4
-- Dependencies:
5
--   elm install elm/svg
6
--
7
​
8
​
9
import Html exposing (Html)
10
import Svg exposing (..)
11
import Svg.Attributes exposing (..)
12
​
13
​
14
main : Html msg
15
main =
16
  svg
17
    [ viewBox "0 0 400 400"
18
    , width "400"
19
    , height "400"
20
    ]
21
    [ circle
22
        [ cx "50"
23
        , cy "50"
24
        , r "40"
25
        , fill "red"
26
        , stroke "black"
27
        , strokeWidth "3"
28
        ]
29
        []
30
    , rect
31
        [ x "100"
32
        , y "10"
33
        , width "40"
34
        , height "40"
35
        , fill "green"
36
        , stroke "black"
37
        , strokeWidth "2"
38
        ]
39
        []
40
    , line
41
        [ x1 "20"
42
        , y1 "200"
43
        , x2 "200"
44
        , y2 "20"
45
        , stroke "blue"
46
        , strokeWidth "10"
47
        , strokeLinecap "round"
48
        ]
49
        []