Show Menu

Elm 1.1.0 Graphics Cheat Sheet by

Standard Elm Graphics.*
programming     graphics     forms     paths     shapes     elm     linestyle     elements

Unstru­ctured Graphics

coll­age : Int -> Int -> List Form -> Element

Creating Forms

filled : Color -> Shape -> Form
grad­ient : Gradient -> Shape -> Form
outl­ined : LineS­tyle -> Shape -> Form
text­ured : String -> Shape -> Form
toForm : Element -> Form
traced : LineS­tyle -> Path -> Form

Grouping Forms

group : List Form -> Form
grou­pTr­ans­form : Trans­form2D -> List Form -> Form

Shapes

circle : Float -> Shape
circle­(ra­dius)
ngon : Int -> Float -> Shape
ngon(s­ides, radius)
oval : Float -> Float -> Shape
oval(w­idth, height)
poly­gon : List (Float, Float) -> Shape
Specify a list of points of the polygon. Shape will automa­tically close.
rect : Float -> Float -> Shape
rect(w­idth, height)
square : Float -> Shape
square­(ed­ge_­length)

Images

image : Int -> Int -> String -> Element
image(­width, height, src)
fitt­edI­mage : Int -> Int -> String -> Element
fitted­Ima­ge(­width, height, src)
crop­ped­Image : (Int, Int) -> Int -> Int -> String -> Element
croppe­dIm­age­(or­igin, width, height, src)
tile­dIm­age : Int -> Int -> String -> Element
tiledI­mag­e(w­idth, height, src)

Element Inspection

widt­hOf : Element -> Int
heig­htOf : Element -> Int
sizeOf : Element -> (Int, Int)

Layout Aliases

layers : List ELement -> Element
layers == flow outward
above : Element -> Element -> Element
a above b
below : Element -> Element -> Element
a below b
beside : Element -> Element -> Element
a beside b

Layout

flow : Direc­tion -> List Element -> Element
right : Direc­tion
+X
up : Direc­tion
+Y
outw­ard : Direc­tion
+Z
left : Direc­tion
-X
down : Direc­tion
-Y
inward : Direc­tion
-Z
 

Transf­orming Forms

alpha : Float -> Form -> Form
move : (Float, Float) -> Form -> Form
moveX : Float -> Form -> Form
moveY : Float -> Form -> Form
rotate : Float -> Form -> Form
scale : Float -> Form -> Form

Paths

segm­ent : (Float, Float) -> (Float, Float) -> Path
path : List (Float, Float) -> Path

Line Style Types

type alias LineStyle = {
  color:Color,
  width:Float,
  cap:LineCap,
  join:LineJoin,
  dashing:List Int,
  dashOffset:Int
}

type LineCap
  = Flat
  | Round
  | Padded

type LineJoin
  = Smooth
  | Sharp Float
  | Clipped

Line Styles

dashed : Color -> LineS­tyle
defa­ult­Line : LineS­tyle
dotted : Color -> LineS­tyle
solid : Color -> LineS­tyle

Element Styling

width : Int -> Element -> Element
height : Int -> Element -> Element
size : Int -> Int -> Element -> Element
color : Color -> Element -> Element
opac­ity : Float -> Element -> Element
opacity (0.0:t­ran­sparent - 1.0:op­aque)
link : String -> Element -> Element
create Element that is a hyper-link
tag : String -> Element -> Element
similar to <a> with ID

Positi­oning Elements

empty : Element
flow down [ img1, if showMore then img2 else empty ]
spacer : Int -> Int -> Element
Empty Box
cont­ainer : Int -> Int -> Position -> Element -> Element
Put an element in a container. By setting the color of the container, you can create borders.

Named Positions

topLeft : Position
midTop : Position
topRight : Position
--------------------
midLeft : Position
middle : Position
midRight : Position
--------------------
bottomLeft : Position
midBottom : Position
bottomRight : Position

Download the Elm 1.1.0 Graphics Cheat Sheet

100 Pages
//media.cheatography.com/storage/thumb/citguy_elm-1-1-0-graphics.750.jpg

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!

 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Regular Expressions Cheat Sheet
          PHP Cheat Sheet

          More Cheat Sheets by CITguy

          jasmine JS testing Cheat Sheet
          Extending Ruby with C - Part 1 Cheat Sheet
          *nix users and groups Cheat Sheet