Classdesc

A grid class with vertical and horizontal lines (or a raster).

Note that the PlotBoilerplate already has a Grid instance member. The Grid is not meant to be added to the canvas as a drawable as it encapsulates more an abstract concept of the canvas rather than a drawable object.

Requires

Vertex

Constructors

Properties

Constructors

  • The constructor.

    Parameters

    • center: Vertex

      The offset of the grid (default is [0,0]).

    • size: Vertex

      The x- and y-size of the grid.

    Returns Grid

    Name

    Grid

Properties

center: Vertex

Member

Memberof

Grid

Instance

size: Vertex

Member

Memberof

Grid

Instance

utils: {
    baseLog: ((base, num) => number);
    mapRasterScale: ((adjustFactor, scale) => number);
} = ...

Type declaration

  • baseLog: ((base, num) => number)

    Calculate the logarithm of the given number (num) to a given base.

    This function returns the number l with

    num == Math.pow(base,l)

    Member

    baseLog

    Function

    Memberof

    Grid

    Inner

    Returns

    log(base)/log(num)
      • (base, num): number
      • Parameters

        • base: number

          The base to calculate the logarithm to.

        • num: number

          The number to calculate the logarithm for.

        Returns number

  • mapRasterScale: ((adjustFactor, scale) => number)

    Calculate the raster scale for a given logarithmic mapping.

    Example (with adjustFactor=2):

    If scale is 4.33, then the mapping is 1/2 (because 2^2 <= 4.33 <= 2^3)
    If scale is 0.33, then the mapping is 2 because (2^(1/2) >= 0.33 >= 2^(1/4)

    Member

    mapRasterScale

    Function

    Memberof

    Grid

    Inner

    Returns

      • (adjustFactor, scale): number
      • Parameters

        • adjustFactor: number

          The base for the logarithmic raster scaling when zoomed.

        • scale: number

          The currently used scale factor.

        Returns number

Memberof

Grid

Generated using TypeDoc