friedbrice / elm-teaching-tools / 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 generate events of type e and can be drawn on a Screen.

rectangle : { topLeft : ( Basics.Float, Basics.Float ), width : Basics.Float, height : Basics.Float, radius : Basics.Float, border : Maybe ( Basics.Float, ElmTeachingTools.Lib.Color.Color ), fill : Maybe ElmTeachingTools.Lib.Color.Color, onClick : Maybe e } -> Graphic e

circle : { center : ( Basics.Float, Basics.Float ), radius : Basics.Float, border : Maybe ( Basics.Float, ElmTeachingTools.Lib.Color.Color ), fill : Maybe ElmTeachingTools.Lib.Color.Color, onClick : Maybe e } -> Graphic e

line : { start : ( Basics.Float, Basics.Float ), end : ( Basics.Float, Basics.Float ), border : ( Basics.Float, ElmTeachingTools.Lib.Color.Color ), onClick : Maybe e } -> Graphic e

curve : { start : ( Basics.Float, Basics.Float ), end : ( Basics.Float, Basics.Float ), control : ( Basics.Float, Basics.Float ), border : ( Basics.Float, ElmTeachingTools.Lib.Color.Color ), onClick : Maybe e } -> Graphic e

Screen


type alias Screen e =
Browser.Document e

A web page consisting of a screen that can generate events of type e and onto which Graphics can be drawn.

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

Create a Screen.