MAIDR Documentation - v3.39.0
    Preparing search index...

    Class SmoothTraceSvgXY

    Represents a smooth trace with SVG coordinates for rendering data points using svg_x and svg_y values.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    observers: Observer<TraceState>[]
    id: string
    type: TraceType
    title: string
    xAxis: string
    yAxis: string
    fill: string
    navigationService: NavigationService
    layer: MaidrLayer
    supportsExtrema: true

    Abstract property that subclasses must implement to indicate extrema support

    rotorSupport: true
    movable: MovableGraph
    points: LinePoint[][]
    lineValues: number[][]
    highlightValues: SVGElement[][] | null
    highlightCenters:
        | {
            x: number;
            y: number;
            row: number;
            col: number;
            element: SVGElement;
        }[]
        | null
    min: number[]
    max: number[]

    Accessors

    • get isInitialEntry(): boolean

      Returns boolean

    • set isInitialEntry(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isOutOfBounds(): boolean

      Returns boolean

    • set isOutOfBounds(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get values(): number[][]

      Returns number[][]

    • get state(): TraceState

      Get the state for this smooth trace. Overrides the parent state to set plotType to 'smooth' for proper identification in instruction text and layer announcements.

      Returns TraceState

      The trace state with plotType set to 'smooth'

    Methods

    • Gets safe row and column indices to prevent accessing undefined values

      Returns { row: number; col: number }

      Object with safe row and column indices

    • Moves left in rotor mode, optionally filtering by lower or higher values.

      Parameters

      • Optional_mode: "lower" | "higher"

        Optional mode for filtering (lower or higher)

      Returns boolean

      Error always - subclasses must override this method

    • Moves right in rotor mode, optionally filtering by lower or higher values.

      Parameters

      • Optional_mode: "lower" | "higher"

        Optional mode for filtering (lower or higher)

      Returns boolean

      Error always - subclasses must override this method

    • Moves to the nearest point at the specified coordinates (used for hover functionality).

      Parameters

      • x: number

        The x-coordinate

      • y: number

        The y-coordinate

      Returns void

    • Checks if the specified coordinates are within bounds of the element.

      Parameters

      • x: number

        The x-coordinate

      • y: number

        The y-coordinate

      • element: { element: SVGElement; row: number; col: number }

        Object containing the SVG element and its position

        • element: SVGElement

          The SVG element to check bounds against

        • row: number

          The row position of the element

        • col: number

          The column position of the element

      Returns boolean

      True if the point is in bounds, false otherwise

    • Returns { x: number; y: number; row: number; col: number; element: SVGElement }[] | null

    • Parameters

      • x: number
      • y: number

      Returns { element: SVGElement; row: number; col: number } | null

    • Move the line plot to the position that matches the given X value

      Parameters

      • xValue: XValue

        The X value to move to

      Returns boolean

      true if the position was found and set, false otherwise

    • Base implementation of navigation in HIGHER and LOWER modes of ROTOR, default is no-op Needs to be implemented in Line, Bar, Heatmap, Candlestick

      Parameters

      • direction: string
      • type: "lower" | "higher"

      Returns boolean

    • Parameters

      • a: number

        Utility function to compare point values for rotor functionality

      • b: number
      • type: "lower" | "higher"

      Returns boolean

      boolean value

    • Moves up in rotor mode, optionally filtering by lower or higher values.

      Parameters

      • Optional_mode: "lower" | "higher"

        Optional mode for filtering (lower or higher)

      Returns boolean

      Error always - subclasses must override this method

    • Moves down in rotor mode, optionally filtering by lower or higher values.

      Parameters

      • Optional_mode: "lower" | "higher"

        Optional mode for filtering (lower or higher)

      Returns boolean

      Error always - subclasses must override this method

    • Maps data points to SVG circle elements using svg_x and svg_y coordinates from the data.

      Parameters

      • Optionalselectors: string[]

        Optional array of CSS selectors for line elements

      Returns SVGElement[][] | null

      Array of SVG element arrays for each line, or null if selectors are invalid or all mappings failed