Options
All
  • Public
  • Public/Protected
  • All
Menu

Transform allows an SVGElement to be scaled, rotated, and translated from its original positioning. This is incredibly valuable when working with Group elements that contain related Shapes.

The underlying data represents a Matrix as covered in linear algebra. For more information see:

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform

Hierarchy

  • Transform

Index

Properties

Methods

Properties

Static DEFAULT

DEFAULT: Transform = new Transform()

Methods

copy

rotate

  • Rotates the Transform object by an amount specified in radians.

    Parameters

    • a: number

    Returns Transform

scale

  • Scales the Transform by some x and optional y amount. If no y amount is given the scaling is constant in both dimensions. Returns a new Transform object, does not mutate the Transform object the scale method was called on.

    Parameters

    • x: number
    • Optional y: number

    Returns Transform

toMatrix

  • toMatrix(): string
  • Helper method used by the transform attribute in the SVG's HTML tag.

    Returns string

translate

  • translate(x: number, y?: number): Transform
  • Offsets the Transform by some amount x and y. Returns a new Transform object, does not mutate the Transform object it is called on.

    Parameters

    • x: number
    • Optional y: number

    Returns Transform

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc