API Docs for:
Show:

Axis Class

Defined in: src/core/axis.js:15
Module: core
Parent Module: multigraph

Axis is a Jermaine model that controls Multigraph axes.

Constructor

Axis

(
  • Orientation
)

Defined in src/core/axis.js:15

Parameters:

  • Orientation AxisOrientation

Methods

distanceToPoint

(
  • x
  • y
)

Compute the distance from an axis to a point. The point (x,y) is expressed in pixel coordinates in the same coordinate system as the axis.

We use two different kinds of computations depending on whether the point lies inside or outside the region bounded by the two lines perpendicular to the axis through its endpoints. If the point lies inside this region, the distance is simply the difference in the perpendicular coordinate of the point and the perpendicular coordinate of the axis.

If the point lies outside the region, then the distance is the L2 distance between the point and the closest endpoint of the axis.

Parameters:

  • x Object
  • y Object

hasDataMax

() Boolean

Convenience method for checking to see if dataMax has been set or not.

Returns:

Boolean:

hasDataMin

() Boolean

Defined in src/core/axis.js:77

Convenience method for checking to see if dataMin has been set or not

Returns:

Boolean:

prepareRender

(
  • graphicsContext
)

Decides which labeler to use: take the one with the largest density <= 0.8. Unless all have density > 0.8, in which case we take the first one. This assumes that the labelers list is ordered in increasing order of label density. This function sets the currentLabeler and currentLabelDensity attributes.

Parameters:

  • graphicsContext Object

Properties

dataMax

DataValue

The current max DataValue for the axis.

dataMin

DataValue

Defined in src/core/axis.js:69

The current min DataValue for the axis.

max

String

Defined in src/core/axis.js:94

Stores the "max" value from the mugl file as a string, if there was one.

min

String

Defined in src/core/axis.js:60

Stores the "min" value from the mugl file as a string, if there was one.