@antv/coord

  • Version 0.4.7
  • Published
  • 294 kB
  • 3 dependencies
  • MIT license

Install

npm i @antv/coord
yarn add @antv/coord
pnpm add @antv/coord

Overview

Toolkit for mapping elements of sets into geometric objects.

Index

Classes

class Coordinate

class Coordinate {}

    constructor

    constructor(options?: Partial<Options>);
    • Create a new Coordinate Object.

      Parameter options

      Custom options

    method clear

    clear: () => void;
    • Clear transformations and update.

    method clone

    clone: () => Coordinate;
    • Returns a new Coordinate with same options.

      Returns

      Coordinate

    method getCenter

    getCenter: () => [number, number];
    • Returns the center of the bounding box of the coordinate.

      Returns

      [centerX, centerY, centerZ]

    method getOptions

    getOptions: () => Options;
    • Returns current options.

      Returns

      options

    method getSize

    getSize: () => [number, number];
    • Returns the size of the bounding box of the coordinate.

      Returns

      [width, height]

    method invert

    invert: (vector: Vector2 | Vector) => Vector2 | Vector;
    • Apples invert transformations for the current vector.

      Parameter vector

      transformed vector2

      Parameter vector

      original vector2

    method map

    map: (vector: Vector2 | Vector) => Vector2 | Vector;
    • Apples transformations for the current vector.

      Parameter vector

      original vector2

      Returns

      transformed vector2

    method transform

    transform: (...args: Transformation) => this;
    • Add selected transformation.

      Parameter args

      transform type and params

      Returns

      Coordinate

    method update

    update: (options: Partial<Options>) => void;
    • Update options and inner state.

      Parameter options

      Options to be updated

    class Coordinate3D

    class Coordinate3D {}

      constructor

      constructor(options?: Partial<Options3D>);
      • Create a new Coordinate Object.

        Parameter options

        Custom options

      method clear

      clear: () => void;
      • Clear transformations and update.

      method clone

      clone: () => Coordinate3D;
      • Returns a new Coordinate with same options.

        Returns

        Coordinate

      method getCenter

      getCenter: () => [number, number, number];
      • Returns the center of the bounding box of the coordinate.

        Returns

        [centerX, centerY, centerZ]

      method getOptions

      getOptions: () => Options3D;
      • Returns current options.

        Returns

        options

      method getSize

      getSize: () => [number, number, number];
      • Returns the size of the bounding box of the coordinate.

        Returns

        [width, height, depth]

      method invert

      invert: (vector: Vector3 | Vector) => import('gl-matrix').vec3 | Vector;
      • Apples invert transformations for the current vector.

        Parameter vector

        transformed vector3

        Parameter vector

        original vector3

      method map

      map: (vector: Vector3 | Vector) => import('gl-matrix').vec3 | Vector;
      • Apples transformations for the current vector.

        Parameter vector

        original vector3

        Returns

        transformed vector3

      method transform

      transform: (...args: Transformation3D) => this;
      • Add selected transformation.

        Parameter args

        transform type and params

        Returns

        Coordinate

      method update

      update: (options: Partial<Options3D>) => void;
      • Update options and inner state.

        Parameter options

        Options to be updated

      Type Aliases

      type Matrix3

      type Matrix3 = mat3;

        type Options

        type Options = {
        x?: number;
        y?: number;
        width?: number;
        height?: number;
        transformations?: Transformation[];
        };

          type Transformation

          type Transformation =
          | Translate
          | Cartesian
          | Custom
          | Matrix
          | Polar
          | Transpose
          | Scale
          | ShearX
          | ShearY
          | Reflect
          | ReflectX
          | ReflectY
          | Rotate
          | Helix
          | Parallel
          | Fisheye
          | FisheyeX
          | FisheyeY
          | FisheyeCircular;

            type Transformation3D

            type Transformation3D = Cartesian3D | Translate3D | Scale3D | Transpose3D;

              type Vector

              type Vector = number[];

                type Vector2

                type Vector2 = [number, number];

                  type Vector3

                  type Vector3 = vec3;

                    Package Files (4)

                    Dependencies (3)

                    Dev Dependencies (21)

                    Peer Dependencies (0)

                    No peer dependencies.

                    Badge

                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@antv/coord.

                    • Markdown
                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@antv/coord)
                    • HTML
                      <a href="https://www.jsdocs.io/package/@antv/coord"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>