Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Range

A range of events in a time series specified by an anchor point and a span

Hierarchy

  • Range

Index

Constructors

constructor

  • Create a new Range instance

    Parameters

    • anchor: Point

      the anchor point

    • span: Point

      the span

    Returns Range

Properties

Readonly anchor

anchor: Point

The anchor point of the range

Readonly span

span: Point

The end point of the range

Methods

equals

  • equals(other: any): boolean
  • Check if the Range is equal to another object

    Parameters

    • other: any

      the other object

    Returns boolean

    true if the other object is a Range and is equal

from

  • from(start: number | Date): Range
  • Create a new Range with the same span but a new anchor at a given time or event count

    throws

    an IllegalArgumentError if the start is negative

    throws

    a NullValueError if the start is null or undefined

    Parameters

    • start: number | Date

      the starting anchor

    Returns Range

    a new Range object

fromLast

  • fromLast(count: number): Range
  • Create a new Range with the same span but a new anchor at a given event count before the end of the time series.

    throws

    an IllegalArgumentError if the count is negative

    throws

    a NullValueError if the count is null or undefined

    Parameters

    • count: number

      the offset from the end of the time series

    Returns Range

    a new Range object

fromLastMillis

  • fromLastMillis(timespan: number): Range
  • Create a new Range with the same span but a new anchor at a given timespan before the end of the time series.

    throws

    an IllegalArgumentError if the timespan is negative

    throws

    a NullValueError if the timespan is null or undefined

    Parameters

    • timespan: number

      the timespan from the end of the time series

    Returns Range

    a new Range object

fromStart

  • Create a new Range with the same span but anchored at the beginning of the time series

    Returns Range

    a new Range object

next

  • next(count: number): Range
  • Create a new Range with the same anchor but a span containing a fixed number of events.

    throws

    an IllegalArgumentError if the count is negative

    throws

    a NullValueError if the count is null or undefined

    Parameters

    • count: number

      the number of events in the span

    Returns Range

    a new Range object

nextMillis

  • nextMillis(timespan: number): Range
  • Create a new Range with the same anchor but a span covering a fixed timespan.

    throws

    an IllegalArgumentError if the timespan is negative

    throws

    a NullValueError if the timespan is null or undefined

    Parameters

    • timespan: number

      the timespan covered by the range

    Returns Range

    a new Range object

previous

  • previous(count: number): Range
  • Create a new Range with the same anchor but a span containing a fixed number of events before the anchor.

    throws

    an IllegalArgumentError if the count is negative

    throws

    a NullValueError if the count is null or undefined

    Parameters

    • count: number

      the number of events in the span

    Returns Range

    a new Range object

previousMillis

  • previousMillis(timespan: number): Range
  • Create a new Range with the same anchor but a span covering a fixed timespan before the anchor.

    throws

    an IllegalArgumentError if the timespan is negative

    throws

    a NullValueError if the timespan is null or undefined

    Parameters

    • timespan: number

      the timespan covered by the range

    Returns Range

    a new Range object

to

  • to(sequence: number | Date): Range
  • Create a new Range with the same anchor but a new span at a given time or event count

    throws

    an IllegalArgumentError if the sequence is negative

    throws

    a NullValueError if the sequence is null or undefined

    Parameters

    • sequence: number | Date

      the end anchor

    Returns Range

    a new Range object

toStart

  • Create a new Range with the same anchor but ending at the beginning of the time series

    Returns Range

    a new Range object

untilLast

  • untilLast(count: number): Range
  • Create a new Range with the same anchor but a new end point at a given event count before the end of the time series.

    throws

    an IllegalArgumentError if the count is negative

    throws

    a NullValueError if the count is null or undefined

    Parameters

    • count: number

      the offset from the end of the time series

    Returns Range

    a new Range object

untilLastMillis

  • untilLastMillis(timespan: number): Range
  • Create a new Range with the same anchor but a new end point at a given timespan before the end of the time series.

    throws

    an IllegalArgumentError if the timespan is negative

    throws

    a NullValueError if the timespan is null or undefined

    Parameters

    • timespan: number

      the timespan from the end of the time series

    Returns Range

    a new Range object

Copyright © 2025 DiffusionData Ltd. All Rights Reserved.