elm-community/typed-svg

Name: typed-svg

Owner: Elm Community

Description: Typed SVG library written for Elm

Created: 2017-03-16 02:41:14.0

Updated: 2018-05-21 09:11:31.0

Pushed: 2018-05-21 09:12:31.0

Homepage: null

Size: 166

Language: Elm

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

TypedSvg

TypedSvg is an Elm package that makes it more pleasant to work with SVG (Scalable Vector Graphics). It is based on nphollon's original work.

Status

TypedSvg is a work-in-progress. It intends to replace elm-lang/svg with a fully typed and documented equivalent. However, as it stands now, there is still work to be done in covering documentation for the entire (very large) SVG spec, as well as potential re-organization work in how the public modules are presented as an API.

TL;DR this package will change

Modules
Usage
rt Html exposing (Html)
rt Color
rt TypedSvg exposing (svg, circle)
rt TypedSvg.Attributes exposing (viewBox, cx, cy, r, fill, strokeWidth, stroke)
rt TypedSvg.Types exposing (Fill(..), px)


 Msg
= NoOp


 alias Model =
Int


 : Model -> Html Msg
 model =
svg
    [ viewBox 0 0 800 600
    ]
    [ circle
        [ cx (px 150)
        , cy (px 150)
        , r (px 30)
        , fill <| Fill Color.black
        , strokeWidth (px 2)
        , stroke <| Color.rgba 90 60 60 0.5
        ]
        []
    ]
Sister Packages

TypedSvg works well in conjunction with folkertdev/svg-path-dsl if you need a typed path domain-specific language.

License

Apache 2.0


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.