This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
1.0.0 1.0.1
Geometry Utilities
version 1.0.1
license BSD3
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.2
Committed At 2018-02-13 23:05:11 UTC
elm-lang/svg 2.0.0 <= v < 3.0.0 2.0.0
elm-lang/html 2.0.0 <= v < 3.0.0 2.0.0
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1

README

Geometry

This package defines two top level geometric structures, LineSegment and Shape that can be manipulated and rendered in to SVG. A shape can be a Rect or an Ellipse:

type Shape
    = Rect ShapeData
    | Ellipse ShapeData


type alias ShapeData =
    { center : Vector
    , dimensions : Vector
    , strokeColor : ColorRecord
    , fillColor : ColorRecord
    }

Here is how a typical Shape is created:

redColor = ColorRecord 255 0 0 1.0

ellipse = Ellipse (ShapeData (Vector 1 0) (Vector 2 2) redColor redColor)

One can move and rescale shapes:

moveTo (Vector 10 5) ellipse

scaleBy 2 ellipse

Here is how to render an ellipse into SVG:

draw ellipse

See the examples folder for demo code.