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

    Interface MaidrLayer

    Layer/trace definition containing plot type, data, and rendering configuration.

    interface MaidrLayer {
        id: string;
        type: TraceType;
        title?: string;
        selectors?: string | string[] | CandlestickSelector | BoxSelector[];
        orientation?: Orientation;
        domMapping?: {
            order?: "row" | "column";
            groupDirection?: "forward" | "reverse";
            iqrDirection?: "forward" | "reverse";
        };
        axes?: { x?: AxisConfig; y?: AxisConfig; z?: AxisConfig };
        violinOptions?: ViolinOptions;
        data:
            | HeatmapData
            | BarPoint[]
            | BoxPoint[]
            | CandlestickPoint[]
            | HistogramPoint[]
            | LinePoint[][]
            | ScatterPoint[]
            | SegmentedPoint[][]
            | SmoothPoint[][]
            | ViolinKdePoint[][];
    }
    Index

    Properties

    id: string
    type: TraceType
    title?: string
    selectors?: string | string[] | CandlestickSelector | BoxSelector[]
    orientation?: Orientation
    domMapping?: {
        order?: "row" | "column";
        groupDirection?: "forward" | "reverse";
        iqrDirection?: "forward" | "reverse";
    }

    Optional DOM mapping hints. When provided, individual traces can opt-in to use these hints to map DOM elements to the internal row-major data grid without changing default behavior when omitted.

    Type Declaration

    • Optionalorder?: "row" | "column"

      Specify DOM flattening order for grid-like traces. 'row' => row-major, 'column' => column-major.

    • OptionalgroupDirection?: "forward" | "reverse"

      For segmented/dodged bars, control the per-column group/level iteration. 'forward' => iterate groups top-to-bottom (as previously domOrder='forward'). 'reverse' => iterate bottom-to-top (default).

    • OptionaliqrDirection?: "forward" | "reverse"

      For boxplots, control the Q1/Q3 edge mapping for IQR box. 'forward' => Q1=bottom, Q3=top (default for vertical) 'reverse' => Q1=top, Q3=bottom (for Base R vertical boxplots)

    axes?: { x?: AxisConfig; y?: AxisConfig; z?: AxisConfig }

    Axis configuration. Every axis (x, y, z) is specified as an AxisConfig object with an optional label, optional grid navigation properties (min, max, tickStep), and optional per-axis format.

    // Basic labels
    axes: { x: { label: "Date" }, y: { label: "Price" } }
    // With per-axis formatting
    axes: {
    x: { label: "Date" },
    y: { label: "Price", format: { type: "currency", decimals: 2 } }
    }
    // With grid navigation (scatter)
    axes: {
    x: { label: "Sepal Length", min: 4.3, max: 7.9, tickStep: 0.7 },
    y: { label: "Sepal Width", min: 2, max: 4.4, tickStep: 0.5 }
    }
    violinOptions?: ViolinOptions

    Optional display configuration for violin plot layers (VIOLIN_KDE and VIOLIN_BOX). Controls which summary statistics are shown in the violin box overlay.

    data:
        | HeatmapData
        | BarPoint[]
        | BoxPoint[]
        | CandlestickPoint[]
        | HistogramPoint[]
        | LinePoint[][]
        | ScatterPoint[]
        | SegmentedPoint[][]
        | SmoothPoint[][]
        | ViolinKdePoint[][]