Class UIGraphTicks

Generates a set of locations that can be used for rendering ticks on a graph. As input the class takes valid range, size of the area the ticks will be displayed on, type of ticks and minimum/maximum spacing and outputs a set of coordinates along which ticks should be positioned. Ticks are reported as multiple separate levels with different strengths, depending on how close their distribution is to the upper valid range.

Hierarchy

  • FrameworkObject
    • UIGraphTicks

Constructors

  • Constructs a new tick generating object.

    Parameters

    • OptionalstepType: EnumValue<UITickStepType, number>

      Determines how will ticks be distributed.

    • OptionalisInternalConstructor: boolean

    Returns UIGraphTicks

Accessors

  • get numLevels(): number
  • Number of tick levels that will be generated.

    Returns number

Methods

  • Returns the strength of a particular tick level. Levels are ordered in descending order of strength (level 0 is the strongest).

    Parameters

    • level: number

      Level for which to retrieve the strength. Must not be larger than getNumLevels() - 1.

    Returns number

    Strength of the ticks at this level, in range [0, 1].

  • Returns positions of all ticks of the provided level. The ticks will be within the range provided to setRange().

    Parameters

    • level: number

      Level for which to retrieve the positions. Must not be larger than getNumLevels() - 1.

    Returns number[]

    Positions of all ticks of the provided level.

  • Sets the range which ticks are to be displayed for, and the range along which the ticks will be displayed.

    Parameters

    • valueRangeStart: number

      Start of the range the ticks are to display.

    • valueRangeEnd: number

      End of the range the ticks are to display.

    • pixelRange: number

      Width or height on which the ticks will be rendered. In pixels.

    Returns void

  • Sets valid spacing between two ticks. Tick strength will be determined by how far away are they from either end of this range.

    Parameters

    • minPx: number

      Minimum spacing between two ticks, in pixels.

    • maxPx: number

      Maximum spacing between two ticks, in pixels.

    Returns void