Skip to content

Transform

Christopher Nikkel edited this page Sep 4, 2017 · 3 revisions

Transform

Definition

type Transform =
    | Matrix of A: Length * B: Length * C: Length * D: Length * E: Length * F: Length
    | Translate of X: Length * Y: Length option
    | Scale of X: Length * Y: Length option
    | Rotate of Angle: float * Point: ((Length * Length) option)
    | SkewX of Angle: float
    | SkewY of Angle: float

Description

Transform is used to create a SVG transform.

Functions

Function Signature Description
Transform.createMatrix Length * Length * Length * Length * Length * Length -> Transform create a matrix transform
Transform.createTranslate Length -> Transform create a translation transform
Transform.createScale Length -> Transform create a scale transform
Transform.createRotate float -> (Length * Length) option -> Transform create a rotate transform
Transform.createSkewX float -> Transform create a transform to skew the X axis
Transform.createSkewY float -> Transform create a transform to skew the Y axis
Transform.withX Length -> Transform -> Transform used with rotate to add a X attribute
Transform.withY Length -> Transform -> Transform used with rotate, scale, and translate to add a Y attribute
Transform.toString Transform -> string converts the transform to a string

Usage

Example

Output

Table of Contents

Getting Started

Fundamentals

Basic SVG Elements

Advanced Elements

Experimental

Clone this wiki locally