MAIDR JavaScript API
    Preparing search index...

    Interface LayerSwitchTraceState

    Extended trace state for layer switching mode with navigation indices.

    interface LayerSwitchTraceState {
        empty: false;
        type: "trace";
        layerId: string;
        traceType: TraceType;
        plotType: string;
        title: string;
        name?: string;
        xAxis: string;
        yAxis: string;
        z: string;
        hasMultiPoints: boolean;
        audio: AudioState;
        braille: BrailleState;
        text: TextState;
        autoplay: AutoplayState;
        highlight: HighlightState;
        intersections?: AudioState[] | null;
        groupCount?: number;
        group?: { label: string; value: string };
        orientation?: Orientation;
        startAngle?: number;
        treePosition?: {
            index: number;
            count: number;
            level: number;
            levels: number;
            parent?: string;
        };
        rugPosition?: { index: number; count: number };
        isLayerSwitch: true;
        index: number;
        size: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    empty: false
    type: "trace"
    layerId: string

    Unique identifier for the layer/trace

    traceType: TraceType
    plotType: string
    title: string
    name?: string

    What this layer is, when the producer named it — see MaidrLayer.name. Announced on a layer switch in place of the trace type, which cannot tell two layers of one kind apart.

    xAxis: string

    The x axis label the layer authored; empty when it authored none, or a blank one -- as FigureState does. Point announcements use the trace's own generic fallback, not this.

    yAxis: string

    The y axis label the layer authored, or empty. See xAxis.

    z: string
    hasMultiPoints: boolean
    audio: AudioState
    braille: BrailleState
    text: TextState
    autoplay: AutoplayState
    highlight: HighlightState
    intersections?: AudioState[] | null

    Array of audio states for all lines that intersect at the current point. Used for intersection-aware audio playback in multiline plots. null/undefined for normal points (single line or no intersection).

    groupCount?: number

    Number of groups/series in the plot. Only present for multiline plots where plotType === 'multiline'.

    group?: { label: string; value: string }

    Label and name of the group/series the cursor is currently on, e.g. { label: 'Group', value: 'Series 1' }. Only present for multiline plots (plotType === 'multiline') whose data names its groups; absent when the spec authors no names, so consumers can omit group wording rather than announce a positional placeholder.

    orientation?: Orientation

    Plot orientation, if applicable (e.g. bar, box, violin).

    startAngle?: number

    Where the first slice of a pie begins, in degrees clockwise from 12 o'clock, as the layer declared it (see MaidrLayer.startAngle). Present only for a pie, whose position announcement places each slice on the dial from here.

    treePosition?: {
        index: number;
        count: number;
        level: number;
        levels: number;
        parent?: string;
    }

    Where a tree's node sits among the siblings the arrow keys walk, and at which level. Present for a tree, whose braille grid and pan run across the whole depth -- every node at it, whoever its parent -- while left and right stop at the parent's last child, so neither says where the reader is; and for a directed graph, whose scopes nest as a tree's levels do. index and level are zero-based; parent is the parent's name, absent at the top level.

    rugPosition?: { index: number; count: number }

    Which observation of a rug the cursor is on, of how many, in the order the arrow keys walk them: ascending along the axis. Present only for a rug, whose pan follows where the tick is drawn and whose braille grid counts the ticks in each bin, so neither says which observation the reader is on. index is zero-based.

    isLayerSwitch: true
    index: number
    size: number