API Docs for: 0.0.1
Show:

Grid Class

Defined in: lib/graphs/grid.js:29
Module: niviz

The static Grid class encompasses a few static methods to split up an axis into intervals of points in such a way that number aesthetics are preserved.

Item Index

Methods

Methods

gridify

(
  • axis
)
Object static

This function returns the points for axis labels for a given axis with values ranging from axis.min to axis.max. Both logarithmic and non-logarithmic axes are fully supported.

Parameters:

  • axis Axis

    An axis object representing the ordinate of a paramter

Returns:

Object:

Object with Array heights and min, max, height properties

hsgrid

(
  • station
  • [itop]
  • [ibottom]
  • [autoscale]
)
Object static

Split up the snow height uniformly into intervals.

Parameters:

  • station Station
  • [itop] Number optional

    Pixel value of the top

  • [ibottom] Number optional

    Pixel value of the bottom

  • [autoscale] Boolean optional

    Whether to use autoscale (default: no)

Returns:

Object:

Object with max, min, divisions, height and heights properties

hsgrid

(
  • [bottom]
  • [top]
)
Object static

Split up a given snow height interval uniformly into intervals.

Parameters:

  • [bottom] Number optional

    Bottom height

  • [top] Number optional

    Top height

Returns:

Object:

Object with max, min, divisions, height and heights properties

points

(
  • pixels
)
Number static

This function returns the number of points that should devide an axis of length 'pixels'.

Parameters:

Returns:

points

(
  • min
  • max
  • pixels
)
Object static

This function returns the min and max to be used when drawing the axis with values ranging from min to max, a pixel span of length pixels is to be utilized.

Parameters:

  • min Number

    Min value that needs to be on axis

  • max Number

    Max value that needs to be on axis

  • pixels Number

    Length of axis in pixels

Returns:

Object:

Object with min and max property

smartLegend

(
  • min
  • max
  • nb_labels
)
static

This function returns the steps to be used when drawing the axis with values ranging from minimum to maximum. Optionally a desired number of points can be handed over as third parameter.

NOTE: This function has been copied from trunk/meteoio/Graphics.cc of the MeteoIO project: see https://models.slf.ch/p/meteoio

Parameters:

  • min Number

    Min value that needs to be on axis

  • max Number

    Max value that needs to be on axis

  • nb_labels Number

    Number of labels desired

Returns:

Array The points that include min max and guarantee a nice display