friedbrice/elm-teaching-tools/1.0.0

NOTE: the latest version is 1.0.1

ElmTeachingTools.Lib.Graphics

A library with functions for putting graphics on the screen.

Graphical elements

type alias Graphic e =
Svg e

A "scaled vector graphic" that can be drawn on a Screen.

{ topLeft : ( Float, Float )
, width : Float
, height : Float
, radius : Float
, border : Maybe ( Float, Color )
, fill : Maybe Color
, onClick : Maybe e
}
-> Graphic e
{ center : ( Float, Float )
, radius : Float
, border : Maybe ( Float, Color )
, fill : Maybe Color
, onClick : Maybe e
}
-> Graphic e
{ start : ( Float, Float )
, end : ( Float, Float )
, border : ( Float, Color )
, onClick : Maybe e
}
-> Graphic e
{ start : ( Float, Float )
, end : ( Float, Float )
, control : ( Float, Float )
, border : ( Float, Color )
, onClick : Maybe e
}
-> Graphic e

Screen

type alias Screen e =
Document e

A web page consisting of a screen onto which Graphics can be drawn.

{ title : String
, widthPx : Int
, heightPx : Int
, xMax : Float
, yMax : Float
, children : List (Graphic e)
}
-> Screen e

Create a Screen.